code: def _deprecated(msg, stacklevel=2):
      """Deprecate a function by emitting a warning on use."""
  
      def wrap(fun):
          if isinstance(fun, type):
              warnings.warn(
                  "Trying to deprecate class {!r}".format(fun),
                  category=RuntimeWarning,
                  stacklevel=2,
              )
              return fun
  
          @functools.wraps(fun)
          def call(*args, **kwargs):
              warnings.warn(
                  msg,
                  category=DeprecationWarning,
                  stacklevel=stacklevel,
              )
              return fun(*args, **kwargs)
  
          call.__doc__ = msg
          return call
  
      return wrap
  
file_path: catboost/contrib/python/scipy/py3/scipy/_lib/deprecation.py
imports: import functools
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: _deprecated(msg, stacklevel) and returns: wrap, call, fun, fun