code: def test_index_equal_category_mismatch(
      check_categorical, using_infer_string
  ):
      if using_infer_string:
          dtype = "string"
      else:
          dtype = "object"
      msg = f"""Index are different
  
  Attribute "dtype" are different
  \\[left\\]:  CategoricalDtype\\(categories=\\['a', 'b'\\], ordered=False, \
  categories_dtype={dtype}\\)
  \\[right\\]: CategoricalDtype\\(categories=\\['a', 'b', 'c'\\], \
  ordered=False, categories_dtype={dtype}\\)"""
  
      idx1 = Index(Categorical(["a", "b"]))
      idx2 = Index(Categorical(["a", "b"], categories=["a", "b", "c"]))
  
      if check_categorical:
          with pytest.raises(AssertionError, match=msg):
              tm.assert_index_equal(
                  idx1, idx2, check_categorical=check_categorical
              )
      else:
          tm.assert_index_equal(
              idx1, idx2, check_categorical=check_categorical
          )
  
imports: import numpy
  import pytest
  from pandas import NA, Categorical, CategoricalIndex, Index, MultiIndex, NaT, RangeIndex
  import pandas._testing
label_desc: Use image node_id 13 for calling a global function with example usage: test_index_equal_category_mismatch(check_categorical, using_infer_string) without return types