<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pop_all(self, event_name):
 """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. """

        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()