code: def build_field_transform_default_imagenet(
      config: Optional[List[Dict[str, Any]]],
      default_transform: Optional[Callable] = None,
      split: Optional[bool] = None,
      key: Union[int, str] = "input",
      key_map_transform: Optional[Callable] = DEFAULT_KEY_MAP,
  ) -> Callable:
      """Returns a ApplyTransformToKey which applies a transform on the specified key.
  
      The transform is built from the config, if it is not None.
  
      Otherwise, uses one of the two mutually exclusive args: If
      default_transform is not None, it is used.  If split is not None,
      imagenet transforms are used, using augmentation for "train", no
      augmentation otherwise.
  
      This function also provides an additional
      function for mapping from tuples (or other keys) to a desired set
      of keys
  
      Args:
          config: field transform config
          default_transform: used if config is None
          split: split for dataset, e.g. "train" or "test"
          key: Key to apply transform to
          key_map_transform: Used to produce desired map / keys
              (e.g. for torchvision datasets, default samples is a
              tuple so this argument can be used to map
              (input, target) -> {"input": input, "target": target})
  
      """
      assert (
          default_transform is None or split is None
      ), "Can only specify one of default_transform and split"
      if config is None:
          if default_transform is not None:
              transform = default_transform
          elif split is not None:
              transform = (
                  ImagenetAugmentTransform()
                  if split == "train"
                  else ImagenetNoAugmentTransform()
              )
          else:
              raise ValueError(
                  "No transform config provided with no defaults"
              )
      else:
          transform = build_transforms(config)
  
      transform = ApplyTransformToKey(transform, key=key)
      if key_map_transform is None:
          return transform
  
      return transforms.Compose([key_map_transform, transform])
  
imports: import collections
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torchvision.transforms
  from .None import build_transforms, ClassyTransform, register_transform
label_desc: Use image node_id 1 for calling a global function with example usage: build_field_transform_default_imagenet(config, default_transform, split, key, key_map_transform) and returns: transforms, transform