code: def AddEventSource(self, event_source):
      
      self._RaiseIfNotWritable()
  
      event_source = self._PrepareAttributeContainer(event_source)
  
      self._event_sources.append(event_source)
      self.number_of_event_sources += 1
docs: Adds an event source.
  
      Args:
        event_source (EventSource): event source.
  
      Raises:
        IOError: when the storage writer is closed.
        OSError: when the storage writer is closed.