code: def generate_grid_of_augmented_images(
      input_images: List[Image.Image],
      collate_function: Union[
          BaseCollateFunction, MultiViewCollateFunction
      ],
  ):
      """Returns a grid of augmented images. Images in a column belong together.
  
      This function ignores the transforms ToTensor and Normalize for visualization purposes.
  
      Args:
          input_images:
              List of PIL images for which the augmentations should be plotted.
          collate_function:
              The collate function of the self-supervised learning algorithm.
              Must be of type BaseCollateFunction or MultiViewCollateFunction.
  
      Returns:
          A grid of augmented images. Images in a column belong together.
  
      """
      grid = []
      if isinstance(collate_function, BaseCollateFunction):
          for _ in range(2):
              grid.append(
                  [
                      apply_transform_without_normalize(
                          image, collate_function.transform
                      )
                      for image in input_images
                  ]
              )
      elif isinstance(collate_function, MultiViewCollateFunction):
          for transform in collate_function.transforms:
              grid.append(
                  [
                      apply_transform_without_normalize(
                          image, transform
                      )
                      for image in input_images
                  ]
              )
      else:
          raise ValueError(
              "Collate function must be one of "
              "(BaseCollateFunction, MultiViewCollateFunction) "
              f"but is {type(collate_function)}."
          )
      return grid
  
file_path: lightly/lightly/utils/debug.py
imports: from typing import List, Union
  import torch
  import torchvision
  from PIL import Image
  from lightly.data.collate import BaseCollateFunction, MultiViewCollateFunction
label_desc: Use image node_id 4 for calling a global function with example usage: generate_grid_of_augmented_images(input_images, collate_function) and returns: grid