code: def get_parser() -> argparse.ArgumentParser:
      parser = argparse.ArgumentParser(
          usage="%(prog)s [OPTIONS] -o <OUTPUT_PATH> <MODULE_PATH> "
          "[EXCLUDE_PATTERN, ...]",
          epilog=__(
              "For more information, visit <https://www.sphinx-doc.org/>."
          ),
          description=__(
              """
  Look recursively in <MODULE_PATH> for Python modules and packages and create
  one reST file with automodule directives per package in the <OUTPUT_PATH>.
  
  The <EXCLUDE_PATTERN>s can be file and/or directory patterns that will be
  excluded from generation.
  
  Note: By default this script will not overwrite already created files."""
          ),
      )
  
      parser.add_argument(
          "--version",
          action="version",
          dest="show_version",
          version="%%(prog)s %s" % __display_version__,
      )
  
      parser.add_argument(
          "module_path", help=__("path to module to document")
      )
      parser.add_argument(
          "exclude_pattern",
          nargs="*",
          help=__(
              "fnmatch-style file and/or directory patterns "
              "to exclude from generation"
          ),
      )
  
      parser.add_argument(
          "-o",
          "--output-dir",
          action="store",
          dest="destdir",
          required=True,
          help=__("directory to place all output"),
      )
      parser.add_argument(
          "-q",
          action="store_true",
          dest="quiet",
          help=__("no output on stdout, just warnings on stderr"),
      )
      parser.add_argument(
          "-d",
          "--maxdepth",
          action="store",
          dest="maxdepth",
          type=int,
          default=4,
          help=__(
              "maximum depth of submodules to show in the TOC "
              "(default: 4)"
          ),
      )
      parser.add_argument(
          "-f",
          "--force",
          action="store_true",
          dest="force",
          help=__("overwrite existing files"),
      )
      parser.add_argument(
          "-l",
          "--follow-links",
          action="store_true",
          dest="followlinks",
          default=False,
          help=__(
              "follow symbolic links. Powerful when combined "
              "with collective.recipe.omelette."
          ),
      )
      parser.add_argument(
          "-n",
          "--dry-run",
          action="store_true",
          dest="dryrun",
          help=__("run the script without creating files"),
      )
      parser.add_argument(
          "-e",
          "--separate",
          action="store_true",
          dest="separatemodules",
          help=__("put documentation for each module on its own page"),
      )
      parser.add_argument(
          "-P",
          "--private",
          action="store_true",
          dest="includeprivate",
          help=__('include "_private" modules'),
      )
      parser.add_argument(
          "--tocfile",
          action="store",
          dest="tocfile",
          default="modules",
          help=__("filename of table of contents (default: modules)"),
      )
      parser.add_argument(
          "-T",
          "--no-toc",
          action="store_false",
          dest="tocfile",
          help=__("don't create a table of contents file"),
      )
      parser.add_argument(
          "-E",
          "--no-headings",
          action="store_true",
          dest="noheadings",
          help=__(
              "don't create headings for the module/package "
              "packages (e.g. when the docstrings already "
              "contain them)"
          ),
      )
      parser.add_argument(
          "-M",
          "--module-first",
          action="store_true",
          dest="modulefirst",
          help=__(
              "put module documentation before submodule "
              "documentation"
          ),
      )
      parser.add_argument(
          "--implicit-namespaces",
          action="store_true",
          dest="implicit_namespaces",
          help=__(
              "interpret module paths according to PEP-0420 "
              "implicit namespaces specification"
          ),
      )
      parser.add_argument(
          "-s",
          "--suffix",
          action="store",
          dest="suffix",
          default="rst",
          help=__("file suffix (default: rst)"),
      )
      parser.add_argument(
          "-F",
          "--full",
          action="store_true",
          dest="full",
          help=__("generate a full project with sphinx-quickstart"),
      )
      parser.add_argument(
          "-a",
          "--append-syspath",
          action="store_true",
          dest="append_syspath",
          help=__(
              "append module_path to sys.path, used when --full is given"
          ),
      )
      parser.add_argument(
          "-H",
          "--doc-project",
          action="store",
          dest="header",
          help=__("project name (default: root module name)"),
      )
      parser.add_argument(
          "-A",
          "--doc-author",
          action="store",
          dest="author",
          help=__("project author(s), used when --full is given"),
      )
      parser.add_argument(
          "-V",
          "--doc-version",
          action="store",
          dest="version",
          help=__("project version, used when --full is given"),
      )
      parser.add_argument(
          "-R",
          "--doc-release",
          action="store",
          dest="release",
          help=__(
              "project release, used when --full is given, "
              "defaults to --doc-version"
          ),
      )
  
      group = parser.add_argument_group(__("extension options"))
      group.add_argument(
          "--extensions",
          metavar="EXTENSIONS",
          dest="extensions",
          action="append",
          help=__("enable arbitrary extensions"),
      )
      for ext in EXTENSIONS:
          group.add_argument(
              "--ext-%s" % ext,
              action="append_const",
              const="sphinx.ext.%s" % ext,
              dest="extensions",
              help=__("enable %s extension") % ext,
          )
  
      group = parser.add_argument_group(__("Project templating"))
      group.add_argument(
          "-t",
          "--templatedir",
          metavar="TEMPLATEDIR",
          dest="templatedir",
          help=__("template directory for template files"),
      )
  
      return parser
  
imports: from __future__ import annotations
  import argparse
  import fnmatch
  import glob
  import locale
  import os
  import re
  import sys
  from copy import copy
  from importlib.machinery import EXTENSION_SUFFIXES
  from os import path
  from typing import TYPE_CHECKING, Any
  import sphinx.locale
  from sphinx import __display_version__, package_dir
  from sphinx.cmd.quickstart import EXTENSIONS
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.osutil import FileAvoidWrite, ensuredir
  from sphinx.util.template import ReSTRenderer
label_desc: Use image node_id 14 for calling a global function with example usage: get_parser() and returns: parser