code: def _compare_eq_cls(left, right, verbose, type_fns):
      isdatacls, isattrs = type_fns
      if isdatacls(left):
          all_fields = left.__dataclass_fields__
          fields_to_check = [
              field
              for field, info in all_fields.items()
              if info.compare
          ]
      elif isattrs(left):
          all_fields = left.__attrs_attrs__
          fields_to_check = [
              field.name
              for field in all_fields
              if getattr(field, ATTRS_EQ_FIELD)
          ]
  
      same = []
      diff = []
      for field in fields_to_check:
          if getattr(left, field) == getattr(right, field):
              same.append(field)
          else:
              diff.append(field)
  
      explanation = []
      if same and verbose < 2:
          explanation.append(
              "Omitting %s identical items, use -vv to show" % len(same)
          )
      elif same:
          explanation += ["Matching attributes:"]
          explanation += pprint.pformat(same).splitlines()
      if diff:
          explanation += ["Differing attributes:"]
          for field in diff:
              explanation += [
                  ("%s: %r != %r")
                  % (field, getattr(left, field), getattr(right, field))
              ]
      return explanation
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import pprint
  import six
  import _pytest._code
  from ..compat import Sequence
  from _pytest import outcomes
  from _pytest._io.saferepr import saferepr
  from _pytest.compat import ATTRS_EQ_FIELD
label_desc: Use image node_id 19 for calling a global function with example usage: _compare_eq_cls(left, right, verbose, type_fns) and returns: explanation