class_docstr: Env presenting ConvertedEnvironment as multiple single player streams.
class_docstr_tok: ["Env","presenting","ConvertedEnvironment","as","multiple","single","player","streams","."]
docstr: Steps the underlying environment, syncing players.
docstr_tok: ["Steps","the","underlying","environment",",","syncing","players","."]
code: def step(self, action, player: int) -> dm_env.TimeStep:
      """Steps the underlying environment, syncing players."""
      self._actions[player] = action
  
      while True:
          self._wait_for_other_player()
          if player == 0:
              self._timestep = self._underlying_env.step(self._actions)
              self._actions = [None] * self._num_players
          self._wait_for_other_player()
          if self._underlying_env.is_player_turn()[player]:
              break
  
      return self._player_timestep(player)
  
imports: import functools
  import threading
  from typing import Any, Mapping, NamedTuple, Sequence
  import dm_env
  import numpy
  from pysc2.env.converter import converter
  from pysc2.env.converter.proto import converter_pb2
  from pysc2.lib import actions
  import tree
  import typing_extensions
  from s2clientprotocol import common_pb2
  from s2clientprotocol import raw_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 3 for calling the _StreamedEnvironment obj's underlying member method code with example usage: obj.step(action, player) and returns: self