code: def test_imageiter(self):
      print(self.IMAGES)
      im_list = [[np.random.randint(0, 5), x] for x in self.IMAGES]
      fname = os.path.join(self.IMAGES_DIR, "test_imageiter.lst")
      file_list = [
          "\t".join([str(k), str(np.random.randint(0, 5)), x])
          for k, x in enumerate(self.IMAGES)
      ]
      with open(fname, "w") as f:
          for line in file_list:
              f.write(line + "\n")
  
      test_list = ["imglist", "path_imglist"]
      for dtype in ["int32", "float32", "int64", "float64"]:
          for test in test_list:
              imglist = im_list if test == "imglist" else None
              path_imglist = fname if test == "path_imglist" else None
              imageiter_list = [
                  mx.image.ImageIter(
                      2,
                      (3, 224, 224),
                      label_width=1,
                      imglist=imglist,
                      path_imglist=path_imglist,
                      path_root=self.IMAGES_DIR,
                      dtype=dtype,
                  ),
                  mx.image.ImageIter(
                      3,
                      (3, 224, 224),
                      label_width=1,
                      imglist=imglist,
                      path_imglist=path_imglist,
                      path_root=self.IMAGES_DIR,
                      dtype=dtype,
                      last_batch_handle="discard",
                  ),
                  mx.image.ImageIter(
                      3,
                      (3, 224, 224),
                      label_width=1,
                      imglist=imglist,
                      path_imglist=path_imglist,
                      path_root=self.IMAGES_DIR,
                      dtype=dtype,
                      last_batch_handle="pad",
                  ),
                  mx.image.ImageIter(
                      3,
                      (3, 224, 224),
                      label_width=1,
                      imglist=imglist,
                      path_imglist=path_imglist,
                      path_root=self.IMAGES_DIR,
                      dtype=dtype,
                      last_batch_handle="roll_over",
                  ),
                  mx.image.ImageIter(
                      3,
                      (3, 224, 224),
                      label_width=1,
                      imglist=imglist,
                      shuffle=True,
                      path_imglist=path_imglist,
                      path_root=self.IMAGES_DIR,
                      dtype=dtype,
                      last_batch_handle="pad",
                  ),
              ]
              _test_imageiter_last_batch(
                  imageiter_list, (2, 3, 224, 224)
              )
  
imports: import os
  import mxnet
  import numpy
  import scipy.ndimage
  from mxnet.test_utils import *
  from common import xfail_when_nonstandard_decimal_separator
  import shutil
  import tempfile
  import unittest
  import pytest
label_desc: Use image node_id 13 for calling the TestImage obj's underlying member method code with example usage: obj.test_imageiter() without return types