class_docstr: A trajectory recording wrapper. Supports both standard gym envs and BaseEnvs, as well as environments
  that provide more access -- SerializableEnvMixin for access to environment components
  and RecordableEnvMixin for access to MazeState and MazeExecution objects.
  
  :param env: the environment to wrap.
class_docstr_tok: ["A","trajectory","recording","wrapper",".","Supports","both","standard","gym","envs","and","BaseEnvs",",","as","well","as","environments","that","provide","more","access","--","SerializableEnvMixin","for","access","to","environment","components","and","RecordableEnvMixin","for","access","to","MazeState","and","MazeExecution","objects",".",":","param","env",":","the","environment","to","wrap","."]
docstr: Render the trajectory data collected during the last step, i.e. MazeState before the last step and
  MazeAction taken during that step.
  
  :param interactive: If true, builds a (blocking) keyboard-controlled trajectory viewer that allows browsing
    through states in the past steps. Note that this might not work well outside of terminal. Please check
    the note at
    :class:`maze.core.rendering.keyboard_controlled_trajectory_viewer.KeyboardControlledTrajectoryViewer`
    for more information.
  :param kwargs: Optionally, additional arguments that the renderer of the recorded env accepts can
    be passed in.
docstr_tok: ["Render","the","trajectory","data","collected","during","the","last","step",",","i.e",".","MazeState","before","the","last","step","and","MazeAction","taken","during","that","step",".",":","param","interactive",":","If","true",",","builds","a","(","blocking",")","keyboard-controlled","trajectory","viewer","that","allows","browsing","through","states","in","the","past","steps",".","Note","that","this","might","not","work","well","outside","of","terminal",".","Please","check","the","note","at",":","class",":","`","maze.core.rendering.keyboard_controlled_trajectory_viewer.KeyboardControlledTrajectoryViewer","`","for","more","information",".",":","param","kwargs",":","Optionally",",","additional","arguments","that","the","renderer","of","the","recorded","env","accepts","can","be","passed","in","."]
code: def render(self, interactive: bool = False, **kwargs) -> None:
      """Render the trajectory data collected during the last step, i.e. MazeState before the last step and
      MazeAction taken during that step.
  
      :param interactive: If true, builds a (blocking) keyboard-controlled trajectory viewer that allows browsing
        through states in the past steps. Note that this might not work well outside of terminal. Please check
        the note at
        :class:`maze.core.rendering.keyboard_controlled_trajectory_viewer.KeyboardControlledTrajectoryViewer`
        for more information.
      :param kwargs: Optionally, additional arguments that the renderer of the recorded env accepts can
        be passed in."""
      if not isinstance(self.env, RecordableEnvMixin):
          self.env.render()
          return
  
      assert (
          len(self.episode_record.step_records) > 0
      ), "There are no step records to render (yet?)"
      renderer = self.env.get_renderer()
  
      if interactive:
          trajectory_viewer = KeyboardControlledTrajectoryViewer(
              episode_record=self.episode_record,
              renderer=renderer,
              renderer_kwargs=kwargs,
          )
          trajectory_viewer.render()
      else:
          last_step_record = self.episode_record.step_records[-1]
          renderer.render(
              last_step_record.maze_state,
              last_step_record.maze_action,
              last_step_record.step_event_log,
              **kwargs,
          )
  
imports: import uuid
  from copy import deepcopy
  from typing import Union, Any, Tuple, Dict, Optional
  from maze.core.annotations import override
  from maze.core.env.base_env import BaseEnv
  from maze.core.env.event_env_mixin import EventEnvMixin
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.recordable_env_mixin import RecordableEnvMixin
  from maze.core.env.serializable_env_mixin import SerializableEnvMixin
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.time_env_mixin import TimeEnvMixin
  from maze.core.events.event_collection import EventCollection
  from maze.core.log_events.step_event_log import StepEventLog
  from maze.core.rendering.keyboard_controlled_trajectory_viewer import KeyboardControlledTrajectoryViewer
  from maze.core.trajectory_recording.records.raw_maze_state import RawState, RawMazeAction
  from maze.core.trajectory_recording.records.state_record import StateRecord
  from maze.core.trajectory_recording.records.trajectory_record import StateTrajectoryRecord
  from maze.core.trajectory_recording.writers.trajectory_writer_registry import TrajectoryWriterRegistry
  from maze.core.wrappers.wrapper import Wrapper
label_desc: Use image node_id 5 for calling the TrajectoryRecordingWrapper obj's underlying member method code with example usage: obj.render(interactive) without return types