class_docstr: Dumps step renderings of environments as .gif files.
  
  Make sure to activate this only for rollouts and disable it during training (e.g. set export=False).
  Otherwise it will dump a lot off rollout GIFs to your disk.
  
  To convert the GIF into a mp4 video run:
  ffmpeg -r 1 -i <file-path>.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" <file-path>.mp4
  
  :param env: The environment to wrap.
  :param duration: Duration in seconds between consecutive image frames.
  :param export: Only if set to True a GIF is exported.
docstr: Intercept ``BaseEnv.reset`` and map observation.
docstr_tok: ["Intercept","``","BaseEnv.reset","``","and","map","observation","."]
code: def reset(self) -> MazeActionType:
      """Intercept ``BaseEnv.reset`` and map observation."""
  
      # reset wrapped env
      observation = self.env.reset()
  
      if self._export:
          # close previous writer
          if self._writer:
              self._writer.close()
  
          # init new writer
          self._time_stamp = datetime.now().strftime(
              "%d-%b-%Y_%H-%M-%S-%f"
          )
          gif_name = f"rollout_{self._time_stamp}.gif"
          self._writer = imageio.get_writer(
              gif_name, mode="I", duration=self._duration
          )
  
          # render initial state
          self._events = StepEventLog(env_time=0)
          self._render()
  
      return observation
  
imports: from datetime import datetime
  from typing import Optional, Tuple, Dict, Union, Any
  import gym
  import imageio
  import matplotlib.pyplot
  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_env import MazeEnv
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.observation_conversion import ObservationType
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.log_events.step_event_log import StepEventLog
  from maze.core.wrappers.maze_gym_env_wrapper import GymCoreEnv
  from maze.core.wrappers.wrapper import Wrapper
label_desc: Use image node_id 3 for calling the ExportGifWrapper obj's underlying member method code with example usage: obj.reset() and returns: observation