code: def test_noop_shuffling_buffer(buffer_type):
      """Noop should not do any shuffling. Add/retrieve some items while checking correcness of can_retrieve"""
      q = buffer_type()
  
      # Empty buffer. Can add, can not retrieve with zero size
      assert q.size == 0
      assert q.can_add()
      assert not q.can_retrieve()
  
      # Try adding some items. Check queue size and can_retrieve indicator
      _add_many(q, [1])
      assert q.can_add()
      assert q.size == 1
  
      _add_many(q, [2, 3])
      assert q.size == 3
  
      assert 1 == _retrieve(q)
      assert q.can_retrieve()
  
      assert 2 == _retrieve(q)
      assert 3 == _retrieve(q)
      assert not q.can_retrieve()
      assert q.size == 0
  
      q.finish()
      if isinstance(q, BatchedNoopShufflingBuffer):
          assert q._done_adding
  
file_path: petastorm/petastorm/tests/test_shuffling_buffer.py
imports: import numpy
  import pytest
  import six
  from petastorm.reader_impl.shuffling_buffer import NoopShufflingBuffer, RandomShufflingBuffer
  from petastorm.reader_impl.pytorch_shuffling_buffer import BatchedNoopShufflingBuffer, BatchedRandomShufflingBuffer
label_desc: Use image node_id 1 for calling a global function with example usage: test_noop_shuffling_buffer(buffer_type) without return types