code: def test_index_not_found_raises(index_or_series, any_string_dtype):
      obj = index_or_series(
          ["ABCDEFG", "BCDEFEF", "DEFGHIJEF", "EFGHEF"],
          dtype=any_string_dtype,
      )
      with pytest.raises(ValueError, match="substring not found"):
          obj.str.index("DE")
  
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 17 for calling a global function with example usage: test_index_not_found_raises(index_or_series, any_string_dtype) without return types