code: def assertDictAlmostEqual(a, b):
      for k, v in a.items():
          assert k in b, f"Key {k} not found in {b}"
          w = b[k]
  
          assert type(v) == type(w), f"Type {type(v)} is not {type(w)}"
  
          if isinstance(v, dict):
              assert assertDictAlmostEqual(v, w), f"Subdict {v} != {w}"
          elif isinstance(v, (int, float)):
              assert np.isclose(v, w)
          elif isinstance(v, (list, tuple)):
              # Does not work for nested dicts or lists
              assert all(x == y for x, y in zip(v, w))
          else:
              assert v == w
  
      return True
  
imports: from collections import defaultdict
  from unittest.mock import patch
  import numpy
  import unittest
  import ray
  import ray.tune.search.sample
  from ray import train, tune
  from ray.tune import Experiment
  from ray.tune.search.util import logger
  from ray.tune.search.variant_generator import generate_variants
label_desc: Use image node_id 2 for calling a global function with example usage: assertDictAlmostEqual(a, b) and returns: True