def _get_method(name, func):
def method(self, *args, **kw):<EOL><INDENT>return func(self, *args, **kw)<EOL><DEDENT>method.__name__ = name<EOL>return method<EOL>
Turns a callable object (like a mock) into a real function