code: def GetFirstWrittenEventSource(self):
      
      if not self._storage_file:
        raise IOError('Unable to read from closed storage writer.')
  
      event_source = self._storage_file.GetEventSourceByIndex(
          self._first_written_event_source_index)
  
      if event_source:
        self._written_event_source_index = (
            self._first_written_event_source_index + 1)
      return event_source
docs: Retrieves the first event source that was written after open.
  
      Using GetFirstWrittenEventSource and GetNextWrittenEventSource newly
      added event sources can be retrieved in order of addition.
  
      Returns:
        EventSource: event source or None if there are no newly written ones.
  
      Raises:
        IOError: when the storage writer is closed.
        OSError: when the storage writer is closed.