def __getitem__(self, key):
    if (not isinstance(key, tuple)):
        pidx = key
        cidx = slice(None)
        sidx = slice(None)
    else:
        lkey = len(key)
        if ((lkey < 1) or (lkey > 3)):
            raise IndexError('Wrong number of indices')
        elif (lkey == 1):
            pidx = key[0]
            cidx = slice(None)
            sidx = slice(None)
        elif (lkey == 2):
            pidx = key[0]
            cidx = key[1]
            sidx = slice(None)
        else:
            pidx = key[0]
            cidx = key[1]
            sidx = key[2]
    if isinstance(pidx, int):
        return self.read_voltage(pidx, chan_idx=cidx, sample_idx=sidx)
    (start, stop, step) = pidx.indices(self.shape[0])
    return self.read_voltage(start, stop, step, cidx, sidx)
def __getitem__(self, key):
    if (not isinstance(key, tuple)):
        pidx = key
        cidx = slice(None)
        sidx = slice(None)
    else:
        lkey = len(key)
        if ((lkey < 1) or (lkey > 3)):
            raise IndexError('Wrong number of indices')
        elif (lkey == 1):
            pidx = key[0]
            cidx = slice(None)
            sidx = slice(None)
        elif (lkey == 2):
            pidx = key[0]
            cidx = key[1]
            sidx = slice(None)
        else:
            pidx = key[0]
            cidx = key[1]
            sidx = key[2]
    if isinstance(pidx, int):
        return self.read_voltage(pidx, chan_idx=cidx, sample_idx=sidx)
    (start, stop, step) = pidx.indices(self.shape[0])
    return self.read_voltage(start, stop, step, cidx, sidx)