code: def pop_all_queues(self):
          
          output = []
          with self.lock:
              for q in self.queue:
                  output.extend(list(q.queue))
                  q.queue.clear()
  
          return output
docs: NON-BLOCKING POP ALL IN QUEUE, IF ANY