code: def main():
      cmds = [
          method
          for method in dir(DocBuilder)
          if not method.startswith("_")
      ]
  
      joined = ",".join(cmds)
      argparser = argparse.ArgumentParser(
          description="pandas documentation builder",
          epilog=f"Commands: {joined}",
      )
  
      joined = ", ".join(cmds)
      argparser.add_argument(
          "command",
          nargs="?",
          default="html",
          help=f"command to run: {joined}",
      )
      argparser.add_argument(
          "--num-jobs",
          default="auto",
          help="number of jobs used by sphinx-build",
      )
      argparser.add_argument(
          "--no-api",
          default=False,
          help="omit api and autosummary",
          action="store_true",
      )
      argparser.add_argument(
          "--whatsnew",
          default=False,
          help="only build whatsnew (and api for links)",
          action="store_true",
      )
      argparser.add_argument(
          "--single",
          metavar="FILENAME",
          type=str,
          default=None,
          help=(
              "filename (relative to the 'source' folder) of section or method name to "
              "compile, e.g. 'development/contributing.rst', "
              "'pandas.DataFrame.join'"
          ),
      )
      argparser.add_argument(
          "--python-path",
          type=str,
          default=os.path.dirname(DOC_PATH),
          help="path",
      )
      argparser.add_argument(
          "-v",
          action="count",
          dest="verbosity",
          default=0,
          help=(
              "increase verbosity (can be repeated), "
              "passed to the sphinx build command"
          ),
      )
      argparser.add_argument(
          "--warnings-are-errors",
          "-W",
          action="store_true",
          help="fail if warnings are raised",
      )
      argparser.add_argument(
          "--no-browser",
          help="Don't open browser",
          default=False,
          action="store_true",
      )
      args = argparser.parse_args()
  
      if args.command not in cmds:
          joined = ", ".join(cmds)
          raise ValueError(
              f"Unknown command {args.command}. Available options: {joined}"
          )
  
      # Below we update both os.environ and sys.path. The former is used by
      # external libraries (namely Sphinx) to compile this module and resolve
      # the import of `python_path` correctly. The latter is used to resolve
      # the import within the module, injecting it into the global namespace
      os.environ["PYTHONPATH"] = args.python_path
      sys.path.insert(0, args.python_path)
      globals()["pandas"] = importlib.import_module("pandas")
  
      # Set the matplotlib backend to the non-interactive Agg backend for all
      # child processes.
      os.environ[
          "MPLBACKEND"
      ] = "module://matplotlib.backends.backend_agg"
  
      builder = DocBuilder(
          args.num_jobs,
          not args.no_api,
          args.whatsnew,
          args.single,
          args.verbosity,
          args.warnings_are_errors,
          args.no_browser,
      )
      return getattr(builder, args.command)()
  
imports: import argparse
  import csv
  import importlib
  import os
  import shutil
  import subprocess
  import sys
  import webbrowser
  import docutils
  import docutils.parsers.rst
label_desc: Use image node_id 1 for calling a global function with example usage: main() and returns: getattr