def deprecated(replacement=None):
def outer(fun):<EOL><INDENT>msg = "<STR_LIT>" % fun.__name__<EOL>if replacement is not None:<EOL><INDENT>msg += "<STR_LIT>" % replacement<EOL><DEDENT>if fun.__doc__ is None:<EOL><INDENT>fun.__doc__ = msg<EOL><DEDENT>@wraps(fun)<EOL>def inner(*args, **kwargs):<EOL><INDENT>warnings.warn(msg, category=DeprecationWarning, stacklevel=<NUM_LIT:2>)<EOL>return fun(*args, **kwargs)<EOL><DEDENT>return inner<EOL><DEDENT>return outer<EOL>
A decorator which can be used to mark functions as deprecated.