code: def doc_replace(obj, oldval, newval):
      """Decorator to take the docstring from obj, with oldval replaced by newval
  
      Equivalent to ``func.__doc__ = obj.__doc__.replace(oldval, newval)``
  
      Parameters
      ----------
      obj : object
          The object to take the docstring from.
      oldval : string
          The string to replace from the original docstring.
      newval : string
          The string to replace ``oldval`` with.
      """
      # __doc__ may be None for optimized Python (-OO)
      doc = (obj.__doc__ or "").replace(oldval, newval)
  
      def inner(func):
          func.__doc__ = doc
          return func
  
      return inner
  
file_path: scipy/scipy/_lib/doccer.py
imports: import sys
label_desc: Use image node_id 9 for calling a global function with example usage: doc_replace(obj, oldval, newval) and returns: inner, func