code: def test_rotate(modality, dev):
      # adapted implementation from DeepLearningExamples:
      # https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/
      # Classification/ConvNets/image_classification/autoaugment.py
      def rotate_with_fill(img, magnitude):
          rot = img.convert("RGBA").rotate(
              magnitude, resample=Image.BILINEAR
          )
          return Image.composite(
              rot, Image.new("RGBA", img.size, (128,) * 3), rot
          ).convert(img.mode)
  
      data_source = get_images if modality == "image" else get_videos()
      rotate = a.rotate.augmentation(
          mag_range=(-30, 30), randomly_negate=False
      )
      magnitudes = rotate._get_magnitudes(default_batch_size)
      compare_against_baseline(
          rotate,
          pil_baseline(rotate_with_fill),
          data_source,
          dev=dev,
          params=magnitudes,
          max_allowed_error=None,
          eps=1,
          modality=modality,
      )
  
imports: import itertools
  import os
  import numpy
  from PIL import Image, ImageEnhance, ImageOps
  from nose2.tools import params, cartesian_params
  import nvidia.dali.tensors
  from nvidia.dali import fn, pipeline_def
  from nvidia.dali.auto_aug import augmentations
  from nvidia.dali.auto_aug.core._utils import get_translations
  from test_utils import get_dali_extra_path, check_batch
label_desc: Use image node_id 13 for calling a global function with example usage: test_rotate(modality, dev) and returns: Image