code: def PopEvent(self):
      
      try:
        timestamp, serialized_event = heapq.heappop(self._heap)
  
        self.data_size -= len(serialized_event)
        return timestamp, serialized_event
  
      except IndexError:
        return None, None
docs: Pops an event from the heap.
  
      Returns:
        tuple: containing:
  
          int: event timestamp or None if the heap is empty
          bytes: serialized event or None if the heap is empty