code: def test_eq():
      eq = pg.functions.eq
  
      zeros = [
          0,
          0.0,
          np.float64(0),
          np.float32(0),
          np.int32(0),
          np.int64(0),
      ]
      for i, x in enumerate(zeros):
          for y in zeros[i:]:
              assert eq(x, y)
              assert eq(y, x)
  
      assert eq(np.nan, np.nan)
  
      # test
      class NotEq(object):
          def __eq__(self, x):
              return False
  
      noteq = NotEq()
      assert eq(noteq, noteq)  # passes because they are the same object
      assert not eq(noteq, NotEq())
  
      # Should be able to test for equivalence even if the test raises certain
      # exceptions
      class NoEq(object):
          def __init__(self, err):
              self.err = err
  
          def __eq__(self, x):
              raise self.err
  
      noeq1 = NoEq(AttributeError())
      noeq2 = NoEq(ValueError())
      noeq3 = NoEq(Exception())
  
      assert eq(noeq1, noeq1)
      assert not eq(noeq1, noeq2)
      assert not eq(noeq2, noeq1)
      with pytest.raises(Exception):
          eq(noeq3, noeq2)
  
      # test array equivalence
      # note that numpy has a weird behavior here--np.all() always returns True
      # if one of the arrays has size=0; eq() will only return True if both arrays
      # have the same shape.
      a1 = np.zeros((10, 20)).astype("float")
      a2 = a1 + 1
      a3 = a2.astype("int")
      a4 = np.empty((0, 20))
      assert not eq(a1, a2)  # same shape/dtype, different values
      assert not eq(a1, a3)  # same shape, different dtype and values
      assert not eq(
          a1, a4
      )  # different shape (note: np.all gives True if one array has size 0)
  
      assert not eq(a2, a3)  # same values, but different dtype
      assert not eq(a2, a4)  # different shape
  
      assert not eq(a3, a4)  # different shape and dtype
  
      assert eq(a4, a4.copy())
      assert not eq(a4, a4.T)
  
      # test containers
  
      assert not eq({"a": 1}, {"a": 1, "b": 2})
      assert not eq({"a": 1}, {"a": 2})
      d1 = {"x": 1, "y": np.nan, 3: ["a", np.nan, a3, 7, 2.3], 4: a4}
      d2 = deepcopy(d1)
      assert eq(d1, d2)
      d1_ordered = OrderedDict(d1)
      d2_ordered = deepcopy(d1_ordered)
      assert eq(d1_ordered, d2_ordered)
      assert not eq(d1_ordered, d2)
      items = list(d1.items())
      assert not eq(OrderedDict(items), OrderedDict(reversed(items)))
  
      assert not eq([1, 2, 3], [1, 2, 3, 4])
      l1 = [d1, np.inf, -np.inf, np.nan]
      l2 = deepcopy(l1)
      t1 = tuple(l1)
      t2 = tuple(l2)
      assert eq(l1, l2)
      assert eq(t1, t2)
  
      assert eq(set(range(10)), set(range(10)))
      assert not eq(set(range(10)), set(range(9)))
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  import pyqtgraph
  from pyqtgraph.functions import arrayToQPath, eq
  from pyqtgraph.Qt import QtGui
label_desc: Use image node_id 7 for calling a global function with example usage: test_eq() and returns: False