code: def deprecated_function(func, warning=DEPRECATED_FUNCTION_WARNING):
      
      @wraps(func)
      def wrapped_func(*args, **kwargs):
          warnings.warn(
              DEPRECATED_FUNCTION_WARNING.format(func),
              category=DeprecationWarning,
              stacklevel=2,
          )
          return func(*args, **kwargs)
  
      return wrapped_func
docs: Adds a `DeprecationWarning` to a function
  
      Parameters
      ----------
      func : `callable`
          the function to decorate with a `DeprecationWarning`
  
      warning : `str`, optional
          the warning to present
  
      Notes
      -----
      The final warning message is formatted as ``warning.format(func)``
      so you can use attribute references to the function itself.
      See the default message as an example.