def __getitem__(self, item):
    if isinstance(item, slice):
        (start, stop, step) = util.decode_slice(item)
        if (isinstance(stop, int) and isinstance(start, int) and ((stop - start) <= 0)):
            return []
        elif ((isinstance(start, int) and (start < 0)) or (isinstance(stop, int) and (stop < 0))):
            return list(self)[item]
        res = self.slice(start, stop)
        if (step is not None):
            return list(res)[None:None:item.step]
        else:
            return list(res)
    elif (item == (- 1)):
        return list(self)[(- 1)]
    else:
        return list(self[item:(item + 1)])[0]
def __getitem__(self, item):
    if isinstance(item, slice):
        (start, stop, step) = util.decode_slice(item)
        if (isinstance(stop, int) and isinstance(start, int) and ((stop - start) <= 0)):
            return []
        elif ((isinstance(start, int) and (start < 0)) or (isinstance(stop, int) and (stop < 0))):
            return list(self)[item]
        res = self.slice(start, stop)
        if (step is not None):
            return list(res)[None:None:item.step]
        else:
            return list(res)
    elif (item == (- 1)):
        return list(self)[(- 1)]
    else:
        return list(self[item:(item + 1)])[0]