code: def pop_all(self, priority=None):
          
          output = []
          with self.lock:
              if not priority:
                  priority = self.highest_entry()
              if priority:
                  output = list(self.queue[priority].queue)
                  self.queue[priority].queue.clear()
          return output
docs: NON-BLOCKING POP ALL IN QUEUE, IF ANY