code: def test_deterministic(space: Space, n: int, base_seed: int):
      """Tests the batched spaces are deterministic by using a copied version"""
      # Copy the spaces and check that the np_random are not reference equal
      space_a = space
      space_a.seed(base_seed)
      space_b = copy.deepcopy(space_a)
      assert_rng_equal(space_a.np_random, space_b.np_random)
      assert space_a.np_random is not space_b.np_random
  
      # Batch the spaces and check that the np_random are not reference equal
      space_a_batched = batch_space(space_a, n)
      space_b_batched = batch_space(space_b, n)
      assert_rng_equal(
          space_a_batched.np_random, space_b_batched.np_random
      )
      assert space_a_batched.np_random is not space_b_batched.np_random
      # Create that the batched space is not reference equal to the origin spaces
      assert space_a.np_random is not space_a_batched.np_random
  
      # Check that batched space a and b random number generator are not effected by the original space
      space_a.sample()
      space_a_batched_sample = space_a_batched.sample()
      space_b_batched_sample = space_b_batched.sample()
      for a_sample, b_sample in zip(
          iterate(space_a_batched, space_a_batched_sample),
          iterate(space_b_batched, space_b_batched_sample),
      ):
          if isinstance(a_sample, tuple):
              assert len(a_sample) == len(b_sample)
              for a_subsample, b_subsample in zip(a_sample, b_sample):
                  assert_array_equal(a_subsample, b_subsample)
          else:
              assert_array_equal(a_sample, b_sample)
  
file_path: gym/tests/vector/test_spaces.py
imports: import copy
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from gym.spaces import Box, Dict, MultiDiscrete, Space, Tuple
  from gym.vector.utils.spaces import batch_space, iterate
  from tests.vector.utils import CustomSpace, assert_rng_equal, custom_spaces, spaces
label_desc: Use image node_id 6 for calling a global function with example usage: test_deterministic(space, n, base_seed) without return types