code: def assert_attr_equal(
      attr: str, left, right, obj: str = "Attributes"
  ) -> None:
      """
      Check attributes are equal. Both objects must have attribute.
  
      Parameters
      ----------
      attr : str
          Attribute name being compared.
      left : object
      right : object
      obj : str, default 'Attributes'
          Specify object name being compared, internally used to show appropriate
          assertion message
      """
      __tracebackhide__ = True
  
      left_attr = getattr(left, attr)
      right_attr = getattr(right, attr)
  
      if left_attr is right_attr or is_matching_na(
          left_attr, right_attr
      ):
          # e.g. both np.nan, both NaT, both pd.NA, ...
          return None
  
      try:
          result = left_attr == right_attr
      except TypeError:
          # datetimetz on rhs may raise TypeError
          result = False
      if (left_attr is pd.NA) ^ (right_attr is pd.NA):
          result = False
      elif not isinstance(result, bool):
          result = result.all()
  
      if not result:
          msg = f'Attribute "{attr}" are different'
          raise_assert_detail(obj, msg, left_attr, right_attr)
      return None
  
imports: from __future__ import annotations
  import operator
  from typing import Literal, cast
  import numpy
  from pandas._libs.missing import is_matching_na
  from pandas._libs.sparse import SparseIndex
  import pandas._libs.testing
  from pandas._libs.tslibs.np_datetime import compare_mismatched_resolutions
  from pandas.core.dtypes.common import is_bool, is_categorical_dtype, is_extension_array_dtype, is_integer_dtype, is_interval_dtype, is_number, is_numeric_dtype, needs_i8_conversion
  from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, PandasDtype
  from pandas.core.dtypes.missing import array_equivalent
  import pandas
  from pandas import Categorical, DataFrame, DatetimeIndex, Index, IntervalIndex, MultiIndex, PeriodIndex, RangeIndex, Series, TimedeltaIndex
  from pandas.core.algorithms import take_nd
  from pandas.core.arrays import DatetimeArray, ExtensionArray, IntervalArray, PeriodArray, TimedeltaArray
  from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
  from pandas.core.arrays.string_ import StringDtype
  from pandas.core.indexes.api import safe_sort_index
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 6 for calling a global function with example usage: assert_attr_equal(attr, left, right, obj) and returns: None, None