code: def add_event(self, event):
          
          if not isinstance(event, event_pb2.Event):
              raise TypeError("Expected an event_pb2.Event proto, "
                              " but got %s" % type(event))
          self._async_writer.write(event.SerializeToString())
docs: Adds an event to the event file.
  
          Args:
            event: An `Event` protocol buffer.