

def __getitem__(self, key):
    'Returns the value at a given position/slice. It raises IndexError if the position is invalid,\n        or TypeError if the key type is invalid.'
    if isinstance(key, slice):
        return [self[i] for i in xrange(*key.indices(len(self)))]
    elif isinstance(key, int):
        if (key < 0):
            key += len(self)
        if ((key >= len(self)) or (key < 0)):
            raise IndexError('Index out of range')
        return self.getValueAbsolute(i)
    else:
        raise TypeError('Invalid argument type')

dataset/ETHPy150Open gbeced/pyalgotrade/pyalgotrade/dataseries/__init__.py DataSeries.__getitem__/VarMisuse@108/180 `key`->`i`