code: def test_index_wrong_type_raises(
      index_or_series, any_string_dtype, method
  ):
      obj = index_or_series([], dtype=any_string_dtype)
      msg = "expected a string object, not int"
  
      with pytest.raises(TypeError, match=msg):
          getattr(obj.str, method)(0)
  
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 18 for calling a global function with example usage: test_index_wrong_type_raises(index_or_series, any_string_dtype, method) without return types