code: def _q2gen(queue, timeout=1):
      while True:
          try:
              yield queue.get(True, timeout=timeout)
          except Empty:
              raise StopIteration
  
imports: import types
  from studio.util import logs
  from PIL import Image
  from threading import Thread
  import numpy
  import itertools
  import six
label_desc: Use image node_id 5 for calling a global function with example usage: _q2gen(queue, timeout) without return types