code: def pop_all(self, event_name):
          
          if not self.started:
              raise IllegalStateError(("Dispatcher needs to be started before "
                                       "popping."))
          results = []
          try:
              self.lock.acquire()
              while True:
                  e = self.event_dict[event_name].get(block=False)
                  results.append(e)
          except (queue.Empty, KeyError):
              return results
          finally:
              self.lock.release()
docs: Return and remove all stored events of a specified name.
  
          Pops all events from their queue. May miss the latest ones.
          If no event is available, return immediately.
  
          Args:
              event_name: Name of the events to be popped.
  
          Returns:
              List of the desired events.
  
          Raises:
              IllegalStateError: Raised if pop is called before the dispatcher
                  starts polling.