code: def test_index_str_accessor_multiindex_raises():
      # MultiIndex has mixed dtype, but not allow to use accessor
      idx = MultiIndex.from_tuples([("a", "b"), ("a", "b")])
      assert idx.inferred_type == "mixed"
  
      msg = "Can only use .str accessor with Index, not MultiIndex"
      with pytest.raises(AttributeError, match=msg):
          idx.str
  
imports: from datetime import datetime, timedelta
  import numpy
  import pytest
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
  from pandas.core.strings.accessor import StringMethods
  from pandas.tests.strings import object_pyarrow_numpy
label_desc: Use image node_id 40 for calling a global function with example usage: test_index_str_accessor_multiindex_raises() without return types