code: def test_hash():
      """Test dictionary hashing and comparison functions."""
      # does hashing all of these types work:
      # {dict, list, tuple, ndarray, str, float, int, None}
      d0 = dict(
          a=dict(a=0.1, b="fo", c=1),
          b=[1, "b"],
          c=(),
          d=np.ones(3),
          e=None,
      )
      d0[1] = None
      d0[2.0] = b"123"
  
      d1 = deepcopy(d0)
      assert len(object_diff(d0, d1)) == 0
      assert len(object_diff(d1, d0)) == 0
      assert object_hash(d0) == object_hash(d1)
  
      # change values slightly
      d1["data"] = np.ones(3, int)
      d1["d"][0] = 0
      assert object_hash(d0) != object_hash(d1)
  
      d1 = deepcopy(d0)
      assert object_hash(d0) == object_hash(d1)
      d1["a"]["a"] = 0.11
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
      assert object_hash(d0) != object_hash(d1)
  
      d1 = deepcopy(d0)
      assert object_hash(d0) == object_hash(d1)
      d1["a"]["d"] = 0  # non-existent key
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
      assert object_hash(d0) != object_hash(d1)
  
      d1 = deepcopy(d0)
      assert object_hash(d0) == object_hash(d1)
      d1["b"].append(0)  # different-length lists
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
      assert object_hash(d0) != object_hash(d1)
  
      d1 = deepcopy(d0)
      assert object_hash(d0) == object_hash(d1)
      d1["e"] = "foo"  # non-None
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
      assert object_hash(d0) != object_hash(d1)
  
      d1 = deepcopy(d0)
      d2 = deepcopy(d0)
      d1["e"] = StringIO()
      d2["e"] = StringIO()
      d2["e"].write("foo")
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
  
      d1 = deepcopy(d0)
      d1[1] = 2
      assert len(object_diff(d0, d1)) > 0
      assert len(object_diff(d1, d0)) > 0
      assert object_hash(d0) != object_hash(d1)
  
      # generators (and other types) not supported
      d1 = deepcopy(d0)
      d2 = deepcopy(d0)
      d1[1] = (x for x in d0)
      d2[1] = (x for x in d0)
      pytest.raises(RuntimeError, object_diff, d1, d2)
      pytest.raises(RuntimeError, object_hash, d1)
  
      x = sparse.eye(2, 2, format="csc")
      y = sparse.eye(2, 2, format="csr")
      assert "type mismatch" in object_diff(x, y)
      y = sparse.eye(2, 2, format="csc")
      assert len(object_diff(x, y)) == 0
      y[1, 1] = 2
      assert "elements" in object_diff(x, y)
      y = sparse.eye(3, 3, format="csc")
      assert "shape" in object_diff(x, y)
      y = 0
      assert "type mismatch" in object_diff(x, y)
  
      # smoke test for gh-4796
      assert object_hash(np.int64(1)) != 0
      assert object_hash(np.bool_(True)) != 0
  
imports: from copy import deepcopy
  from datetime import datetime, timezone
  from io import StringIO
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import sparse
  from mne import pick_types, read_cov, read_evokeds
  from mne._fiff.pick import _picks_by_type
  from mne.epochs import make_fixed_length_epochs
  from mne.io import read_raw_fif
  from mne.time_frequency import tfr_morlet
  from mne.utils import _PCA, _apply_scaling_array, _apply_scaling_cov, _array_equal_nan, _cal_to_julian, _custom_lru_cache, _dt_to_julian, _freq_mask, _get_inst_data, _julian_to_cal, _julian_to_dt, _reg_pinv, _ReuseCycle, _time_mask, _undo_scaling_array, _undo_scaling_cov, compute_corr, create_slices, grand_average, hashfunc, numerics, object_diff, object_hash, object_size, random_permutation, sum_squared
  from mne.utils.numerics import _LRU_CACHE_MAXSIZES, _LRU_CACHES
label_desc: Use image node_id 13 for calling a global function with example usage: test_hash() without return types