'getEvents([indices]) -- retrieve events and return them as a list
of Event objects. The \'indices\' argument is optional, and if given,
must be a tuple or list with inclusive, zero-based start/end indices.
The \'type\' and \'value\' fields of the event will be converted to strings
or Numpy arrays.'

def getEvents(self, index=None):

    if (index is None):
        request = struct.pack('HHI', VERSION, GET_EVT, 0)
    else:
        indS = int(index[0])
        indE = int(index[1])
        request = struct.pack('HHIII', VERSION, GET_EVT, 8, indS, indE)
    self.sendRaw(request)
    (status, bufsize, resp_buf) = self.receiveResponse()
    if (status == GET_ERR):
        return []
    if (status != GET_OK):
        self.disconnect()
        raise IOError('Bad    response    from    buffer    server    -    disconnecting')
    offset = 0
    E = []
    while 1:
        e = Event()
        nextOffset = e.deserialize(resp_buf[offset:])
        if (nextOffset == 0):
            break
        E.append(e)
        offset = (offset + nextOffset)
    return E
