code: def test_list_getitem_invalid_index(list_dtype):
      ser = Series(
          [[1, 2, 3], [4, None, 5], None],
          dtype=ArrowDtype(list_dtype),
      )
      with pytest.raises(
          pa.lib.ArrowInvalid, match="Index -1 is out of bounds"
      ):
          ser.list[-1]
      with pytest.raises(
          pa.lib.ArrowInvalid, match="Index 5 is out of bounds"
      ):
          ser.list[5]
      with pytest.raises(
          ValueError, match="key must be an int or slice, got str"
      ):
          ser.list["abc"]
  
file_path: pandas/pandas/tests/series/accessors/test_list_accessor.py
imports: import re
  import pytest
  from pandas import ArrowDtype, Series
  import pandas._testing
  from pandas.compat import pa_version_under11p0
label_desc: Use image node_id 7 for calling a global function with example usage: test_list_getitem_invalid_index(list_dtype) without return types