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: Set the step limit.
  
  :param max_episode_steps: The environment step() function sets the done flag if this step limit is reached.
                            If 0, the step limit is disabled.
docstr_tok: ["Set","the","step","limit",".",":","param","max_episode_steps",":","The","environment","step","(",")","function","sets","the","done","flag","if","this","step","limit","is","reached",".","If","0",",","the","step","limit","is","disabled","."]
code: def set_max_episode_steps(self, max_episode_steps: int) -> None:
      """Set the step limit.
  
      :param max_episode_steps: The environment step() function sets the done flag if this step limit is reached.
                                If 0, the step limit is disabled.
  
      """
      # gym spec
      spec = getattr(self.env, "spec", None)
  
      if not max_episode_steps and spec is not None:
          max_episode_steps = spec.max_episode_steps
      if spec is not None:
          spec.max_episode_steps = max_episode_steps
  
      self._max_episode_steps = max_episode_steps
  
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 2 for calling the TimeLimitWrapper obj's underlying member method code with example usage: obj.set_max_episode_steps(max_episode_steps) without return types