code: def test_slice_non_numeric(
      self, index, idx, frame_or_series, indexer_sli
  ):
      # GH 4892
      # float_indexers should raise exceptions
      # on appropriate Index types & accessors
  
      s = gen_obj(frame_or_series, index)
  
      # getitem
      if indexer_sli is tm.iloc:
          msg = (
              "cannot do positional indexing "
              rf"on {type(index).__name__} with these indexers \[(3|4)\.0\] of "
              "type float"
          )
      else:
          msg = (
              "cannot do slice indexing "
              rf"on {type(index).__name__} with these indexers "
              r"\[(3|4)(\.0)?\] "
              r"of type (float|int)"
          )
      with pytest.raises(TypeError, match=msg):
          indexer_sli(s)[idx]
  
      # setitem
      if indexer_sli is tm.iloc:
          # otherwise we keep the same message as above
          msg = "slice indices must be integers or None or have an __index__ method"
      with pytest.raises(TypeError, match=msg):
          indexer_sli(s)[idx] = 0
  
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, RangeIndex, Series, date_range, period_range, timedelta_range
  import pandas._testing
label_desc: Use image node_id 8 for calling the TestFloatIndexers obj's underlying member method code with example usage: obj.test_slice_non_numeric(index, idx, frame_or_series, indexer_sli) without return types