code: def main(unused_argv):
      """Run an agent."""
      if FLAGS.trace:
          stopwatch.sw.trace()
      elif FLAGS.profile:
          stopwatch.sw.enable()
  
      map_inst = maps.get(FLAGS.map)
  
      agent_classes = []
      players = []
  
      agent_module, agent_name = FLAGS.agent.rsplit(".", 1)
      agent_cls = getattr(
          importlib.import_module(agent_module), agent_name
      )
      agent_classes.append(agent_cls)
      players.append(
          sc2_env.Agent(
              sc2_env.Race[FLAGS.agent_race],
              FLAGS.agent_name or agent_name,
          )
      )
  
      if map_inst.players >= 2:
          if FLAGS.agent2 == "Bot":
              players.append(
                  sc2_env.Bot(
                      sc2_env.Race[FLAGS.agent2_race],
                      sc2_env.Difficulty[FLAGS.difficulty],
                      sc2_env.BotBuild[FLAGS.bot_build],
                  )
              )
          else:
              agent_module, agent_name = FLAGS.agent2.rsplit(".", 1)
              agent_cls = getattr(
                  importlib.import_module(agent_module), agent_name
              )
              agent_classes.append(agent_cls)
              players.append(
                  sc2_env.Agent(
                      sc2_env.Race[FLAGS.agent2_race],
                      FLAGS.agent2_name or agent_name,
                  )
              )
  
      threads = []
      for _ in range(FLAGS.parallel - 1):
          t = threading.Thread(
              target=run_thread,
              args=(agent_classes, players, FLAGS.map, False),
          )
          threads.append(t)
          t.start()
  
      run_thread(agent_classes, players, FLAGS.map, FLAGS.render)
  
      for t in threads:
          t.join()
  
      if FLAGS.profile:
          print(stopwatch.sw)
  
file_path: pysc2/pysc2/bin/agent.py
imports: import importlib
  import threading
  from absl import app
  from absl import flags
  from pysc2 import maps
  from pysc2.env import available_actions_printer
  from pysc2.env import run_loop
  from pysc2.env import sc2_env
  from pysc2.lib import point_flag
  from pysc2.lib import stopwatch
label_desc: Use image node_id 2 for calling a global function with example usage: main(unused_argv) without return types