code: def build_video_field_transform_default(
      config: Optional[Dict[str, List[Dict[str, Any]]]],
      split: str = "train",
      key: Optional[str] = "input",
      key_map_transform: Optional[Callable] = DEFAULT_KEY_MAP,
  ) -> Callable:
      """Returns transform that first maps sample to video keys, then
      returns a transform on the specified key in dict.
  
      Converts tuple (list, etc) sample to dict with input / target keys.
      For a dict sample, verifies that dict has input / target keys.
      For all other samples throws.
  
      Args:
          config: If provided, it is a dict where key is the data modality, and
              value is a dict specifying the transform config
          split: the split of the data to which the transform will be applied
          key: the key in data sample of type dict whose corresponding value will
              undergo the transform
      """
      if config is None and split is None:
          raise ValueError(
              "No transform config provided with no defaults"
          )
  
      transforms_for_type = {
          "video": VideoDefaultAugmentTransform()
          if split == "train"
          else VideoDefaultNoAugmentTransform(),
          "audio": DummyAudioTransform(),
      }
  
      if config is not None:
          transforms_for_type.update(
              {
                  mode: build_transforms(modal_config)
                  for mode, modal_config in config.items()
              }
          )
  
      transform = transforms.Compose(
          [
              ApplyTransformToKey(default_transform, key=mode)
              for mode, default_transform in transforms_for_type.items()
          ]
      )
  
      if key is not None:
          transform = ApplyTransformToKey(
              transforms.Compose(
                  [TupleToMapTransform(["video", "audio"]), transform]
              ),
              key=key,
          )
  
      if key_map_transform is None:
          return transform
  
      return transforms.Compose([key_map_transform, transform])
  
imports: import random
  from typing import Any, Callable, Dict, List, Optional, Union
  import torch
  import torchvision.transforms
  import torchvision.transforms._transforms_video
  from .None import build_transforms, ClassyTransform, register_transform
  from .util import ApplyTransformToKey, ImagenetConstants, TupleToMapTransform
label_desc: Use image node_id 2 for calling a global function with example usage: build_video_field_transform_default(config, split, key, key_map_transform) and returns: transforms, transform