code: def main(unused_argv):
      stopwatch.sw.enable()
  
      results = []
      try:
          for config, interface in configs:
              print((" Starting: %s " % config).center(60, "-"))
              timeline = []
  
              run_config = run_configs.get()
  
              if FLAGS.replay:
                  replay_data = run_config.replay_data(FLAGS.replay)
                  start_replay = sc_pb.RequestStartReplay(
                      replay_data=replay_data,
                      options=interface,
                      disable_fog=False,
                      observed_player_id=2,
                  )
                  version = replay.get_replay_version(replay_data)
                  run_config = run_configs.get(
                      version=version
                  )  # Replace the run config.
              else:
                  map_inst = maps.get(FLAGS.map)
                  create = sc_pb.RequestCreateGame(
                      realtime=False,
                      disable_fog=False,
                      random_seed=1,
                      local_map=sc_pb.LocalMap(
                          map_path=map_inst.path,
                          map_data=map_inst.data(run_config),
                      ),
                  )
                  create.player_setup.add(type=sc_pb.Participant)
                  create.player_setup.add(
                      type=sc_pb.Computer,
                      race=sc_common.Terran,
                      difficulty=sc_pb.VeryEasy,
                  )
                  join = sc_pb.RequestJoinGame(
                      options=interface, race=sc_common.Protoss
                  )
  
              with run_config.start(
                  want_rgb=interface.HasField("render")
              ) as controller:
                  if FLAGS.replay:
                      info = controller.replay_info(replay_data)
                      print(" Replay info ".center(60, "-"))
                      print(info)
                      print("-" * 60)
                      if info.local_map_path:
                          start_replay.map_data = run_config.map_data(
                              info.local_map_path
                          )
                      controller.start_replay(start_replay)
                  else:
                      controller.create_game(create)
                      controller.join_game(join)
  
                  for _ in range(FLAGS.count):
                      controller.step(FLAGS.step_mul)
                      start = time.time()
                      obs = controller.observe()
                      timeline.append(time.time() - start)
                      if obs.player_result:
                          break
  
              results.append((config, timeline))
      except KeyboardInterrupt:
          pass
  
      names, values = zip(*results)
  
      print("\n\nTimeline:\n")
      print(",".join(names))
      for times in zip(*values):
          print(",".join("%0.2f" % (t * 1000) for t in times))
  
      print(stopwatch.sw)
  
file_path: pysc2/pysc2/bin/benchmark_observe.py
imports: import time
  from absl import app
  from absl import flags
  from pysc2 import maps
  from pysc2 import run_configs
  from pysc2.lib import replay
  from pysc2.lib import stopwatch
  from s2clientprotocol import common_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: main(unused_argv) without return types