code: def compare_numpy_dict(a, b, exact=True):
      
      if type(a) != type(b) and type(a) != np.ndarray and type(b) != np.ndarray:
          return False
      # go through a dictionary
      if type(a) == dict and type(b) == dict:
          if not a.keys() == b.keys():
              return False
          for key in a.keys():
              res = compare_numpy_dict(a[key], b[key], exact)
              if res == False:
                  print("false for key = ", key)
                  return False
          return True
  
      # if type(a) == np.ndarray and type(b) == np.ndarray:
      if type(a) == np.ndarray or type(b) == np.ndarray:
          if exact:
              return (a == b).all()
          else:
              return np.testing.assert_almost_equal(a, b)
  
      if a is None and b is None:
          return True
  
      raise NotImplementedError
docs: Compare two recursive numpy dictionaries