

def _convert_slice_indexer(self, key, kind=None):
    "\n        convert a slice indexer. disallow floats in the start/stop/step\n\n        Parameters\n        ----------\n        key : label of the slice bound\n        kind : {'ix', 'loc', 'getitem', 'iloc'} or None\n        "
    assert (kind in ['ix', 'loc', 'getitem', 'iloc', None])
    if (not isinstance(key, slice)):
        return key
    if (kind == 'iloc'):
        return slice(self._validate_indexer('slice', key.start, kind), self._validate_indexer('slice', key.stop, kind), self._validate_indexer('slice', key.step, kind))
    (start, stop, step) = (key.start, key.stop, key.step)

    def is_int(v):
        return ((v is None) or is_integer(v))
    is_null_slicer = ((start is None) and (stop is None))
    is_index_slice = (is_int(start) and is_int(stop))
    is_positional = (is_index_slice and (not self.is_integer()))
    if (kind == 'getitem'):
        '\n            called from the getitem slicers, validate that we are in fact\n            integers\n            '
        if (self.is_integer() or is_index_slice):
            return slice(self._validate_indexer('slice', key.start, kind), self._validate_indexer('slice', key.stop, kind), self._validate_indexer('slice', key.step, kind))
    try:
        if (is_positional and self.is_mixed()):
            if (start is not None):
                i = self.get_loc(start)
            if (stop is not None):
                j = self.get_loc(stop)
            is_positional = False
    except KeyError:
        if (self.inferred_type == 'mixed-integer-float'):
            raise
    if is_null_slicer:
        indexer = indexer
    elif is_positional:
        indexer = key
    else:
        try:
            indexer = self.slice_indexer(start, stop, step, kind=kind)
        except Exception:
            if is_index_slice:
                if self.is_integer():
                    raise
                else:
                    indexer = key
            else:
                raise
    return indexer

dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py Index._convert_slice_indexer/VarMisuse@355/575 `key`->`indexer`