import inspect


def _is_method(func):
    """
    Check is function is defined inside a class.
    ASSUMES YOU ARE USING THE CONVENTION THAT FIRST ARG IS 'self'
    """

    sig = inspect.signature(func)
    return "self" in sig.parameters