def get_all_from_queue(Q):
try:<EOL><INDENT>while True:<EOL><INDENT>yield Q.get_nowait()<EOL><DEDENT><DEDENT>except queue.Empty:<EOL><INDENT>raise StopIteration<EOL><DEDENT>
Generator to yield one after the others all items currently
        in the queue Q, without any waiting.