code: def get_flat_action(obs: Dict[str, Any]) -> Dict[str, Any]:
      """Extracts action, with components starting action/, from an observation."""
      result = {
          k[len("action/") :]: v
          for k, v in obs.items()
          if k.startswith("action/")
      }
      if not result:
          raise ValueError(
              f"Failed to parse action from observation: {obs}"
          )
      return result
  
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 2 for calling a global function with example usage: get_flat_action(obs) and returns: result