def operator(name=None, operators=None, aliases=None, kind=None):
def delegator(assertion, subject, expected, *args, **kw):<EOL><INDENT>return assertion.test(subject, expected, *args, **kw)<EOL><DEDENT>def decorator(fn):<EOL><INDENT>operator = Operator(fn=fn, aliases=aliases, kind=kind)<EOL>_name = name if isinstance(name, six.string_types) else fn.__name__<EOL>operator.operators = (_name,)<EOL>_operators = operators<EOL>if isinstance(_operators, list):<EOL><INDENT>_operators = tuple(_operators)<EOL><DEDENT>if isinstance(_operators, tuple):<EOL><INDENT>operator.operators += _operators<EOL><DEDENT>Engine.register(operator)<EOL>return functools.partial(delegator, operator)<EOL><DEDENT>return decorator(name) if inspect.isfunction(name) else decorator<EOL>
Registers a new operator function in the test engine.

Arguments:
    *args: variadic arguments.
    **kw: variadic keyword arguments.

Returns:
    function