code: def swap_words(text):
      words = text.split()
      if len(words) <= 3:
          return " ".join(words)
      swapped = list(range(len(words)))
      idxs = sample(
          range(1, len(words) - 2),
          randint(1, min(3, len(words) // 2 - 1)),
      )
      for i in idxs:
          swapped[i], swapped[i + 1] = swapped[i + 1], swapped[i]
      return " ".join([words[i] for i in swapped])
  
file_path: artificial-adversary/Adversary/attacks.py
imports: from random import choice, randint, sample, randrange
  from string import punctuation
  from Adversary.constants import *
label_desc: Use image node_id 2 for calling a global function with example usage: swap_words(text) and returns: str, str