def deprecated(message=None):
def decorated_method_to_deprecate(func):<EOL><INDENT>if inspect.isclass(func):<EOL><INDENT>msg = "<STR_LIT>".format(func.__name__)<EOL>if message:<EOL><INDENT>msg += "<STR_LIT>" % message<EOL><DEDENT>warnings.simplefilter('<STR_LIT>', DeprecationWarning)  <EOL>warnings.warn(msg, category=DeprecationWarning, stacklevel=<NUM_LIT:2>)<EOL>warnings.simplefilter('<STR_LIT:default>', DeprecationWarning)  <EOL>return func<EOL><DEDENT>@wraps(func)<EOL>def new_func(*args, **kwargs):<EOL><INDENT>msg = "<STR_LIT>".format(func.__name__)<EOL>if message:<EOL><INDENT>msg += "<STR_LIT>" % message<EOL><DEDENT>warnings.simplefilter('<STR_LIT>', DeprecationWarning)  <EOL>warnings.warn(msg, category=DeprecationWarning, stacklevel=<NUM_LIT:2>)<EOL>warnings.simplefilter('<STR_LIT:default>', DeprecationWarning)  <EOL>return func(*args, **kwargs)<EOL><DEDENT>return new_func<EOL><DEDENT>return decorated_method_to_deprecate<EOL>
This decorator marks methods as deprecated.
        A warning is displayed if the method is called.