code: def rand_augment(im, magnitude, ops=None, n_ops=2, prob=1.0):
      """Applies random augmentation to an image."""
      ops = ops if ops else RANDAUG_OPS
      for op in np.random.choice(ops, int(n_ops)):
          im = apply_op(im, op, prob, magnitude)
      return im
  
file_path: pycls/pycls/datasets/augment.py
imports: import random
  import numpy
  from PIL import Image, ImageEnhance, ImageOps
label_desc: Use image node_id 3 for calling a global function with example usage: rand_augment(im, magnitude, ops, n_ops, prob) and returns: im