code: def process_in_out_queues(func, q_in, q_out):
      
      while True:
          # pick item out of input wqueue
          idx, arg = q_in.get()
          if idx is None:  # sentinel
              break
          # execute method and put the result in the output queue
          q_out.put((idx, func(arg)))
docs: Iterate through a Queue, call, ``func`, and Queue the result
  
      Parameters
      ----------
      func : `callable`
          any function that can take an element of the input `Queue` as
          the only argument
  
      q_in : `multiprocessing.queue.Queue`
          the input `Queue`
  
      q_out : `multiprocessing.queue.Queue`
          the output `Queue`
  
      Notes
      -----
      To close the input `Queue`, add ``(None, None)` as the last item