code: def transformation_consists_of_word_swaps(transformation):
      """Determines if ``transformation`` is a word swap or consists of only word
      swaps."""
      from textattack.transformations import (
          WordSwap,
          WordSwapGradientBased,
      )
  
      return transformation_consists_of(
          transformation, [WordSwap, WordSwapGradientBased]
      )
  
file_path: TextAttack/textattack/shared/validators.py
imports: import re
  import textattack
  from textattack.goal_functions import InputReduction, MinimizeBleu, NonOverlappingOutput, TargetedClassification, UntargetedClassification
  from .None import logger
label_desc: Use image node_id 4 for calling a global function with example usage: transformation_consists_of_word_swaps(transformation) and returns: transformation_consists_of