code: def deprecated(fn):
      
      @functools.wraps(fn)
      def wrapper(*args, **kwargs):
          warnings.warn(fn.__doc__.split('\n')[0],
                        category=DeprecationWarning, stacklevel=2)
          return fn(*args, **kwargs)
      return wrapper
docs: Mark a function as deprecated and warn the user on use.