code: def PopEventSource(self):
      
      try:
        _, _, event_source = heapq.heappop(self._heap)
  
      except IndexError:
        return None
  
      return event_source
docs: Pops an event source from the heap.
  
      Returns:
        EventSource: an event source or None on if no event source is available.