code: def test_records_multiple_episodes():
      env = build_dummy_maze_env()
      env = SpacesRecordingWrapper.wrap(env, output_dir="space_records")
  
      env.reset()
      for _ in range(5):
          for _ in range(10):
              action = env.action_space.sample()
              env.step(action)
          env.reset()
  
      dumped_files = os.listdir("space_records")
      assert len(dumped_files) == 5
  
      for file_path in dumped_files:
          with open("space_records/" + file_path, "rb") as in_f:
              episode_record = pickle.load(in_f)
  
          assert isinstance(episode_record, SpacesTrajectoryRecord)
          assert len(episode_record.step_records) == 10
  
file_path: maze/maze/test/core/wrappers/test_spaces_recording_wrapper.py
imports: import os
  import pickle
  import numpy
  from maze.core.trajectory_recording.datasets.in_memory_dataset import InMemoryDataset
  from maze.core.trajectory_recording.datasets.trajectory_processor import IdentityTrajectoryProcessor
  from maze.core.trajectory_recording.records.trajectory_record import SpacesTrajectoryRecord
  from maze.core.wrappers.spaces_recording_wrapper import SpacesRecordingWrapper
  from maze.test.shared_test_utils.helper_functions import build_dummy_maze_env, build_dummy_structured_env
label_desc: Use image node_id 2 for calling a global function with example usage: test_records_multiple_episodes() without return types