human
Complete this python program:
def deprecated_method(replacement):
assistant
#Here is the Python code you requested.

    """A decorator which can be used to mark a method as deprecated
    \replcement\ is the method name which will be called instead.
    """
    def outer(fun):
        msg = ('%s()    is    deprecated;    use    %s()    instead' % (fun.__name__, replacement))
        if (fun.__doc__ is None):
            fun.__doc__ = msg
        @functools.wraps(fun)
        def inner(self, *args, **kwargs):
            warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
            return getattr(self, replacement)(*args, **kwargs)
        return inner
    return outer