code: def create_modules_toc_file(
      master_package, modules, opts, name="modules"
  ):
      """
      Create the module's index.
      """
      text = format_heading(1, "%s Modules" % opts.header)
      text += ".. toctree::\n"
      text += "   :maxdepth: %s\n\n" % opts.maxdepth
  
      modules.sort()
      prev_module = ""
      for module in modules:
          # look if the module is a subpackage and, if yes, ignore it
          if module.startswith(prev_module + "."):
              continue
          prev_module = module
          text += "   %s\n" % module
  
      write_file(name, text, opts)
  
file_path: holoviews/doc/generate_modules.py
imports: import os
  import optparse
label_desc: Use image node_id 8 for calling a global function with example usage: create_modules_toc_file(master_package, modules, opts, name) without return types