code: def test_handles_rollout_with_error_in_last_reset():
      env = build_test_maze_env(ErrorInResetEnv)
      # The env raises an error in every second reset => with one episode, this will be the last reset
      # for stats collection
      _run_test_rollout(env, n_episodes=1)
  
imports: import queue
  from collections import deque
  from typing import Any, Type, Optional
  from maze.core.agent.random_policy import RandomPolicy
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.observation_conversion import ObservationType
  from maze.core.rollout.parallel_rollout_runner import ParallelRolloutWorker, EpisodeStatsReport
  from maze.test.shared_test_utils.dummy_env.dummy_core_env import DummyCoreEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_maze_env import DummyEnvironment
  from maze.test.shared_test_utils.dummy_env.space_interfaces.action_conversion.dict import DictActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.observation_conversion.dict import ObservationConversion
label_desc: Use image node_id 6 for calling a global function with example usage: test_handles_rollout_with_error_in_last_reset() without return types