def close(self):
self.flush()<EOL>if self._recordio_writer is not None:<EOL><INDENT>self._recordio_writer.close()<EOL>self._recordio_writer = None<EOL><DEDENT>
Flushes the pending events and closes the writer after it is done.