code: def test_drain_queue():
      q = queue.Queue(10)
      elems = list(range(10))
      for i in elems:
          q.put(i)
      items = utils.drain_queue(q)
      assert items == elems
      with pytest.raises(queue.Empty):
          q.get_nowait()
  
imports: import queue
  import pytest
  from ..None import utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_drain_queue() without return types