code: def test_pad_last_batch():
      num_gpus = 1
      batch_size = 100
  
      pipes, iters = create_pipeline(
          lambda gpu: COCOReaderPipeline(
              batch_size=batch_size,
              num_threads=4,
              shard_id=gpu,
              num_gpus=num_gpus,
              data_paths=datasets[0],
              random_shuffle=True,
              stick_to_shard=False,
              shuffle_after_epoch=False,
              pad_last_batch=True,
          ),
          batch_size,
          num_gpus,
      )
  
      img_ids_list, _, epochs_run = gather_ids(
          pipes, batch_size=batch_size
      )
  
      img_ids_list = np.concatenate(img_ids_list)
      img_ids_list_set = set(img_ids_list)
  
      # check number of repeated samples
      remainder = (
          int(math.ceil(iters * 1.0 / batch_size)) * batch_size - iters
      )
      # check if repeated samples are equal to the last one
      mirrored_data = img_ids_list[-remainder - 1 :]
      print(iters, remainder, set(mirrored_data), img_ids_list)
      assert len(set(mirrored_data)) == 1
      assert len(img_ids_list) != len(img_ids_list_set)
  
      next_img_ids_list, _, _ = gather_ids(
          pipes, epochs_run, batch_size=batch_size
      )
  
      next_img_ids_list = np.concatenate(next_img_ids_list)
      next_img_ids_list_set = set(next_img_ids_list)
  
      mirrored_data = next_img_ids_list[-remainder - 1 :]
      print(set(mirrored_data))
      assert len(set(mirrored_data)) == 1
      assert len(next_img_ids_list) != len(next_img_ids_list_set)
  
imports: import nose_utils
  import math
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import numpy
  import os
  from test_utils import get_dali_extra_path
label_desc: Use image node_id 10 for calling a global function with example usage: test_pad_last_batch() without return types