code: def test_observer(self):
      run_config = run_configs.get()
      map_inst = maps.get("Simple64")
  
      with run_config.start(want_rgb=False) as controller:
          create = sc_pb.RequestCreateGame(
              local_map=sc_pb.LocalMap(
                  map_path=map_inst.path,
                  map_data=map_inst.data(run_config),
              )
          )
          create.player_setup.add(
              type=sc_pb.Computer,
              race=sc_common.Random,
              difficulty=sc_pb.VeryEasy,
          )
          create.player_setup.add(
              type=sc_pb.Computer,
              race=sc_common.Random,
              difficulty=sc_pb.VeryHard,
          )
          create.player_setup.add(type=sc_pb.Observer)
          controller.create_game(create)
  
          join = sc_pb.RequestJoinGame(
              options=sc_pb.InterfaceOptions(),  # cheap observations
              observed_player_id=0,
          )
          controller.join_game(join)
  
          outcome = False
          for _ in range(60 * 60):  # 60 minutes should be plenty.
              controller.step(16)
              obs = controller.observe()
              if obs.player_result:
                  print(
                      "Outcome after %s steps (%0.1f game minutes):"
                      % (
                          obs.observation.game_loop,
                          obs.observation.game_loop / (16 * 60),
                      )
                  )
                  for r in obs.player_result:
                      print(
                          "Player %s: %s"
                          % (r.player_id, sc_pb.Result.Name(r.result))
                      )
                  outcome = True
                  break
  
          self.assertTrue(outcome)
  
file_path: pysc2/pysc2/tests/observer_test.py
imports: from absl.testing import absltest
  from pysc2 import maps
  from pysc2 import run_configs
  from pysc2.tests import utils
  from s2clientprotocol import common_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 1 for calling the TestObserver obj's underlying member method code with example usage: obj.test_observer() without return types