def require(predicate):
def decorator(method):<EOL><INDENT>@functools.wraps(method)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>if predicate():<EOL><INDENT>return method(*args, **kwargs)<EOL><DEDENT>return None<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Decorator factory for methods requiring a predicate. If the
    predicate is not fulfilled during a method call, the method call
    is skipped and None is returned.

    :param predicate: A callable returning a truth value
    :returns: Method decorator

    .. seealso::

        :py:class:`internet`