code: def get_cifar10_iterator(
      batch_size, data_shape, resize=-1, num_parts=1, part_index=0
  ):
      get_cifar10()
  
      train = mx.io.ImageRecordIter(
          path_imgrec="data/cifar/train.rec",
          # mean_img    = "data/cifar/mean.bin",
          resize=resize,
          data_shape=data_shape,
          batch_size=batch_size,
          rand_crop=True,
          rand_mirror=True,
          num_parts=num_parts,
          part_index=part_index,
      )
  
      val = mx.io.ImageRecordIter(
          path_imgrec="data/cifar/test.rec",
          # mean_img    = "data/cifar/mean.bin",
          resize=resize,
          rand_crop=False,
          rand_mirror=False,
          data_shape=data_shape,
          batch_size=batch_size,
          num_parts=num_parts,
          part_index=part_index,
      )
  
      return train, val
  
imports: import os
  import random
  import tarfile
  import logging
  import tarfile
  import mxnet
  from mxnet.test_utils import get_cifar10
  from mxnet.gluon.data.vision import ImageFolderDataset
  from mxnet.gluon.data import DataLoader
  from mxnet.contrib.io import DataLoaderIter
label_desc: Use image node_id 1 for calling a global function with example usage: get_cifar10_iterator(batch_size, data_shape, resize, num_parts, part_index) and returns: train,  val