code: def gen_rst(module_path, f):
      name = to_module(module_path)
      module = importlib.import_module(name)
      title = name + " package"
      sep = "=" * len(title)
      doc = module.__doc__
      if doc is None:
          doc = ""
      f.write(
          f"""
  {title}
  {sep}
  {doc}
  
  """
      )
  
      for cpath in glob(module_path + "/**/*.py", recursive=True):
          print(cpath)
          if not os.path.exists(cpath):
              continue
          if "__pycache__" in cpath:
              continue
          cname = to_module(cpath)
          csep = "-" * len(cname)
          f.write(
              f"""
  .. _{cname}:
  
  {cname}
  {csep}
  
  .. automodule:: {cname}
      :members:
      :undoc-members:
      :show-inheritance:
  
  """
          )
      f.flush()
  
imports: from glob import glob
  import importlib
  import os
  import configargparse
label_desc: Use image node_id 2 for calling a global function with example usage: gen_rst(module_path, f) without return types