code: def deprecate_with_doc(msg):
      """
      Deprecates a function and includes the deprecation in its docstring.
  
      .. deprecated:: 2.0
          Use `~warnings.warn` with :exc:`DeprecationWarning` instead.
  
      This function is used as a decorator. It returns an object that can be
      used to issue a DeprecationWarning, by passing the to-be decorated
      function as argument, this adds warning to the to-be decorated function's
      docstring and returns the new function object.
  
      See Also
      --------
      deprecate : Decorate a function such that it issues a `DeprecationWarning`
  
      Parameters
      ----------
      msg : str
          Additional explanation of the deprecation. Displayed in the
          docstring after the warning.
  
      Returns
      -------
      obj : object
  
      """
  
      # Deprecated in NumPy 2.0, 2023-07-11
      warnings.warn(
          "`deprecate` is deprecated, "
          "use `warn` with `DeprecationWarning` instead. "
          "(deprecated in NumPy 2.0)",
          DeprecationWarning,
          stacklevel=2,
      )
  
      return _Deprecate(message=msg)
  
imports: import os
  import sys
  import textwrap
  import types
  import re
  import warnings
  import functools
  import platform
  from numpy._core import ndarray
  from numpy._utils import set_module
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: deprecate_with_doc(msg) and returns: _Deprecate