code: def test_contrib_DataLoaderIter():
      def test_mnist_batches(
          batch_size, expected, last_batch="discard"
      ):
          dataset = MNIST(train=False)
          dataloader = DataLoader(
              dataset, batch_size, last_batch=last_batch
          )
          test_iter = DataLoaderIter(dataloader)
          batch = next(test_iter)
          assert batch.data[0].shape == (batch_size, 28, 28, 1)
          assert batch.label[0].shape == (batch_size,)
          count = 0
          test_iter.reset()
          for _ in test_iter:
              count += 1
          assert (
              count == expected
          ), "expected {} batches, given {}".format(expected, count)
  
      num_examples = 10000
      test_mnist_batches(50, num_examples // 50, "discard")
      test_mnist_batches(31, num_examples // 31, "discard")
      test_mnist_batches(31, num_examples // 31, "rollover")
      test_mnist_batches(31, num_examples // 31 + 1, "keep")
  
imports: import mxnet.ndarray
  from mxnet.gluon.data.vision.datasets import *
  from mxnet.gluon.data.dataloader import *
  from mxnet.contrib.io import *
  from mxnet.test_utils import *
label_desc: Use image node_id 1 for calling a global function with example usage: test_contrib_DataLoaderIter() without return types