class_docstr: Implements dm_env.Environent; forwards calls to deepmind_lab.
class_docstr_tok: ["Implements","dm_env.Environent",";","forwards","calls","to","deepmind_lab","."]
code: def step(self, action):
      if self._needs_reset:
          return self.reset()
  
      lab_action = np.empty(self._action_count, dtype=np.dtype("int32"))
      for name, value in six.iteritems(action):
          lab_action[self._action_map[name]] = value
  
      reward = self._lab.step(lab_action)
  
      if self._lab.is_running():
          return dm_env.transition(
              reward=reward, observation=self._observation()
          )
      else:
          self._needs_reset = True
          return dm_env.termination(
              reward=reward, observation=self._observation()
          )
  
file_path: lab/python/dmenv_module.py
imports: import dm_env
  import numpy
  import six
  import deepmind_lab
label_desc: Use image node_id 4 for calling the Lab obj's underlying member method code with example usage: obj.step(action) and returns: self, dm_env, dm_env