code: def test_create_shared_memory(space, expected_type, n, ctx):
      def assert_nested_type(lhs, rhs, n):
          assert type(lhs) == type(rhs)
          if isinstance(lhs, (list, tuple)):
              assert len(lhs) == len(rhs)
              for lhs_, rhs_ in zip(lhs, rhs):
                  assert_nested_type(lhs_, rhs_, n)
  
          elif isinstance(lhs, (dict, OrderedDict)):
              assert set(lhs.keys()) ^ set(rhs.keys()) == set()
              for key in lhs.keys():
                  assert_nested_type(lhs[key], rhs[key], n)
  
          elif isinstance(lhs, SynchronizedArray):
              # Assert the length of the array
              assert len(lhs[:]) == n * len(rhs[:])
              # Assert the data type
              assert isinstance(lhs[0], type(rhs[0]))
          else:
              raise TypeError(f"Got unknown type `{type(lhs)}`.")
  
      ctx = mp if (ctx is None) else mp.get_context(ctx)
      shared_memory = create_shared_memory(space, n=n, ctx=ctx)
      assert_nested_type(shared_memory, expected_type, n=n)
  
file_path: gym/tests/vector/test_shared_memory.py
imports: import multiprocessing
  from collections import OrderedDict
  from multiprocessing import Array, Process
  from multiprocessing.sharedctypes import SynchronizedArray
  import numpy
  import pytest
  from gym.error import CustomSpaceError
  from gym.spaces import Dict, Tuple
  from gym.vector.utils.shared_memory import create_shared_memory, read_from_shared_memory, write_to_shared_memory
  from gym.vector.utils.spaces import BaseGymSpaces
  from tests.vector.utils import custom_spaces, spaces
label_desc: Use image node_id 1 for calling a global function with example usage: test_create_shared_memory(space, expected_type, n, ctx) without return types