code: def _check_iterator(self, iterator, expected_items, fixed_order=True):
      actual_items = [item for _, item in iterator]
      if not fixed_order:
          # Order is random, just check that the sorted arrays are equal
          actual_items = sorted(actual_items)
          expected_items = sorted(expected_items)
      self.assertListEqual(actual_items, expected_items)
  
file_path: pytext/pytext/data/test/batch_sampler_test.py
imports: import unittest
  from pytext.data import AlternatingRandomizedBatchSampler, EvalBatchSampler, RandomizedBatchSampler, RoundRobinBatchSampler
label_desc: Use image node_id 6 for calling the BatchSamplerTest obj's underlying member method code with example usage: obj._check_iterator(iterator, expected_items, fixed_order) without return types