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: Return the graph manager according to the command line arguments given by the user.
  :param args: the arguments given by the user
  :return: the graph manager, not bound to task_parameters yet.
docstr_tok: ["Return","the","graph","manager","according","to","the","command","line","arguments","given","by","the","user",".",":","param","args",":","the","arguments","given","by","the","user",":","return",":","the","graph","manager",",","not","bound","to","task_parameters","yet","."]
code: def get_graph_manager_from_args(
      self, args: argparse.Namespace
  ) -> "GraphManager":
      """
      Return the graph manager according to the command line arguments given by the user.
      :param args: the arguments given by the user
      :return: the graph manager, not bound to task_parameters yet.
      """
      graph_manager = None
  
      # if a preset was given we will load the graph manager for the preset
      if args.preset is not None:
          graph_manager = short_dynamic_import(
              args.preset, ignore_module_case=True
          )
  
      # for human play we need to create a custom graph manager
      if args.play:
          from rl_coach.agents.human_agent import HumanAgentParameters
  
          env_params = short_dynamic_import(
              args.environment_type, ignore_module_case=True
          )()
          env_params.human_control = True
          schedule_params = HumanPlayScheduleParameters()
          graph_manager = BasicRLGraphManager(
              HumanAgentParameters(),
              env_params,
              schedule_params,
              VisualizationParameters(),
          )
  
      # Set framework
      # Note: Some graph managers (e.g. HAC preset) create multiple agents and the attribute is called agents_params
      if hasattr(graph_manager, "agent_params"):
          for (
              network_parameters
          ) in graph_manager.agent_params.network_wrappers.values():
              network_parameters.framework = args.framework
      elif hasattr(graph_manager, "agents_params"):
          for ap in graph_manager.agents_params:
              for network_parameters in ap.network_wrappers.values():
                  network_parameters.framework = args.framework
  
      if args.level:
          if isinstance(
              graph_manager.env_params.level, SingleLevelSelection
          ):
              graph_manager.env_params.level.select(args.level)
          else:
              graph_manager.env_params.level = args.level
  
      # set the seed for the environment
      if args.seed is not None and graph_manager.env_params is not None:
          graph_manager.env_params.seed = args.seed
  
      # visualization
      graph_manager.visualization_parameters.dump_gifs = (
          graph_manager.visualization_parameters.dump_gifs
          or args.dump_gifs
      )
      graph_manager.visualization_parameters.dump_mp4 = (
          graph_manager.visualization_parameters.dump_mp4
          or args.dump_mp4
      )
      graph_manager.visualization_parameters.render = args.render
      graph_manager.visualization_parameters.tensorboard = (
          args.tensorboard
      )
      graph_manager.visualization_parameters.print_networks_summary = (
          args.print_networks_summary
      )
  
      # update the custom parameters
      if args.custom_parameter is not None:
          unstripped_key_value_pairs = [
              pair.split("=")
              for pair in args.custom_parameter.split(";")
          ]
          stripped_key_value_pairs = [
              tuple([pair[0].strip(), pair[1].strip()])
              for pair in unstripped_key_value_pairs
              if len(pair) == 2
          ]
  
          # load custom parameters into run_dict
          for key, value in stripped_key_value_pairs:
              exec("graph_manager.{}={}".format(key, value))
  
      return graph_manager
  
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 2 for calling the CoachLauncher obj's underlying member method code with example usage: obj.get_graph_manager_from_args(args) and returns: graph_manager