code: def assert_equals(a, b, prefix=None):
      """Assert equality of data structures `a` and `b`.
  
      Args:
          a: first data structure
          b: second data structure
          prefix: prefix for failed assertion message for types and dicts
      """
      assert type(a) == type(b), f"{prefix}Differing types: {a} and {b}"
      if isinstance(a, dict):
          assert list(a.keys()) == list(
              b.keys()
          ), f"{prefix}Key sets differ: {a} and {b}"
  
          for k in a.keys():
              v_a = a[k]
              v_b = b[k]
              assert_equals(v_a, v_b)
      elif isinstance(a, np.ndarray):
          np.testing.assert_array_equal(a, b)
      elif isinstance(a, tuple):
          for elem_from_a, elem_from_b in zip(a, b):
              assert_equals(elem_from_a, elem_from_b)
      else:
          assert a == b
  
imports: from typing import List, Optional
  import numpy
  import gym
  from gym import error, logger
  from gym.envs.registration import EnvSpec
label_desc: Use image node_id 2 for calling a global function with example usage: assert_equals(a, b, prefix) without return types