code: def assert_dshape_equal(a, b, check_dim=True, path=None, **kwargs):
      """Assert that two dshapes are equal, providing an informative error
      message when they are not equal.
  
      Parameters
      ----------
      a, b : dshape
          The dshapes to check for equality.
      check_dim : bool, optional
          Check shapes for equality with respect to their dimensions.
          default: True
      check_tz : bool, optional
          Checks times and datetimes for equality with respect to timezones.
          default: True
      check_timedelta_unit : bool, optional
          Checks timedeltas for equality with respect to their unit (us, ns, ...).
          default: True
      check_str_encoding : bool, optional
          Checks strings for equality with respect to their encoding.
          default: True
      check_str_fixlen : bool, optional
          Checks string for equality with respect to their fixlen.
          default: True
      check_record_order : bool, optional
          Checks records for equality with respect to the order of the fields.
          default: True
  
      Raises
      ------
      AssertionError
          Raised when the two dshapes are not equal.
      """
      ashape = a.shape
      bshape = b.shape
  
      if path is None:
          path = ()
  
      if check_dim:
          for n, (adim, bdim) in enumerate(zip(ashape, bshape)):
              if adim != bdim:
                  path += (".shape[%d]" % n,)
                  raise AssertionError(
                      "dimensions do not match: %s != %s%s\n%s"
                      % (
                          adim,
                          bdim,
                          (
                              "\n%s != %s"
                              % (
                                  " * ".join(map(str, ashape)),
                                  " * ".join(map(str, bshape)),
                              )
                          )
                          if len(a.shape) > 1
                          else "",
                          _fmt_path(path),
                      ),
                  )
  
      path += (".measure",)
      assert_dshape_equal(
          a.measure, b.measure, check_dim=check_dim, path=path, **kwargs
      )
  
file_path: datashader/datashader/datashape/util/testing.py
imports: from abc import ABC
  from ..coretypes import DataShape, DateTime, Function, Option, Record, String, Time, TimeDelta, Tuple, Units
  from ..dispatch import dispatch
label_desc: Use image node_id 2 for calling a global function with example usage: assert_dshape_equal(a, b, check_dim, path) without return types