

def _maybe_cast_slice_bound(self, label, side, kind):
    "\n        This function should be overloaded in subclasses that allow non-trivial\n        casting on label-slice bounds, e.g. datetime-like indices allowing\n        strings containing formatted datetimes.\n\n        Parameters\n        ----------\n        label : object\n        side : {'left', 'right'}\n        kind : {'ix', 'loc', 'getitem'}\n\n        Returns\n        -------\n        label :  object\n\n        Notes\n        -----\n        Value of `side` parameter should be validated in caller.\n\n        "
    assert (kind in ['ix', 'loc', 'getitem', None])
    if is_float(self):
        if (not ((kind in ['ix']) and (self.holds_integer() or self.is_floating()))):
            self._invalid_indexer('slice', label)
    elif is_integer(label):
        self._invalid_indexer('slice', label)
    return label

dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py Index._maybe_cast_slice_bound/VarMisuse@36/214 `label`->`self`