class_docstr: Widget for displaying differences between hierarchical python data structures
  (eg, nested dicts, lists, and arrays)
docstr: Compare data structure *a* to structure *b*. 
code: def _compare(self, a, b):
      """
      Compare data structure *a* to structure *b*.
      """
      # Check test structures are the same
      assert type(info) is type(expect)
      if hasattr(info, "__len__"):
          assert len(info) == len(expect)
  
      if isinstance(info, dict):
          for k in info:
              assert k in expect
          for k in expect:
              assert k in info
              self.compare_results(info[k], expect[k])
      elif isinstance(info, list):
          for i in range(len(info)):
              self.compare_results(info[i], expect[i])
      elif isinstance(info, np.ndarray):
          assert info.shape == expect.shape
          assert info.dtype == expect.dtype
          if info.dtype.fields is None:
              intnan = (
                  -9223372036854775808
              )  # happens when np.nan is cast to int
              inans = np.isnan(info) | (info == intnan)
              enans = np.isnan(expect) | (expect == intnan)
              assert np.all(inans == enans)
              mask = ~inans
              assert np.allclose(info[mask], expect[mask])
          else:
              for k in info.dtype.fields.keys():
                  self.compare_results(info[k], expect[k])
      else:
          try:
              assert info == expect
          except Exception:
              raise NotImplementedError(
                  "Cannot compare objects of type %s" % type(info)
              )
  
file_path: pyqtgraph/pyqtgraph/widgets/DiffTreeWidget.py
imports: import numpy
  from ..None import functions
  from ..Qt import QtWidgets
  from .DataTreeWidget import DataTreeWidget
label_desc: Use image node_id 6 for calling the DiffTreeWidget obj's underlying member method code with example usage: obj._compare(a, b) without return types