Writes the body of an event object to the spreadsheet.

    Args:
      event (EventObject): event.
342734
def WriteEventBody(self, event):
    
    for field_name in self._fields:
      if field_name == 'datetime':
        output_value = self._FormatDateTime(event)
      else:
        output_value = self._dynamic_fields_helper.GetFormattedField(
            event, field_name)

      output_value = self._RemoveIllegalXMLCharacters(output_value)

      # Auto adjust the column width based on the length of the output value.
      column_index = self._fields.index(field_name)
      self._column_widths.setdefault(column_index, 0)

      if field_name == 'datetime':
        column_width = min(
            self._MAX_COLUMN_WIDTH, len(self._timestamp_format) + 2)
      else:
        column_width = min(self._MAX_COLUMN_WIDTH, len(output_value) + 2)

      self._column_widths[column_index] = max(
          self._MIN_COLUMN_WIDTH, self._column_widths[column_index],
          column_width)
      self._sheet.set_column(
          column_index, column_index, self._column_widths[column_index])

      if (field_name == 'datetime'
          and isinstance(output_value, datetime.datetime)):
        self._sheet.write_datetime(
            self._current_row, column_index, output_value)
      else:
        self._sheet.write(self._current_row, column_index, output_value)

    self._current_row += 1
739285
def send(self, event):
        
        try:
            processed_event = self.process_event(event)
        except EventEmissionExit:
            return
        else:
            self.send_to_backends(processed_event)
57492
def handle(self, event):
        
        callback = getattr(self, 'on_{event}'.format(event=event.event), None)
        callback(event)
630195
def publish_events(self, events):
        
        content = self._serialize.body(events, '[CustomerIntelligenceEvent]')
        self._send(http_method='POST',
                   location_id='b5cc35c2-ff2b-491d-a085-24b6e9f396fd',
                   version='5.0-preview.1',
                   content=content)
646050
def record_event(self, event):
        
        with open(self._path, 'a') as file_:
            file_.write(str(event) + '\n')
1278582
def write_items(self, calendar):
        
        for item in self.items:
            event = Event()
            for ifield, efield in ITEM_EVENT_FIELD_MAP:
                val = item.get(ifield)
                if val is not None:
                    event.add(efield, val)
            calendar.add_component(event)
183896
def append_body(self, dom: str):
        
        self.flush_stdout()
        self.body.append(dom)
        self._last_update_time = time.time()
765161
@Override
    public synchronized void write(final Event event) throws IOException
    {
        if (!acceptsEvents) {
            log.warn("Writer not ready, discarding event: {}", event);
            return;
        }

        delegate.write(event);
        uncommittedWriteCount++;

        commitIfNeeded();
    }
734674
def add_event(self, func: Callable, event: str) -> None:
        
        self._events[event].add(func)
1280472
public synchronized void insert_event(EventData event) {
        events.add(event);
        while (events.size() > max_size)
            events.remove(0);
    }
1294791
def add_event(self, event, prepend=False):
        
        if prepend:
            self._events.insert(0, event)
        else:
            self._events.append(event)
577104
def write_events(stream, events):
    '''
    
    '''
    for event in events:
        data = event.SerializeToString()
        len_field = struct.pack('<Q', len(data))
        len_crc = struct.pack('<I', masked_crc(len_field))
        data_crc = struct.pack('<I', masked_crc(data))
        stream.write(len_field)
        stream.write(len_crc)
        stream.write(data)
        stream.write(data_crc)
62114
def on_event(self, event):
        
        self._queue.append((event))
        if not self._active and self.plot.document:
            self.plot.document.add_timeout_callback(self.process_on_event, 50)
            self._active = True
1238458
@Override
	public AuditFileWriter write(String event) {

		String str2 = event + CoreConstants.NEW_LINE;
		out.put(str2.getBytes(Charset.forName("UTF-8")));
		return this;
	}
480252
def create_event(self, event):
        
        ev = api.Event.create(self.journal.collection, event)
        ev.save()
686025
@Override
  public boolean write(SimpleDataEvent event) {
    events.add(event);
    if (events.size() >= bulkSize) {
      List<SimpleDataEvent> eventsCopy = new ArrayList<SimpleDataEvent>(this.events);
      events.clear();
      LOG.info("Sending ES bulk index event with " + eventsCopy.size() + " events");
      HttpPost postMethod = new HttpPost(esBaseUrl + "/" + ES_BULK_END_POINT);
      StringEntity postEntity;
      TimerContext timerContext = null;
      try {
        postEntity = new StringEntity(getBulkData(eventsCopy), "UTF-8");
        postMethod.setEntity(postEntity);
        postMethod.expectContinue();
        timerContext = startRequestTimer();
        boolean returnValue = execute(postMethod);
        return returnValue;
      } catch (UnsupportedEncodingException uee) {
        LOG.error("Error sending event: " + uee);
        return false;
      } finally {
        if (timerContext != null) {
          stopRequestTimer(timerContext);
        }
      }
    }
    return true;
  }
601504
def _event_funcs(self, event: str) -> Iterable[Callable]:
        
        for func in self._events[event]:
            yield func