code: def test_compatibility_with_dataset():
      env = build_dummy_maze_env()
      env = SpacesRecordingWrapper.wrap(env, output_dir="space_records")
  
      # Generate 5 episodes, 10 steps each
      env.reset()
      for _ in range(5):
          for _ in range(10):
              action = env.action_space.sample()
              env.step(action)
          env.reset()
  
      dataset = InMemoryDataset(
          n_workers=2,
          conversion_env_factory=None,
          input_data="space_records",
          trajectory_processor=IdentityTrajectoryProcessor(),
          deserialize_in_main_thread=False,
      )
  
      assert len(dataset) == 5 * 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 4 for calling a global function with example usage: test_compatibility_with_dataset() without return types