code: def _get_epoch_batch_itr(ref, bsz, skip_remainder_batch):
      dsz = len(ref)
      indices = range(dsz)
      starts = indices[::bsz]
      batch_sampler = [indices[s : s + bsz] for s in starts]
      dataset = ListDataset(ref)
      itr = iterators.EpochBatchIterator(
          dataset=dataset,
          collate_fn=dataset.collater,
          batch_sampler=batch_sampler,
          skip_remainder_batch=skip_remainder_batch,
      )
      return itr.next_epoch_itr()
  
file_path: fairseq/tests/test_iterators.py
imports: import unittest
  from fairseq.data import iterators, ListDataset
label_desc: Use image node_id 1 for calling a global function with example usage: _get_epoch_batch_itr(ref, bsz, skip_remainder_batch) and returns: itr