code: def _convert_observation(
      converter, player_observation, force_action_delay, force_action_fn
  ):
      """Convert a raw observation proto and set action delay."""
      player_observation.force_action_delay = force_action_delay
      converted_observation = converter.convert_observation(
          player_observation
      )
      converter.convert_action(force_action_fn(converted_observation))
  
      def _squeeze_if_necessary(x):
          if x.shape == (1,):
              return np.squeeze(x)
          return x
  
      return tree.map_structure(
          _squeeze_if_necessary, converted_observation
      )
  
file_path: pysc2/pysc2/lib/replay/replay_converter.py
imports: import collections
  from typing import Any, Dict, Iterable, Sequence
  import numpy
  from pysc2.env.converter import converter
  from pysc2.env.converter import derive_interface_options
  from pysc2.env.converter.proto import converter_pb2
  from pysc2.lib.replay import replay_observation_stream
  from pysc2.lib.replay import sc2_replay
  from pysc2.lib.replay import sc2_replay_utils
  import tree
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _convert_observation(converter, player_observation, force_action_delay, force_action_fn) and returns: tree, x, np