code: def test_slice_locs_na_raises(self):
      index = Index([np.nan, 1, 2])
      with pytest.raises(KeyError, match=""):
          index.slice_locs(start=1.5)
  
      with pytest.raises(KeyError, match=""):
          index.slice_locs(end=1.5)
  
imports: import numpy
  import pytest
  from pandas.errors import InvalidIndexError
  from pandas import NA, Index, RangeIndex, Series, Timestamp
  import pandas._testing
  from pandas.core.arrays import ArrowExtensionArray, FloatingArray
label_desc: Use image node_id 5 for calling the TestSliceLocs obj's underlying member method code with example usage: obj.test_slice_locs_na_raises() without return types