def METHOD_NAME(task_queue, res_queue, num_samples):
    msgs = task_queue.get(num_samples=num_samples)
    if msgs is None:
        return
    assert len(msgs) > 0
    res_queue.put(msgs)
    return msgs