code: def check_events(self):
          
          if self.event_dispatcher.flush() is QUIT:
              self._quit = True
              return True
          return False
docs: Call the event dispatcher.
  
          Quit the main loop when the `QUIT` event is reached.
  
          :Return: `True` if `QUIT` was reached.