code: def get_aug_transform(cfg):
      aug_modes = cfg.aug_modes
      input_size = cfg.input_size
      task = cfg.task
      transform_list = []
      is_test = False
      if "test-aug" in aug_modes:
          # transform_list.append(
          #    A.RandomBrightnessContrast(brightness_limit=0.125, contrast_limit=0.05, p=0.2)
          #    )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.02,
                  scale_limit=0.05,
                  rotate_limit=5,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=1.0,
                  always_apply=True,
              )
          )
          is_test = True
  
      if "1" in aug_modes:
          transform_list.append(
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.2
              )
          )
      if "1A" in aug_modes:
          transform_list.append(
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.2
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.02,
                  scale_limit=0.03,
                  rotate_limit=6,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.3,
              )
          )
      if "2" in aug_modes:
          transform_list.append(
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.2
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.05,
                  scale_limit=0.1,
                  rotate_limit=15,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.4,
              )
          )
      if "3" in aug_modes:
          transform_list.append(
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.6
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.1,
                  scale_limit=0.2,
                  rotate_limit=30,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.6,
              )
          )
      if "nist1" in aug_modes:
          transform_list.append(
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.2
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.05,
                  scale_limit=0.06,
                  rotate_limit=6,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.4,
              )
          )
      if "nist2" in aug_modes:
          transform_list.append(
              # A.ColorJitter(brightness=0.2, contrast=0.2, saturation=0.2, hue=0.02, p=0.3)
              A.RandomBrightnessContrast(
                  brightness_limit=0.125, contrast_limit=0.05, p=0.2
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.06,
                  scale_limit=0.06,
                  rotate_limit=6,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.4,
              )
          )
          transform_list.append(
              A.OneOf(
                  [
                      RectangleBorderAugmentation(p=0.5),
                      ForeHeadAugmentation(p=0.5),
                      # SunGlassAugmentation(p=0.2),
                  ],
                  p=0.06,
              )
          )
          transform_list.append(A.ToGray(p=0.05))
          transform_list.append(
              A.geometric.resize.RandomScale(
                  scale_limit=(0.7, 0.9),
                  interpolation=cv2.INTER_LINEAR,
                  p=0.05,
              )
          )
          transform_list.append(A.ISONoise(p=0.06))
          transform_list.append(A.MedianBlur(blur_limit=(1, 7), p=0.05))
          transform_list.append(
              A.MotionBlur(blur_limit=(5, 12), p=0.05)
          )
          transform_list.append(
              A.ImageCompression(
                  quality_lower=50, quality_upper=80, p=0.05
              )
          )
      if "prod" in aug_modes:
          transform_list.append(
              # A.RandomBrightnessContrast(brightness_limit=0.125, contrast_limit=0.125, p=0.2)
              A.ColorJitter(
                  brightness=0.2,
                  contrast=0.2,
                  saturation=0.2,
                  hue=0.02,
                  p=0.3,
              )
          )
          transform_list.append(
              A.ShiftScaleRotate(
                  shift_limit=0.06,
                  scale_limit=0.1,
                  rotate_limit=10,
                  interpolation=cv2.INTER_LINEAR,
                  border_mode=cv2.BORDER_CONSTANT,
                  value=0,
                  mask_value=0,
                  p=0.4,
              )
          )
          transform_list.append(
              A.OneOf(
                  [
                      RectangleBorderAugmentation(p=0.5),
                      ForeHeadAugmentation(p=0.5),
                      MaskAugmentation(
                          mask_names=[
                              "mask_white",
                              "mask_blue",
                              "mask_black",
                              "mask_green",
                          ],
                          mask_probs=[0.4, 0.4, 0.1, 0.1],
                          h_low=0.33,
                          h_high=0.4,
                          p=0.2,
                      ),
                      SunGlassAugmentation(p=0.2),
                  ],
                  p=0.2,
              )
          )
          transform_list.append(A.ToGray(p=0.05))
          transform_list.append(
              A.geometric.resize.RandomScale(
                  scale_limit=(0.6, 0.9),
                  interpolation=cv2.INTER_LINEAR,
                  p=0.2,
              )
          )
          transform_list.append(A.ISONoise(p=0.1))
          transform_list.append(A.MedianBlur(blur_limit=(1, 7), p=0.1))
          transform_list.append(A.MotionBlur(blur_limit=(5, 12), p=0.1))
          transform_list.append(
              A.ImageCompression(
                  quality_lower=30, quality_upper=80, p=0.1
              )
          )
      # if input_size!=112: # TODO!!
      #    transform_list.append(
      #        A.geometric.resize.Resize(input_size, input_size, interpolation=cv2.INTER_LINEAR, always_apply=True)
      #        )
      transform_list += [
          # A.HorizontalFlip(p=0.5),
          A.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]),
          ToTensorV2(),
      ]
      # here, the input for A transform is rgb cv2 img
      if is_test:
          transform = A.ReplayCompose(
              transform_list,
              keypoint_params=A.KeypointParams(
                  format="xy", remove_invisible=False
              ),
          )
      else:
          transform = A.Compose(
              transform_list,
              keypoint_params=A.KeypointParams(
                  format="xy", remove_invisible=False
              ),
          )
      return transform
  
imports: import numpy
  import cv2
  import os
  import os.path
  import albumentations
  from albumentations.core.transforms_interface import ImageOnlyTransform
  from albumentations.pytorch import ToTensorV2
label_desc: Use image node_id 1 for calling a global function with example usage: get_aug_transform(cfg) and returns: transform