def METHOD_NAME(f, handle_arg=None):
    """Patch all args and kwargs of function f.
    If handle_arg is None, just return the original function.
    """
    def patched_input(*args, **kwargs):
        return f(*[handle_arg(arg) for arg in args], **{k: handle_arg(arg) for k, arg in viewitems(kwargs)})
    return patched_input if callable(handle_arg) else f