nodes: 0, module; 1, function_definition; 2, function_name:PopEvents; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, while_statement; 9, comment:"""Pops events from the heap.
  
      Yields:
        EventObject: event.
      """; 10, assignment; 11, identifier:event; 12, block; 13, identifier:event; 14, call; 15, expression_statement; 16, expression_statement; 17, attribute; 18, argument_list; 19, yield; 20, assignment; 21, identifier:self; 22, identifier:PopEvent; 23, identifier:event; 24, identifier:event; 25, call; 26, attribute; 27, argument_list; 28, identifier:self; 29, identifier:PopEvent
code: def PopEvents(self):
      """Pops events from the heap.
  
      Yields:
        EventObject: event.
      """
      event = self.PopEvent()
      while event:
        yield event
        event = self.PopEvent()