code: def PopEvent(self):
      
      try:
        _, _, _, event = heapq.heappop(self._heap)
        return event
  
      except IndexError:
        return None
docs: Pops an event from the heap.
  
      Returns:
        EventObject: event.