class_docstr: Given a batch of input images and labels, this class randomly applies the
  `CutMix transformation <https://arxiv.org/abs/1905.04899>`_
  
  Args:
      opts (argparse.Namespace): Arguments
      num_classes (int): Number of classes in the dataset
docstr: Input data format:
      data: mapping of: {
          "samples": {"sample_key": Tensor of shape: [Batch, Channels, Height, Width]},
          "targets": {"target_key": IntTensor of shape: [Batch]}
      }
  
      OR
      data: mapping of: {
          "samples": {"sample_key": Tensor of shape: [Batch, Channels, Height, Width]},
          "targets": IntTensor of shape: [Batch]
      }
  
      OR
      data: mapping of: {
          "samples": Tensor of shape: [Batch, Channels, Height, Width],
          "targets": {"target_key": IntTensor of shape: [Batch]}
      }
      OR
      data: mapping of: {
          "samples": Tensor of shape: [Batch, Channels, Height, Width],
          "targets": IntTensor of shape: [Batch]
      }
  Output data format: Same as the input
docstr_tok: ["Input","data","format",":","data",":","mapping","of",":","{","``","samples","''",":","{","``","sample_key","''",":","Tensor","of","shape",":","[","Batch",",","Channels",",","Height",",","Width","]","}",",","``","targets","''",":","{","``","target_key","''",":","IntTensor","of","shape",":","[","Batch","]","}","}","OR","data",":","mapping","of",":","{","``","samples","''",":","{","``","sample_key","''",":","Tensor","of","shape",":","[","Batch",",","Channels",",","Height",",","Width","]","}",",","``","targets","''",":","IntTensor","of","shape",":","[","Batch","]","}","OR","data",":","mapping","of",":","{","``","samples","''",":","Tensor","of","shape",":","[","Batch",",","Channels",",","Height",",","Width","]",",","``","targets","''",":","{","``","target_key","''",":","IntTensor","of","shape",":","[","Batch","]","}","}","OR","data",":","mapping","of",":","{","``","samples","''",":","Tensor","of","shape",":","[","Batch",",","Channels",",","Height",",","Width","]",",","``","targets","''",":","IntTensor","of","shape",":","[","Batch","]","}","Output","data","format",":","Same","as","the","input"]
code: def __call__(self, data: Dict) -> Dict:
      """
      Input data format:
          data: mapping of: {
              "samples": {"sample_key": Tensor of shape: [Batch, Channels, Height, Width]},
              "targets": {"target_key": IntTensor of shape: [Batch]}
          }
  
          OR
          data: mapping of: {
              "samples": {"sample_key": Tensor of shape: [Batch, Channels, Height, Width]},
              "targets": IntTensor of shape: [Batch]
          }
  
          OR
          data: mapping of: {
              "samples": Tensor of shape: [Batch, Channels, Height, Width],
              "targets": {"target_key": IntTensor of shape: [Batch]}
          }
          OR
          data: mapping of: {
              "samples": Tensor of shape: [Batch, Channels, Height, Width],
              "targets": IntTensor of shape: [Batch]
          }
      Output data format: Same as the input
      """
  
      if torch.rand(1).item() >= self.p:
          return data
  
      samples, targets = data.pop("samples"), data.pop("targets")
  
      if self.sample_key is not None:
          samples = samples[self.sample_key]
          if not isinstance(samples, Tensor):
              logger.error(
                  f"Samples need to be of type Tensor. Got: {type(samples)}. "
                  f"Maybe you want to check the value of --image-augmentation.cutmix.sample-key"
              )
  
      if self.target_key is not None:
          targets = targets[self.target_key]
          if not isinstance(targets, Tensor):
              logger.error(
                  f"Targets need to be of type Tensor. Got: {type(targets)}. "
                  f"Maybe you want to check the value of --image-augmentation.cutmix.target-key"
              )
  
      samples, targets = self._apply_cutmix_transform(
          image_tensor=samples, target_tensor=targets
      )
  
      if self.sample_key is not None:
          if isinstance(samples, Tensor):
              samples = {self.sample_key: samples}
          else:
              samples[self.sample_key] = samples
      if self.target_key is not None:
          if isinstance(targets, Tensor):
              targets = {self.target_key: targets}
          else:
              targets[self.target_key] = targets
  
      data.update({"samples": samples, "targets": targets})
      return data
  
imports: import argparse
  import math
  import random
  from typing import Dict, Tuple
  import torch
  from torch import Tensor
  from torch.nn import functional
  from torchvision.transforms import functional
  from data.transforms import TRANSFORMATIONS_REGISTRY, BaseTransformation
  from utils import logger
label_desc: Use image node_id 4 for calling the RandomCutmix obj's underlying member method code with example usage: obj.__call__(data) and returns: data, data