def __getitem__(self, i):
        obj = super(BaseAnalogSignal, self).__getitem__(i)
        if isinstance(i, int):
            return obj
        elif isinstance(i, tuple):
            j, k = i
            if isinstance(k, int):
                if isinstance(j, slice):  # extract an AnalogSignal
                    obj = AnalogSignal(obj, sampling_rate=self.sampling_rate)
                    if j.start:
                        obj.t_start = (self.t_start +
                                       j.start * self.sampling_period)
                # return a Quantity (for some reason quantities does not
                # return a Quantity in this case)
                elif isinstance(j, int):
                    obj = pq.Quantity(obj, units=self.units)
                return obj
            elif isinstance(j, int):  # extract a quantity array
                # should be a better way to do this
                obj = pq.Quantity(np.array(obj), units=obj.units)
                return obj
            else:
                return obj
        elif isinstance(i, slice):
            if i.start:
                obj.t_start = self.t_start + i.start * self.sampling_period
            return obj
        else:
            raise IndexError("index should be an integer, tuple or slice")
Get the item or slice :attr:`i`.
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/core/analogsignalarray.py/AnalogSignalArray.__getitem__