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

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