class_docstr: Wrapper to limit the environment step count, equivalent to gym.wrappers.time_limit.
  
  Additionally to the gym wrapper, this one supports adjusting the limit after construction.
  
  :param env: The environment to wrap.
  :param max_episode_steps: The maximum number of steps to take. If 0, the step limit is disabled.
class_docstr_tok: ["Wrapper","to","limit","the","environment","step","count",",","equivalent","to","gym.wrappers.time_limit",".","Additionally","to","the","gym","wrapper",",","this","one","supports","adjusting","the","limit","after","construction",".",":","param","env",":","The","environment","to","wrap",".",":","param","max_episode_steps",":","The","maximum","number","of","steps","to","take",".","If","0",",","the","step","limit","is","disabled","."]
docstr: Override BaseEnv.step and set done if the step limit is reached.
          
docstr_tok: ["Override","BaseEnv.step","and","set","done","if","the","step","limit","is","reached","."]
code: def step(self, action: Any) -> Tuple[Any, Any, bool, Dict[Any, Any]]:
      """Override BaseEnv.step and set done if the step limit is reached."""
      assert (
          self._elapsed_steps is not None
      ), "Cannot call env.step() before calling reset()"
      observation, reward, done, info = self.env.step(action)
  
      # load time from the environment or increment own step count it the environment does not manage
      # its own time
      if isinstance(self.env, TimeEnvMixin):
          self._elapsed_steps = self.env.get_env_time()
      else:
          self._elapsed_steps += 1
  
      if (
          self._max_episode_steps
          and self._elapsed_steps >= self._max_episode_steps
      ):
          info["TimeLimit.truncated"] = not done
          done = True
      return observation, reward, done, info
  
file_path: maze/maze/core/wrappers/time_limit_wrapper.py
imports: from typing import TypeVar, Union, Dict, Tuple, Any, Optional
  from maze.core.annotations import override
  from maze.core.env.base_env import BaseEnv
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.time_env_mixin import TimeEnvMixin
  from maze.core.wrappers.wrapper import Wrapper, EnvType
label_desc: Use image node_id 3 for calling the TimeLimitWrapper obj's underlying member method code with example usage: obj.step(action) and returns: observation,  reward,  done,  info