class_docstr: Environment wrapper for OpenSpiel RL environments.
class_docstr_tok: ["Environment","wrapper","for","OpenSpiel","RL","environments","."]
docstr: Steps the environment.
docstr_tok: ["Steps","the","environment","."]
code: def step(self, action: types.NestedArray) -> dm_env.TimeStep:
      """Steps the environment."""
      if self._reset_next_step:
          return self.reset()
  
      open_spiel_timestep = self._environment.step(action)
  
      if open_spiel_timestep.step_type == rl_environment.StepType.LAST:
          self._reset_next_step = True
  
      observations = self._convert_observation(open_spiel_timestep)
      rewards = np.asarray(open_spiel_timestep.rewards)
      discounts = np.asarray(open_spiel_timestep.discounts)
      step_type = open_spiel_timestep.step_type
  
      if step_type == rl_environment.StepType.FIRST:
          step_type = dm_env.StepType.FIRST
      elif step_type == rl_environment.StepType.MID:
          step_type = dm_env.StepType.MID
      elif step_type == rl_environment.StepType.LAST:
          step_type = dm_env.StepType.LAST
      else:
          raise ValueError(
              "Did not recognize OpenSpiel StepType: {}".format(
                  step_type
              )
          )
  
      return dm_env.TimeStep(
          observation=observations,
          reward=rewards,
          discount=discounts,
          step_type=step_type,
      )
  
imports: from typing import List, NamedTuple
  from acme import specs
  from acme import types
  import dm_env
  import numpy
  from open_spiel.python import rl_environment
label_desc: Use image node_id 3 for calling the OpenSpielWrapper obj's underlying member method code with example usage: obj.step(action) and returns: dm_env, self