def METHOD_NAME(function):
    new_function = FunctionType(six.get_function_code(function), globals())
    if six.PY3:
        new_function.__kwdefaults__ = function.__kwdefaults__
    new_function.__defaults__ = function.__defaults__
    return new_function