code: def _process_replay(self, controller, observations, config):
      f = features.features_from_game_info(
          game_info=controller.game_info()
      )
  
      while True:
          o = controller.observe()
          obs = f.transform_obs(o)
  
          if o.player_result:  # end of game
              break
  
          unit_type = obs.feature_screen.unit_type
          self.assertEqual(
              tuple(observations[o.observation.game_loop].flatten()),
              tuple(unit_type.flatten()),
          )
  
          self.assertIn(
              len(o.actions), (0, 1), "Expected 0 or 1 action"
          )
  
          if o.actions:
              func = f.reverse_action(o.actions[0])
  
              # Action is reported one frame later.
              executed = config.actions.get(
                  o.observation.game_loop - 1, None
              )
  
              executed_func = executed(obs) if executed else None
              print(
                  "%4d Sent:     %s"
                  % (o.observation.game_loop, executed_func)
              )
              print(
                  "%4d Returned: %s" % (o.observation.game_loop, func)
              )
  
              if o.observation.game_loop == 2:
                  # Center camera is initiated automatically by the game and reported
                  # at frame 2.
                  self.assertEqual(
                      actions.FUNCTIONS.move_camera.id, func.function
                  )
                  continue
  
              self.assertEqual(func.function, executed_func.function)
              if func.function != actions.FUNCTIONS.select_point.id:
                  # select_point likes to return Toggle instead of Select.
                  self.assertEqual(
                      func.arguments, executed_func.arguments
                  )
              self.assertEqual(func.function, obs.last_actions[0])
  
          controller.step()
  
      return observations
  
imports: from absl.testing import absltest
  from pysc2 import maps
  from pysc2 import run_configs
  from pysc2.lib import actions
  from pysc2.lib import features
  from pysc2.lib import point
  from pysc2.lib import renderer_ascii
  from pysc2.lib import units
  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 ReplayObsTest obj's underlying member method code with example usage: obj._process_replay(controller, observations, config) and returns: observations