code: def is_method_of(method, object):
      
      if not callable(method) or not hasattr(method, "__name__"):
          return False
      if inspect.ismethod(method):
          return method.__self__ is object
      for cls in inspect.getmro(object.__class__):
          if cls.__dict__.get(method.__name__, None) is method:
              return True
      return False
docs: Decide whether ``method`` is contained within the MRO of ``object``.