'putEvents(E) -- writes a single or multiple events, depending on
whether an \'Event\' object, or a list of \'Event\' objects is
given as an argument.'

def putEvents(self, E):

    if isinstance(E, Event):
        buf = E.serialize()
    else:
        buf = ''
        num = 0
        for e in E:
            if (not isinstance(e, Event)):
                raise ('Element    %i    in    given    list    is    not    an    Event' % num)
            buf = (buf + e.serialize())
            num = (num + 1)
    self.sendRequest(PUT_EVT, buf)
    (status, bufsize, resp_buf) = self.receiveResponse()
    if (status != PUT_OK):
        raise IOError('Events    could    not    be    written.')
