def set_event(self, event):
self._lock.acquire()<EOL>try:<EOL><INDENT>self._event = event<EOL>if self._closed or len(self._buffer) > <NUM_LIT:0>:<EOL><INDENT>event.set()<EOL><DEDENT>else:<EOL><INDENT>event.clear()<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self._lock.release()<EOL><DEDENT>
Set an event on this buffer.  When data is ready to be read (or the
buffer has been closed), the event will be set.  When no data is
ready, the event will be cleared.

:param threading.Event event: the event to set/clear