def negate(func, name=None, doc=None):
    """Create a function which merely negates the result of 'func'.

        N = func.negate(f)
        N(x)  # equivalent to... not f(x)

    The name and docstring of the newly created function can be given through the 'name' and
    'doc' arguments.
    """
    def negate_func(*args, **kwargs):
        return not func(*args, **kwargs)

    negate_func.__name__ = name or "negate({})".format(func.__name__)
    negate_func.__doc__ = doc
    return negate_func