code: def deprecated(message=None):
      
      def _decorator(func, message=message):
          if message is None:
              message = '%s is deprecated' % func.__name__
  
          def newfunc(*args, **kwds):
              warnings.warn(message, DeprecationWarning, stacklevel=2)
              return func(*args, **kwds)
          return newfunc
      return _decorator
docs: A decorator for deprecated functions