def __get_event(self, block=True, timeout=1):
        """
        Retrieves an event. If self._exceeding_event is not None, it'll be
        returned. Otherwise, an event is dequeued from the event buffer. If
        The event which was retrieved is bigger than the permitted batch size,
        it'll be omitted, and the next event in the event buffer is returned
        """
        while True:
            if self._exceeding_event:  # An event was omitted from last batch
                event = self._exceeding_event
                self._exceeding_event = None
            else:  # No omitted event, get an event from the queue
                event = self._event_queue.get(block, timeout)

            event_size = len(event)

            # If the event is bigger than the permitted batch size, ignore it
            # The ( - 2 ) accounts for the parentheses enclosing the batch
            if event_size - 2 >= self._batch_max_size:
                self._notify(logging.WARNING,
                             consts.LOG_MSG_OMITTED_OVERSIZED_EVENT
                             % event_size)
            else:  # Event is of valid size, return it
                return event
Retrieves an event. If self._exceeding_event is not None, it'll be
        returned. Otherwise, an event is dequeued from the event buffer. If
        The event which was retrieved is bigger than the permitted batch size,
        it'll be omitted, and the next event in the event buffer is returned