class_docstr: Random augment with fixed magnitude.
class_docstr_tok: ["Random","augment","with","fixed","magnitude","."]
docstr: Applies one level of augmentation to the image.
docstr_tok: ["Applies","one","level","of","augmentation","to","the","image","."]
code: def _pick_and_apply_augmentation(self, image):
      """Applies one level of augmentation to the image."""
      level = self._quantize()
      branch_fns = []
      for augment_op_name in IMAGENET_AUG_OPS:
          augment_fn = augment_ops.NAME_TO_FUNC[augment_op_name]
          level_to_args_fn = LEVEL_TO_ARG[augment_op_name]
  
          def _branch_fn(
              image=image,
              augment_fn=augment_fn,
              level_to_args_fn=level_to_args_fn,
          ):
              args = [image] + list(level_to_args_fn(level))
              return augment_fn(*args)
  
          branch_fns.append(_branch_fn)
  
      branch_index = tf.random.uniform(
          shape=[], maxval=len(branch_fns), dtype=tf.int32
      )
      aug_image = tf.switch_case(
          branch_index, branch_fns, default=lambda: image
      )
      if self.p is not None:
          return tf.cond(
              tf.random.uniform(shape=[], dtype=tf.float32) < self.p,
              lambda: aug_image,
              lambda: image,
          )
      else:
          return aug_image
  
file_path: objax/examples/fixmatch/libml/augment/randaugment/randaugment.py
imports: from typing import Optional
  import tensorflow
  from examples.fixmatch.libml.augment.randaugment import augment_ops
label_desc: Use image node_id 3 for calling the RandAugment obj's underlying member method code with example usage: obj._pick_and_apply_augmentation(image) and returns: tf, aug_image, augment_fn