code: def test_scalar_with_mixed(self, indexer_sl):
      s2 = Series([1, 2, 3], index=["a", "b", "c"])
      s3 = Series([1, 2, 3], index=["a", "b", 1.5])
  
      # lookup in a pure string index with an invalid indexer
  
      with pytest.raises(KeyError, match="^1.0$"):
          indexer_sl(s2)[1.0]
  
      with pytest.raises(KeyError, match=r"^1\.0$"):
          indexer_sl(s2)[1.0]
  
      result = indexer_sl(s2)["b"]
      expected = 2
      assert result == expected
  
      # mixed index so we have label
      # indexing
      with pytest.raises(KeyError, match="^1.0$"):
          indexer_sl(s3)[1.0]
  
      if indexer_sl is not tm.loc:
          # __getitem__ falls back to positional
          msg = "Series.__getitem__ treating keys as positions is deprecated"
          with tm.assert_produces_warning(FutureWarning, match=msg):
              result = s3[1]
          expected = 2
          assert result == expected
  
      with pytest.raises(KeyError, match=r"^1\.0$"):
          indexer_sl(s3)[1.0]
  
      result = indexer_sl(s3)[1.5]
      expected = 3
      assert result == expected
  
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 4 for calling the TestFloatIndexers obj's underlying member method code with example usage: obj.test_scalar_with_mixed(indexer_sl) without return types