<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def PopEventSource(self):
 """Pops an event source from the heap. Returns: EventSource: an event source or None on if no event source is available. """

    try:
      _, _, event_source = heapq.heappop(self._heap)

    except IndexError:
      return None

    return event_source