code: def apply_trivial_augment(
      augmentations: List[_Augmentation],
      data: _DataNode,
      num_magnitude_bins: int = 31,
      seed: Optional[int] = None,
      **kwargs,
  ) -> _DataNode:
      """
      Applies the list of `augmentations` in TrivialAugment
      (https://arxiv.org/abs/2103.10158) fashion.
      Each sample is processed with randomly selected transformation form `augmentations` list.
      The magnitude bin for every transformation is randomly selected from
      `[0, num_magnitude_bins - 1]`.
  
      Args
      ----
      augmentations : List[core._Augmentation]
          List of augmentations to be sampled and applied in TrivialAugment fashion.
      data : DataNode
          A batch of samples to be processed.
      num_magnitude_bins: int, optional
          The number of bins to divide the magnitude ranges into.
      seed: int, optional
          Seed to be used to randomly sample operations (and to negate magnitudes).
      kwargs:
          Any extra parameters to be passed when calling `augmentations`.
          The signature of each augmentation is checked for any extra arguments and if
          the name of the argument matches one from the `kwargs`, the value is
          passed as an argument. For example, some augmentations from the default
          TrivialAugment suite accept ``shapes``, ``fill_value`` and ``interp_type``.
  
      Returns
      -------
      DataNode
          A batch of transformed samples.
      """
      if (
          not isinstance(num_magnitude_bins, int)
          or num_magnitude_bins < 1
      ):
          raise Exception(
              f"The `num_magnitude_bins` must be a positive integer, got {num_magnitude_bins}."
          )
      if len(augmentations) == 0:
          raise Exception(
              "The `augmentations` list cannot be empty. "
              "Got empty list in `apply_trivial_augment` call."
          )
      magnitude_bin = fn.random.uniform(
          values=list(range(num_magnitude_bins)),
          dtype=types.INT32,
          seed=seed,
      )
      use_signed_magnitudes = any(
          aug.randomly_negate for aug in augmentations
      )
      if use_signed_magnitudes:
          magnitude_bin = signed_bin(magnitude_bin, seed=seed)
      _forbid_unused_kwargs(
          augmentations, kwargs, "apply_trivial_augment"
      )
      op_kwargs = dict(
          data=data,
          magnitude_bin=magnitude_bin,
          num_magnitude_bins=num_magnitude_bins,
          **kwargs,
      )
      op_idx = fn.random.uniform(
          values=list(range(len(augmentations))),
          seed=seed,
          dtype=types.INT32,
      )
      return _pretty_select(
          augmentations,
          op_idx,
          op_kwargs,
          auto_aug_name="apply_trivial_augment",
          ref_suite_name="get_trivial_augment_wide_suite",
      )
  
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 2 for calling a global function with example usage: apply_trivial_augment(augmentations, data, num_magnitude_bins, seed) and returns: _pretty_select