code: def format_toctree_rst(package, subpackages, configs):
      return "\n\n".join(
          (
              rst_big_header(package.split(".")[-1]),
              *((subpackages,) if subpackages else ()),
              *((configs,) if configs else ()),
          )
      )
  
imports: import collections
  import contextlib
  import itertools
  import json
  import os
  import typing
  from pytext.config import ConfigBase, ExportConfig, PyTextConfig
  from pytext.config.component import Registry
  from pytext.config.serialize import config_to_json
  from pytext.utils.file_io import PathManager
  from sphinx.ext.napoleon import GoogleDocstring
  from sphinx.pycode import ModuleAnalyzer
label_desc: Use image node_id 14 for calling a global function with example usage: format_toctree_rst(package, subpackages, configs) and returns: str