code: def check_events(self):
          '''check for events, calling registered callbacks as needed'''
          while self.event_count() > 0:
              event = self.get_event()
              for callback in self._callbacks:
                  callback(eventf check_events(self):
          '''check for events, calling registered callbacks as needed'''
          while self.event_count() > 0:
              event = self.get_event()
              for callback in self._callbacks:
                  callback(event)
docs: check for events, calling registered callbacks as needed