code: def test_function(self):
      reader = get_2d_reader()
      #### with default batch padding
      n_iters, windows = self.run_dataset(
          n_iters=2,
          n_threads=4,
          reader=reader,
          batch_size=100,
          smaller_final_batch_mode="pad",
          epoch=4,
      )
      # elements: 4 * 40, batch size 100, resulting 2 batches
      self.assertEqual(n_iters, 2)
      self.assertEqual(windows.shape[0], 200)
      # all subjects evaluated
      uniq, counts = np.unique(windows[:, 0], return_counts=True)
      self.assertEqual(len(uniq), 41)
      self.assertTrue(np.all(counts[1:] == 4))
  
      #### with drop batch
      n_iters, windows = self.run_dataset(
          n_iters=2,
          n_threads=3,
          reader=reader,
          batch_size=100,
          smaller_final_batch_mode="drop",
          epoch=3,
      )
      # elements: 4 * 40, batch size 100, resulting 1 batches
      self.assertEqual(n_iters, 1)
      self.assertEqual(windows.shape[0], 100)
      # all subjects evaluated, might not get all unique items
      # self.assertEqual(len(np.unique(windows[:, 0])), 40)
  
      #### with drop batch
      n_iters, windows = self.run_dataset(
          n_iters=2,
          n_threads=4,
          reader=reader,
          batch_size=100,
          queue_length=100,
          smaller_final_batch_mode="dynamic",
          epoch=4,
      )
      # elements: 4 * 40, batch size 100, resulting 2 batches
      self.assertEqual(n_iters, 2)
      self.assertEqual(windows.shape[0], 160)
      # all subjects evaluated
      uniq, counts = np.unique(windows[:, 0], return_counts=True)
      self.assertEqual(len(uniq), 40)
      self.assertTrue(np.all(counts == 4))
  
imports: from __future__ import absolute_import, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.engine.image_window_dataset import ImageWindowDataset
  from niftynet.io.image_reader import ImageReader
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 2 for calling the ImageDatasetParamTest obj's underlying member method code with example usage: obj.test_function() without return types