code: def main():
      args = parser.parse_args()
      optimum_path = Path("optimum-doc-build")
      # Load optimum table of contents
      base_toc_path = next(optimum_path.rglob("_toctree.yml"))
      with open(base_toc_path, "r") as f:
          base_toc = yaml.safe_load(f)
  
      # Copy and rename all files from subpackages' docs to Optimum doc
      for subpackage in args.subpackages[::-1]:
          if subpackage == "neuron":
              # Neuron has its own doc so it is managed differently
              add_neuron_doc(base_toc)
          else:
              subpackage_path = Path(f"{subpackage}-doc-build")
  
              # Copy all HTML files from subpackage into optimum
              rename_copy_subpackage_html_paths(
                  subpackage,
                  subpackage_path,
                  optimum_path,
                  args.version,
              )
  
              # Load subpackage table of contents
              subpackage_toc_path = next(
                  subpackage_path.rglob("_toctree.yml")
              )
              with open(subpackage_toc_path, "r") as f:
                  subpackage_toc = yaml.safe_load(f)
              # Extend table of contents sections with the subpackage name as the parent folder
              rename_subpackage_toc(subpackage, subpackage_toc)
              # Just keep the name of the partner in the TOC title
              subpackage_toc[0]["title"] = subpackage_toc[0][
                  "title"
              ].split("Optimum ")[-1]
              if subpackage != "graphcore":
                  # Update optimum table of contents
                  base_toc.insert(1, subpackage_toc[0])
  
      # Write final table of contents
      with open(base_toc_path, "w") as f:
          yaml.safe_dump(base_toc, f, allow_unicode=True)
  
file_path: optimum/docs/combine_docs.py
imports: import argparse
  import shutil
  from pathlib import Path
  from typing import Dict, List
  import yaml
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types