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 docstring is:\n{docstrings}"
              )
          fn.__doc__ = docstrings
          return fn
  
      return docstring_decorator
  
imports: import importlib
  import re
  from collections import OrderedDict
  from typing import List, Union
  from fastNLP.transformers.torch.configuration_utils import PretrainedConfig
  from fastNLP.transformers.torch.file_utils import CONFIG_NAME
  from fastNLP.core.log import logger
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