code: def replace_list_option_in_docstrings(
      config_to_class=None, use_model_types=True
  ):
      def docstring_decorator(fn):
          docstrings = fn.__doc__
          lines = docstrings.split("\n")
          i = 0
          while (
              i < len(lines)
              and re.search(r"^(\s*)List options\s*$", lines[i]) is None
          ):
              i += 1
          if i < len(lines):
              indent = re.search(
                  r"^(\s*)List options\s*$", lines[i]
              ).groups()[0]
              if use_model_types:
                  indent = f"{indent}    "
              lines[i] = _list_model_options(
                  indent,
                  config_to_class=config_to_class,
                  use_model_types=use_model_types,
              )
              docstrings = "\n".join(lines)
          else:
              raise ValueError(
                  f"The function {fn} should have an empty 'List options' in its docstring as placeholder, current"
                  f" docstring is:\n{docstrings}"
              )
          fn.__doc__ = docstrings
          return fn
  
      return docstring_decorator
  
imports: import importlib
  import os
  import re
  import warnings
  from collections import OrderedDict
  from typing import List, Union
  from ...configuration_utils import PretrainedConfig
  from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
  from ...utils import CONFIG_NAME, logging
label_desc: Use image node_id 5 for calling a global function with example usage: replace_list_option_in_docstrings(config_to_class, use_model_types) and returns: docstring_decorator, fn