from typing import Callable
from typing import Type
import inspect


def is_class_method(method: Callable, owner: Type) -> bool:
    """ return True if a function is a classmethod """
    assert callable(method) and owner is not None
    return inspect.ismethod(method) and getattr(method, "__self__", None) is owner