class_docstr: This LightningDataModule implementation constructs a PyTorchVideo Kinetics dataset for both
  the train and val partitions. It defines each partition's augmentation and
  preprocessing transforms and configures the PyTorch DataLoaders.
docstr: ##################
  # PTV Transforms #
  ##################
  
  # Each PyTorchVideo dataset has a "transform" arg. This arg takes a
  # Callable[[Dict], Any], and is used on the output Dict of the dataset to
  # define any application specific processing or augmentation. Transforms can
  # either be implemented by the user application or reused from any library
  # that's domain specific to the modality. E.g. for video we recommend using
  # TorchVision, for audio we recommend TorchAudio.
  #
  # To improve interoperation between domain transform libraries, PyTorchVideo
  # provides a dictionary transform API that provides:
  #   - ApplyTransformToKey(key, transform) - applies a transform to specific modality
  #   - RemoveKey(key) - remove a specific modality from the clip
  #
  # In the case that the recommended libraries don't provide transforms that
  # are common enough for PyTorchVideo use cases, PyTorchVideo will provide them in
  # the same structure as the recommended library. E.g. TorchVision didn't
  # have a RandomShortSideScale video transform so it's been added to PyTorchVideo.
code: def _make_transforms(self, mode: str):
      """
      ##################
      # PTV Transforms #
      ##################
  
      # Each PyTorchVideo dataset has a "transform" arg. This arg takes a
      # Callable[[Dict], Any], and is used on the output Dict of the dataset to
      # define any application specific processing or augmentation. Transforms can
      # either be implemented by the user application or reused from any library
      # that's domain specific to the modality. E.g. for video we recommend using
      # TorchVision, for audio we recommend TorchAudio.
      #
      # To improve interoperation between domain transform libraries, PyTorchVideo
      # provides a dictionary transform API that provides:
      #   - ApplyTransformToKey(key, transform) - applies a transform to specific modality
      #   - RemoveKey(key) - remove a specific modality from the clip
      #
      # In the case that the recommended libraries don't provide transforms that
      # are common enough for PyTorchVideo use cases, PyTorchVideo will provide them in
      # the same structure as the recommended library. E.g. TorchVision didn't
      # have a RandomShortSideScale video transform so it's been added to PyTorchVideo.
      """
      if self.args.data_type == "video":
          transform = [
              self._video_transform(mode),
              RemoveKey("audio"),
          ]
      elif self.args.data_type == "audio":
          transform = [
              self._audio_transform(),
              RemoveKey("video"),
          ]
      else:
          raise Exception(f"{self.args.data_type} not supported")
  
      return Compose(transform)
  
imports: import argparse
  import itertools
  import logging
  import os
  import pytorch_lightning
  import pytorchvideo.data
  import pytorchvideo.models.resnet
  import torch
  import torch.nn.functional
  from pytorch_lightning.callbacks import LearningRateMonitor
  from pytorchvideo.transforms import ApplyTransformToKey, Normalize, RandomShortSideScale, RemoveKey, ShortSideScale, UniformTemporalSubsample
  from slurm import copy_and_run_with_config
  from torch.utils.data import DistributedSampler, RandomSampler
  from torchaudio.transforms import MelSpectrogram, Resample
  from torchvision.transforms import CenterCrop, Compose, Lambda, RandomCrop, RandomHorizontalFlip
label_desc: Use image node_id 2 for calling the KineticsDataModule obj's underlying member method code with example usage: obj._make_transforms(mode) and returns: Compose