code: def testVsAgent(self):
      parallel = run_parallel.RunParallel()
      for _ in range(NUM_MATCHES):
          with host_remote_agent.VsAgent() as game:
              game.create_game("Simple64")
              controllers = [
                  remote_controller.RemoteController(  # pylint:disable=g-complex-comprehension
                      host=host, port=host_port
                  )
                  for host, host_port in zip(
                      game.hosts, game.host_ports
                  )
              ]
  
              join = sc_pb.RequestJoinGame(
                  options=sc_pb.InterfaceOptions(raw=True)
              )
              join.race = sc_common.Random
              join.shared_port = 0
              join.server_ports.game_port = game.lan_ports[0]
              join.server_ports.base_port = game.lan_ports[1]
              join.client_ports.add(
                  game_port=game.lan_ports[2],
                  base_port=game.lan_ports[3],
              )
  
              parallel.run((c.join_game, join) for c in controllers)
              for _ in range(STEPS):
                  parallel.run(c.step for c in controllers)
                  response_observations = [
                      c.observe() for c in controllers
                  ]
  
                  if response_observations[0].player_result:
                      break
  
              parallel.run(c.leave for c in controllers)
              parallel.run(c.close for c in controllers)
  
      parallel.shutdown()
  
file_path: pysc2/pysc2/tests/host_remote_agent_test.py
imports: from absl.testing import absltest
  from pysc2.env import host_remote_agent
  from pysc2.lib import remote_controller
  from pysc2.lib import run_parallel
  from pysc2.tests import utils
  from s2clientprotocol import common_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 2 for calling the TestHostRemoteAgent obj's underlying member method code with example usage: obj.testVsAgent() without return types