code: def cat_list(images, fill_value=0):
      max_size = tuple(
          max(s) for s in zip(*[img.shape for img in images])
      )
      batch_shape = (len(images),) + max_size
      batched_imgs = images[0].new(*batch_shape).fill_(fill_value)
      for img, pad_img in zip(images, batched_imgs):
          pad_img[..., : img.shape[-2], : img.shape[-1]].copy_(img)
      return batched_imgs
  
file_path: deep-learning-for-image-processing/pytorch_segmentation/unet/my_dataset.py
imports: import os
  from PIL import Image
  import numpy
  from torch.utils.data import Dataset
label_desc: Use image node_id 1 for calling a global function with example usage: cat_list(images, fill_value) and returns: batched_imgs