<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def PopEvents(self):
 """Pops events from the heap. Yields: EventObject: event. """

    event = self.PopEvent()
    while event:
      yield event
      event = self.PopEvent()