code: def test_q2gen_gen2q(self):
      data = (x for x in range(10))
      q = Queue()
  
      model_util._gen2q(data, q)
  
      expected_out = list(range(10))
      actual_out = []
      while True:
          try:
              actual_out.append(q.get(True, 1))
          except Empty:
              break
  
      self.assertEqual(expected_out, actual_out)
  
      model_util._gen2q((x for x in range(10)), q)
      gen = model_util._q2gen(q)
  
      self.assertEqual(expected_out, list(gen))
  
imports: import unittest
  import numpy
  import six
  from PIL import Image
  from io import BytesIO
  from timeout_decorator import timeout
  from studio import model_util
label_desc: Use image node_id 3 for calling the ModelUtilTest obj's underlying member method code with example usage: obj.test_q2gen_gen2q() without return types