code: def converted_observation_stream(
      replay_data: bytes,
      player_id: int,
      converter_settings: converter_pb2.ConverterSettings,
      disable_fog: bool = False,
      max_steps: int = int(1e6),
  ):
      """Generator of transformed observations (incl. action and time delay)."""
  
      with replay_observation_stream.ReplayObservationStream(
          step_mul=1,
          game_steps_per_episode=max_steps,
          add_opponent_observations=True,
          interface_options=derive_interface_options.from_settings(
              converter_settings
          ),
          disable_fog=disable_fog,
      ) as replay_stream:
          replay_stream.start_replay_from_data(
              replay_data, player_id=player_id
          )
  
          obs_converter = converter_lib.Converter(
              converter_settings,
              environment_info=converter_pb2.EnvironmentInfo(
                  game_info=replay_stream.game_info(),
                  replay_info=replay_stream.replay_info(),
              ),
          )
  
          replay_file = sc2_replay.SC2Replay(replay_data)
          action_skips = sc2_replay_utils.raw_action_skips(replay_file)
          player_action_skips = action_skips[player_id]
          step_sequence = get_step_sequence(player_action_skips)
  
          observations_iterator = replay_stream.observations(
              step_sequence=step_sequence
          )
  
          def _accept_step_fn(step):
              return step in player_action_skips
  
          yield from converted_observations(
              observations_iterator, obs_converter, _accept_step_fn
          )
  
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 5 for calling a global function with example usage: converted_observation_stream(replay_data, player_id, converter_settings, disable_fog, max_steps) and returns: unknown