def empty(self):
self._lock.acquire()<EOL>try:<EOL><INDENT>out = self._buffer.tostring()<EOL>del self._buffer[:]<EOL>if (self._event is not None) and not self._closed:<EOL><INDENT>self._event.clear()<EOL><DEDENT>return out<EOL><DEDENT>finally:<EOL><INDENT>self._lock.release()<EOL><DEDENT>
Clear out the buffer and return all data that was in it.

@return: any data that was in the buffer prior to clearing it out
@rtype: str