code: def flush(self):
          
          if self._num_outstanding_events == 0 or self._recordio_writer is None:
              return
          self._recordio_writer.flush()
          if self._logger is not None:
              self._logger.info('wrote %d %s to disk', self._num_outstanding_events,
                                'event' if self._num_outstanding_events == 1 else 'events')
          self._num_outstanding_events = 0
docs: Flushes the event file to disk.