def is_callable(function):
        """Return whether the object is callable (i.e., some kind of function)."""
        if function is None:
            return False
        return any("__call__" in klass.__dict__ for klass in type(function).__mro__)
Return whether the object is callable (i.e., some kind of function).
stackoverflow/venv/lib/python3.6/site-packages/hamcrest/core/compat.py