def METHOD_NAME(f, *args, **kwds):
    """
    Returns a new function with positional and keyword arguments
    partially applied
    """
    def closure(*cargs, **ckwds):
        # Collect positional arguments
        tmp_args = list(args)
        tmp_args.extend(list(cargs))
        tmp_kwds = dict(kwds)
        tmp_kwds.update(ckwds)
        # Call the original function
        return f(*tmp_args, **tmp_kwds)
    return closure