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