def deprecated(extra):
def decorator(func):<EOL><INDENT>"""<STR_LIT>"""<EOL>@wraps(func)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>message = '<STR_LIT>'.format(<EOL>function=func.__name__,<EOL>extra=extra<EOL>)<EOL>frame = inspect.currentframe().f_back<EOL>warnings.warn_explicit(<EOL>message,<EOL>category=DeprecationWarning,<EOL>filename=inspect.getfile(frame.f_code),<EOL>lineno=frame.f_lineno<EOL>)<EOL>return func(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL><DEDENT>return decorator<EOL>
Flag a method as deprecated.

:param extra: Extra text you'd like to display after the default text.