code: def get_base_parser() -> argparse.ArgumentParser:
      base_parser = argparse.ArgumentParser(add_help=False)
      base_parser.add_argument(
          "config_path", help="experiment config file (.yaml)"
      )
      base_parser.add_argument(
          "model_dir",
          help="file or directory containing model definition",
      )
      base_parser.add_argument(
          "-i",
          "--include",
          type=str,
          nargs="+",
          help="additional files to copy into the task container",
      )
  
      base_parser.add_argument(
          "-mt",
          "--max-trials",
          type=int,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS["max-trials"],
          help="Maximum number of trials to run, including the model profile info trial",
      )
      base_parser.add_argument(
          "-ms",
          "--max-slots",
          type=int,
          help="Maximum number of slots to use concurrently",
      )
      base_parser.add_argument(
          "-mct",
          "--max-concurrent-trials",
          type=int,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS[
              "max-concurrent-trials"
          ],
          help="Maximum number of trials to run concurrently",
      )
      base_parser.add_argument(
          "-m",
          "--metric",
          type=str,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS["metric"],
          choices=_defaults.SMALLER_IS_BETTER_METRICS
          + _defaults.LARGER_IS_BETTER_METRICS,
      )
      base_parser.add_argument(
          "--run-full-experiment",
          action="store_true",
          help="Run full-length experiment using best-found configuration after dsat completes",
      )
      base_parser.add_argument(
          "-z",
          "--zero-stages",
          type=int,
          nargs="+",
          default=_defaults.AUTOTUNING_ARG_DEFAULTS["zero-stages"],
          choices=list(range(4)),
          help="Space-separated list of zero stages to search over",
      )
      base_parser.add_argument(
          "--start-profile-step",
          type=int,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS[
              "start-profile-step"
          ],
          help="Step on which to start profiling",
      )
      base_parser.add_argument(
          "--end-profile-step",
          type=int,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS["end-profile-step"],
          help="Step on which to stop profiling",
      )
      base_parser.add_argument(
          "-r",
          "--random-seed",
          type=int,
          default=_defaults.AUTOTUNING_ARG_DEFAULTS["random-seed"],
          help="Sets all random seeds",
      )
      base_parser.add_argument(
          "--search-runner-config",
          type=str,
          help="Path to an alternative search runner configuration file. For advanced use cases",
      )
      base_parser.add_argument(
          "--max-search-runner-restarts",
          type=int,
          default=5,
          help="Maximum search runner restarts",
      )
  
      return base_parser
  
imports: import argparse
  import copy
  import json
  import logging
  import pathlib
  import random
  from contextlib import contextmanager
  from typing import Any, Dict, Generator, List, Optional, Union
  import filelock
  import torch
  import determined
  from determined.common import util
  from determined.pytorch.dsat import _defaults
  from determined.util import merge_dicts
label_desc: Use image node_id 1 for calling a global function with example usage: get_base_parser() and returns: base_parser