code: def trivial_augment_wide(
      data: _DataNode,
      num_magnitude_bins: int = 31,
      shape: Optional[Union[_DataNode, Tuple[int, int]]] = None,
      fill_value: Optional[int] = 128,
      interp_type: Optional[types.DALIInterpType] = None,
      max_translate_abs: Optional[int] = None,
      max_translate_rel: Optional[float] = None,
      seed: Optional[int] = None,
      excluded: Optional[List[str]] = None,
  ) -> _DataNode:
      """
      Applies TrivialAugment Wide (https://arxiv.org/abs/2103.10158) augmentation scheme to the
      provided batch of samples.
  
      Args
      ----
      data : DataNode
          A batch of samples to be processed. The supported samples are images
          of `HWC` layout and videos of `FHWC` layout, the supported data type is `uint8`.
      num_magnitude_bins: int, optional
          The number of bins to divide the magnitude ranges into.
      fill_value: int, optional
          A value to be used as a padding for images/frames transformed with warp_affine ops
          (translation, shear and rotate). If `None` is specified, the images/frames are padded
          with the border value repeated (clamped).
      interp_type: types.DALIInterpType, optional
          Interpolation method used by the warp_affine ops (translation, shear and rotate).
          Supported values are `types.INTERP_LINEAR` (default) and `types.INTERP_NN`.
      max_translate_abs: int or (int, int), optional
          Only valid when ``shapes`` is not provided. Specifies the maximal shift (in pixels)
          in the translation augmentation. If a tuple is specified, the first component limits
          height, the second the width. Defaults to 32, which means the maximal magnitude
          shifts the image by 32 pixels.
      max_translate_rel: float or (float, float), optional
          Only valid when ``shapes`` argument is provided. Specifies the maximal shift as a
          fraction of image shape in the translation augmentations.
          If a tuple is specified, the first component limits the height, the second the width.
          Defaults to 1, which means the maximal magnitude shifts the image entirely out of
          the canvas.
      seed: int, optional
          Seed to be used to randomly sample operations (and to negate magnitudes).
      excluded: List[str], optional
          A list of names of the operations to be excluded from the default suite of augmentations.
          If, instead of just limiting the set of operations, you need to include some custom
          operations or fine-tuned of the existing ones, you can use the
          :meth:`~nvidia.dali.auto_aug.trivial_augment.apply_trivial_augment` directly,
          which accepts a list of augmentations.
  
      Returns
      -------
      DataNode
          A batch of transformed samples.
      """
      aug_kwargs = {
          "fill_value": fill_value,
          "interp_type": interp_type,
      }
      use_shape = shape is not None
      if use_shape:
          aug_kwargs["shape"] = shape
      augmentations = get_trivial_augment_wide_suite(
          use_shape=use_shape,
          max_translate_abs=max_translate_abs,
          max_translate_rel=max_translate_rel,
      )
      augmentation_names = set(aug.name for aug in augmentations)
      assert len(augmentation_names) == len(augmentations)
      excluded = excluded or []
      for name in excluded:
          if name not in augmentation_names:
              raise Exception(
                  f"The `{name}` was specified in `excluded`, but the TrivialAugmentWide suite "
                  f"does not contain augmentation with this name. "
                  f"The augmentations in the suite are: {', '.join(augmentation_names)}."
              )
      selected_augments = [
          aug for aug in augmentations if aug.name not in excluded
      ]
      return apply_trivial_augment(
          selected_augments,
          data,
          num_magnitude_bins=num_magnitude_bins,
          seed=seed,
          **aug_kwargs,
      )
  
file_path: DALI/dali/python/nvidia/dali/auto_aug/trivial_augment.py
imports: from typing import List, Optional, Tuple, Union
  from nvidia.dali import fn
  from nvidia.dali import types
  from nvidia.dali.auto_aug import augmentations
  from nvidia.dali.auto_aug.core import _Augmentation, signed_bin
  from nvidia.dali.auto_aug.core._args import forbid_unused_kwargs
  from nvidia.dali.auto_aug.core._utils import get_translations, pretty_select
  from nvidia.dali.data_node import DataNode
label_desc: Use image node_id 1 for calling a global function with example usage: trivial_augment_wide(data, num_magnitude_bins, shape, fill_value, interp_type, max_translate_abs, max_translate_rel, seed, excluded) and returns: apply_trivial_augment