class_docstr: Implementation for TrivialAugment (https://arxiv.org/abs/2103.10158)
  Random sample one operation from all_transform
  Random a strength between [0, max_strength]
class_docstr_tok: ["Implementation","for","TrivialAugment","(","https",":","\/\/arxiv.org\/abs\/2103.10158",")","Random","sample","one","operation","from","all_transform","Random","a","strength","between","[","0",",","max_strength","]"]
code: def augment_text(self, data):
      op = random.choice(self.all_transform)
  
      # use specified operation magnitude if available
      if isinstance(op, tuple):
          op, scale = op
      else:
          scale = random.uniform(0, self.max_strength)
  
      if op == "identity":
          return data
  
      # lazy import of nlpaug due to the speed issue. See more in https://github.com/autogluon/autogluon/issues/2706
      import nlpaug.augmenter.word as naw
  
      from ..utils.nlpaug import InsertPunctuation
  
      if op == "syn_replacement":
          op = naw.SynonymAug(
              aug_src="wordnet", aug_p=scale, aug_max=None
          )
      elif op == "random_swap":
          op = naw.RandomWordAug(
              action="swap", aug_p=scale, aug_max=None
          )
      elif op == "random_delete":
          op = naw.RandomWordAug(
              action="delete", aug_p=scale, aug_max=None
          )
      elif op == "insert_punc":
          op = (
              InsertPunctuation()
          )  # scale will be randomized inside function
      else:
          raise NotImplementedError
      return op.augment(data)
  
imports: import logging
  import random
  import nltk
  from PIL import Image, ImageEnhance, ImageOps
  from ..constants import AUTOMM, IMAGE, TEXT
label_desc: Use image node_id 4 for calling the TrivialAugment obj's underlying member method code with example usage: obj.augment_text(data) and returns: op, data