code: def _mock_spaces_trajectory_record(step_count: int):
      """Produce an episode record with maze_states and maze_actions corresponding to the step no."""
      episode_record = SpacesTrajectoryRecord("test")
  
      for i in range(step_count):
          substep_record = SpacesRecord(
              actor_id=ActorID(0, 0),
              observation=dict(observation=np.array(i)),
              action=dict(action=np.array(i)),
              reward=0,
              done=i == step_count - 1,
          )
          episode_record.step_records.append(
              StructuredSpacesRecord(substep_records=[substep_record])
          )
  
      return episode_record
  
imports: import pickle
  from typing import Any, Dict, Union, Tuple, List, Optional
  import gym
  import numpy
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.structured_env import ActorID
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.log_events.step_event_log import StepEventLog
  from maze.core.trajectory_recording.datasets.trajectory_processor import IdentityTrajectoryProcessor
  from maze.core.trajectory_recording.records.spaces_record import SpacesRecord
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.core.trajectory_recording.records.state_record import StateRecord
  from maze.core.trajectory_recording.records.trajectory_record import StateTrajectoryRecord, SpacesTrajectoryRecord
  from maze.core.wrappers.maze_gym_env_wrapper import make_gym_maze_env
  from maze.core.wrappers.wrapper import ObservationWrapper
  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.double import DoubleActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.observation_conversion.double import DoubleObservationConversion
  from maze.test.shared_test_utils.run_maze_utils import run_maze_job
  from maze.core.trajectory_recording.datasets.in_memory_dataset import InMemoryDataset
label_desc: Use image node_id 2 for calling a global function with example usage: _mock_spaces_trajectory_record(step_count) and returns: episode_record