code: def GetFirstWrittenEventSource(self):
      
      if not self._is_open:
        raise IOError('Unable to read from closed storage writer.')
  
      if self._written_event_source_index >= len(self._event_sources):
        return None
  
      event_source = self._event_sources[self._first_written_event_source_index]
      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.