code: def _test_imageiter_last_batch(imageiter_list, assert_data_shape):
      test_iter = imageiter_list[0]
      # test batch data shape
      for _ in range(3):
          for batch in test_iter:
              assert batch.data[0].shape == assert_data_shape
          test_iter.reset()
      # test last batch handle(discard)
      test_iter = imageiter_list[1]
      i = 0
      for _ in test_iter:
          i += 1
      assert i == 5
      # test last_batch_handle(pad)
      test_iter = imageiter_list[2]
      i = 0
      for batch in test_iter:
          if i == 0:
              first_three_data = batch.data[0][:2]
          if i == 5:
              last_three_data = batch.data[0][1:]
          i += 1
      assert i == 6
      assert np.array_equal(
          first_three_data.asnumpy(), last_three_data.asnumpy()
      )
      # test last_batch_handle(roll_over)
      test_iter = imageiter_list[3]
      i = 0
      for batch in test_iter:
          if i == 0:
              first_image = batch.data[0][0]
          i += 1
      assert i == 5
      test_iter.reset()
      first_batch_roll_over = test_iter.next()
      assert np.array_equal(
          first_batch_roll_over.data[0][1].asnumpy(),
          first_image.asnumpy(),
      )
      assert first_batch_roll_over.pad == 2
      # test iteratopr work properly after calling reset several times when last_batch_handle is roll_over
      for _ in test_iter:
          pass
      test_iter.reset()
      first_batch_roll_over_twice = test_iter.next()
      assert np.array_equal(
          first_batch_roll_over_twice.data[0][2].asnumpy(),
          first_image.asnumpy(),
      )
      assert first_batch_roll_over_twice.pad == 1
      # we've called next once
      i = 1
      for _ in test_iter:
          i += 1
      # test the third epoch with size 6
      assert i == 6
      # test shuffle option for sanity test
      test_iter = imageiter_list[4]
      for _ in test_iter:
          pass
  
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 3 for calling a global function with example usage: _test_imageiter_last_batch(imageiter_list, assert_data_shape) without return types