code: def check_data_iterator_result(
      di, batch_size, shuffle, normalize, stop_exhausted, epoch=None
  ):
      datalist = []
      count = 0
      n = 0
      remain = 0
  
      for data in di:
          n += 1
          if n * batch_size >= di.size * (epoch[0] + 1):
              remain += n * batch_size - di.size * (epoch[0] + 1)
              epoch[0] += 1
          for i in range(batch_size):
              count += 1
              if normalize:
                  v1 = round(data[0][i].flatten()[0] * 256)
              else:
                  v1 = round(data[0][i].flatten()[0])
              v2 = round(data[1][i][0])
              assert v1 == v2
              datalist.append(v1)
          if not stop_exhausted and di.epoch > 2:
              print("epoch=", di.epoch)
              break
  
      if not stop_exhausted:
          s1 = set(datalist)
          s2 = set(range(di._data_source.size))
          assert len(s1 - s2) == 0
          assert len(s2 - s1) == di._data_source.size - di.size
      else:
          assert (
              count == di._data_source.size // batch_size * batch_size
          )
  
imports: from __future__ import absolute_import
  import os
  import pytest
  import threading
  import numpy
  from nnabla.logger import logger
  from nnabla.config import nnabla_config
  from nnabla.utils.data_source_loader import load_image
  from nnabla.utils.data_iterator import data_iterator_csv_dataset
  from nnabla.utils.data_iterator import data_iterator_simple
  from nnabla.utils.data_iterator import data_iterator_concat_datasets
  from nnabla.utils.data_source_implements import CsvDataSource
  from .conftest import test_data_csv_png_10, test_data_csv_png_20
label_desc: Use image node_id 2 for calling a global function with example usage: check_data_iterator_result(di, batch_size, shuffle, normalize, stop_exhausted, epoch) without return types