code: def main(prog=None, subcommand_overrides={}):
      """
      The :mod:`~allennlp.run` command only knows about the registered classes in the ``allennlp``
      codebase. In particular, once you start creating your own ``Model`` s and so forth, it won't
      work for them, unless you use the ``--include-package`` flag.
      """
      # pylint: disable=dangerous-default-value
      parser = argparse.ArgumentParser(
          description="Run AllenNLP", usage="%(prog)s", prog=prog
      )
      parser.add_argument(
          "--version", action="version", version="%(prog)s "
      )
  
      subparsers = parser.add_subparsers(title="Commands", metavar="")
  
      subcommands = {
          # Default commands
          "configure": Configure(),
          "train": Train(),
          "evaluate": Evaluate(),
          "predict": Predict(),
          "make-vocab": MakeVocab(),
          "elmo": Elmo(),
          "fine-tune": FineTune(),
          "dry-run": DryRun(),
          "test-install": TestInstall(),
      }
  
      for name, subcommand in list(subcommands.items()):
          subparser = subcommand.add_subparser(name, subparsers)
          # configure doesn't need include-package because it imports
          # whatever classes it needs.
          if name != "configure":
              subparser.add_argument(
                  "--include-package",
                  type=unicode,
                  action="append",
                  default=[],
                  help="additional packages to include",
              )
  
      args = parser.parse_args()
  
      # If a subparser is triggered, it adds its work as `args.func`.
      # So if no such attribute has been added, no subparser was triggered,
      # so give the user some help.
      if "func" in dir(args):
          # Import any additional modules needed (to register custom classes).
          for package_name in getattr(args, "include_package", ()):
              import_submodules(package_name)
          args.func(args)
      else:
          parser.print_help()
  
file_path: magnitude/pymagnitude/third_party/allennlp/commands/__init__.py
imports: from __future__ import absolute_import
  import argparse
  import logging
  from allennlp.commands.configure import Configure
  from allennlp.commands.elmo import Elmo
  from allennlp.commands.evaluate import Evaluate
  from allennlp.commands.fine_tune import FineTune
  from allennlp.commands.make_vocab import MakeVocab
  from allennlp.commands.predict import Predict
  from allennlp.commands.dry_run import DryRun
  from allennlp.commands.subcommand import Subcommand
  from allennlp.commands.test_install import TestInstall
  from allennlp.commands.train import Train
  from allennlp.common.util import import_submodules
label_desc: Use image node_id 1 for calling a global function with example usage: main(prog, subcommand_overrides) without return types