class_docstr: This class is responsible for gathering all user-specified configuration options, parsing them,
  instantiating a GraphManager and then starting that GraphManager with either improve() or evaluate().
  This class is also responsible for launching multiple processes.
  It is structured so that it can be sub-classed to provide alternate mechanisms to configure and launch
  Coach jobs.
  
  The key entry-point for this class is the .launch() method which is expected to be called from __main__
  and handle absolutely everything for a job.
class_docstr_tok: ["This","class","is","responsible","for","gathering","all","user-specified","configuration","options",",","parsing","them",",","instantiating","a","GraphManager","and","then","starting","that","GraphManager","with","either","improve","(",")","or","evaluate","(",")",".","This","class","is","also","responsible","for","launching","multiple","processes",".","It","is","structured","so","that","it","can","be","sub-classed","to","provide","alternate","mechanisms","to","configure","and","launch","Coach","jobs",".","The","key","entry-point","for","this","class","is","the",".launch","(",")","method","which","is","expected","to","be","called","from","__main__","and","handle","absolutely","everything","for","a","job","."]
docstr: This returns an ArgumentParser object which defines the set of options that customers are expected to supply in order
  to launch a coach job.
docstr_tok: ["This","returns","an","ArgumentParser","object","which","defines","the","set","of","options","that","customers","are","expected","to","supply","in","order","to","launch","a","coach","job","."]
code: def get_argument_parser(self) -> argparse.ArgumentParser:
      """
      This returns an ArgumentParser object which defines the set of options that customers are expected to supply in order
      to launch a coach job.
      """
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "-p",
          "--preset",
          help="(string) Name of a preset to run (class name from the 'presets' directory.)",
          default=None,
          type=str,
      )
      parser.add_argument(
          "-l",
          "--list",
          help="(flag) List all available presets",
          action="store_true",
      )
      parser.add_argument(
          "-e",
          "--experiment_name",
          help="(string) Experiment name to be used to store the results.",
          default=None,
          type=str,
      )
      parser.add_argument(
          "-ep",
          "--experiment_path",
          help="(string) Path to experiments folder.",
          default=None,
          type=str,
      )
      parser.add_argument(
          "-r",
          "--render",
          help="(flag) Render environment",
          action="store_true",
      )
      parser.add_argument(
          "-f",
          "--framework",
          help="(string) Neural network framework. Available values: tensorflow, mxnet",
          default="tensorflow",
          type=str,
      )
      parser.add_argument(
          "-n",
          "--num_workers",
          help="(int) Number of workers for multi-process based agents, e.g. A3C",
          default=1,
          type=int,
      )
      parser.add_argument(
          "-c",
          "--use_cpu",
          help="(flag) Use only the cpu for training. If a GPU is not available, this flag will have no "
          "effect and the CPU will be used either way.",
          action="store_true",
      )
      parser.add_argument(
          "-ew",
          "--evaluation_worker",
          help="(flag) If multiple workers are used, add an evaluation worker as well which will "
          "evaluate asynchronously and independently during the training. NOTE: this worker will "
          "ignore the evaluation settings in the preset's ScheduleParams.",
          action="store_true",
      )
      parser.add_argument(
          "--play",
          help="(flag) Play as a human by controlling the game with the keyboard. "
          "This option will save a replay buffer with the game play.",
          action="store_true",
      )
      parser.add_argument(
          "--evaluate",
          help="(int) Run evaluation only, for at least the given number of steps (note that complete "
          "episodes are evaluated). This is a convenient way to disable training in order "
          "to evaluate an existing checkpoint. If value is 0, or no value is provided, "
          "evaluation will run for an infinite number of steps.",
          nargs="?",
          const=0,
          type=int,
      )
      parser.add_argument(
          "-v",
          "--verbosity",
          help="(flag) Sets the verbosity level of Coach print outs. Can be either low or high.",
          default="low",
          type=str,
      )
      parser.add_argument(
          "-tfv",
          "--tf_verbosity",
          help="(flag) TensorFlow verbosity level",
          default=3,
          type=int,
      )
      parser.add_argument(
          "--nocolor",
          help="(flag) Turn off color-codes in screen logging.  Ascii text only",
          action="store_true",
      )
      parser.add_argument(
          "-s",
          "--checkpoint_save_secs",
          help="(int) Time in seconds between saving checkpoints of the model.",
          default=None,
          type=int,
      )
      parser.add_argument(
          "-crd",
          "--checkpoint_restore_dir",
          help="(string) Path to a folder containing a checkpoint to restore the model from.",
          type=str,
      )
      parser.add_argument(
          "-crf",
          "--checkpoint_restore_file",
          help="(string) Path to a checkpoint file to restore the model from.",
          type=str,
      )
      parser.add_argument(
          "-dg",
          "--dump_gifs",
          help="(flag) Enable the gif saving functionality.",
          action="store_true",
      )
      parser.add_argument(
          "-dm",
          "--dump_mp4",
          help="(flag) Enable the mp4 saving functionality.",
          action="store_true",
      )
      parser.add_argument(
          "-et",
          "--environment_type",
          help="(string) Choose an environment type class to override on top of the selected preset.",
          default=None,
          type=str,
      )
      parser.add_argument(
          "-lvl",
          "--level",
          help="(string) Choose the level that will be played in the environment that was selected."
          "This value will override the level parameter in the environment class.",
          default=None,
          type=str,
      )
      parser.add_argument(
          "-cp",
          "--custom_parameter",
          help="(string) Semicolon separated parameters used to override specific parameters on top of"
          " the selected preset (or on top of the command-line assembled one). "
          "Whenever a parameter value is a string, it should be inputted as '\\\"string\\\"'. "
          "For ex.: "
          '"visualization_parameters.render=False; heatup_steps=EnvironmentSteps(1000);'
          "improve_steps=TrainingSteps(100000); optimizer='rmsprop'\"",
          default=None,
          type=str,
      )
      parser.add_argument(
          "--print_networks_summary",
          help="(flag) Print network summary to stdout",
          action="store_true",
      )
      parser.add_argument(
          "-tb",
          "--tensorboard",
          help="(flag) When using the TensorFlow backend, enable TensorBoard log dumps. ",
          action="store_true",
      )
      parser.add_argument(
          "-ns",
          "--no_summary",
          help="(flag) Prevent Coach from printing a summary and asking questions at the end of runs",
          action="store_true",
      )
      parser.add_argument(
          "-d",
          "--open_dashboard",
          help="(flag) Open dashboard with the experiment when the run starts",
          action="store_true",
      )
      parser.add_argument(
          "--seed",
          help="(int) A seed to use for running the experiment",
          default=None,
          type=int,
      )
      parser.add_argument(
          "-onnx",
          "--export_onnx_graph",
          help="(flag) Export the ONNX graph to the experiment directory. "
          "This will have effect only if the --checkpoint_save_secs flag is used in order to store "
          "checkpoints, since the weights checkpoint are needed for the ONNX graph. "
          "Keep in mind that this can cause major overhead on the experiment. "
          "Exporting ONNX graphs requires manually installing the tf2onnx package "
          "(https://github.com/onnx/tensorflow-onnx).",
          action="store_true",
      )
      parser.add_argument(
          "-dc",
          "--distributed_coach",
          help="(flag) Use distributed Coach.",
          action="store_true",
      )
      parser.add_argument(
          "-dcp",
          "--distributed_coach_config_path",
          help="(string) Path to config file when using distributed rollout workers."
          "Only distributed Coach parameters should be provided through this config file."
          "Rest of the parameters are provided using Coach command line options."
          "Used only with --distributed_coach flag."
          "Ignored if --distributed_coach flag is not used.",
          type=str,
      )
      parser.add_argument(
          "--memory_backend_params", help=argparse.SUPPRESS, type=str
      )
      parser.add_argument(
          "--data_store_params", help=argparse.SUPPRESS, type=str
      )
      parser.add_argument(
          "--distributed_coach_run_type",
          help=argparse.SUPPRESS,
          type=RunType,
          default=RunType.ORCHESTRATOR,
          choices=list(RunType),
      )
      parser.add_argument(
          "-asc",
          "--apply_stop_condition",
          help="(flag) If set, this will apply a stop condition on the run, defined by reaching a"
          "target success rate as set by the environment or a custom success rate as defined "
          "in the preset. ",
          action="store_true",
      )
      parser.add_argument(
          "--dump_worker_logs",
          help="(flag) Only used in distributed coach. If set, the worker logs are saved in the experiment dir",
          action="store_true",
      )
      parser.add_argument(
          "--is_multi_node_test",
          help=argparse.SUPPRESS,
          action="store_true",
      )
  
      return parser
  
imports: import sys
  import copy
  from configparser import ConfigParser, Error
  import os
  from rl_coach import logger
  import traceback
  from rl_coach.logger import screen, failed_imports
  import argparse
  import atexit
  import time
  import sys
  import json
  from rl_coach.base_parameters import Frameworks, VisualizationParameters, TaskParameters, DistributedTaskParameters, RunType, DistributedCoachSynchronizationType
  from rl_coach.core_types import TotalStepsCounter, RunPhase, PlayingStepsType, TrainingSteps, EnvironmentEpisodes, EnvironmentSteps, StepMethod, Transition
  from multiprocessing import Process
  from multiprocessing.managers import BaseManager
  import subprocess
  from glob import glob
  from rl_coach.graph_managers.graph_manager import HumanPlayScheduleParameters, GraphManager
  from rl_coach.utils import list_all_presets, short_dynamic_import, get_open_port, SharedMemoryScratchPad, get_base_dir, set_gpu
  from rl_coach.graph_managers.basic_rl_graph_manager import BasicRLGraphManager
  from rl_coach.environments.environment import SingleLevelSelection
  from rl_coach.memories.backend.redis import RedisPubSubMemoryBackendParameters
  from rl_coach.memories.backend.memory_impl import construct_memory_params
  from rl_coach.data_stores.data_store import DataStoreParameters
  from rl_coach.data_stores.s3_data_store import S3DataStoreParameters
  from rl_coach.data_stores.nfs_data_store import NFSDataStoreParameters
  from rl_coach.data_stores.redis_data_store import RedisDataStoreParameters
  from rl_coach.data_stores.data_store_impl import get_data_store, construct_data_store_params
  from rl_coach.training_worker import training_worker
  from rl_coach.rollout_worker import rollout_worker
  from rl_coach.schedules import *
  from rl_coach.exploration_policies.e_greedy import *
label_desc: Use image node_id 6 for calling the CoachLauncher obj's underlying member method code with example usage: obj.get_argument_parser() and returns: parser