code: def format_docstring(param_docs):
      """Returns a decorator that replaces param doc placeholders (e.g. '{{ param_name }}') in the
      docstring of the decorated function.
  
      Args:
          param_docs: A `ParamDocs` instance or `dict`.
  
      Returns:
          A decorator to apply the formatting.
  
      Examples:
          >>> param_docs = {"p1": "doc1", "p2": "doc2
          doc2 second line"}
          >>> @format_docstring(param_docs)
          ... def func(p1, p2):
          ...     '''
          ...     :param p1: {{ p1 }}
          ...     :param p2: {{ p2 }}
          ...     '''
          >>> import textwrap
          >>> print(textwrap.dedent(func.__doc__).strip())
          :param p1: doc1
          :param p2: doc2
                     doc2 second line
  
      """
      param_docs = ParamDocs(param_docs)
  
      def decorator(func):
          func.__doc__ = param_docs.format_docstring(func.__doc__)
          return func
  
      return decorator
  
imports: import textwrap
  import warnings
  from functools import wraps
  from typing import Dict
  import importlib_metadata
  from packaging.version import Version
  from mlflow.ml_package_versions import _ML_PACKAGE_VERSIONS
  from mlflow.utils.autologging_utils.versioning import FLAVOR_TO_MODULE_NAME_AND_VERSION_INFO_KEY
label_desc: Use image node_id 6 for calling a global function with example usage: format_docstring(param_docs) and returns: decorator, func