code: def transformation_consists_of(
      transformation, transformation_classes
  ):
      """Determines if ``transformation`` is or consists only of instances of a
      class in ``transformation_classes``"""
      from textattack.transformations import CompositeTransformation
  
      if isinstance(transformation, CompositeTransformation):
          for t in transformation.transformations:
              if not transformation_consists_of(
                  t, transformation_classes
              ):
                  return False
          return True
      else:
          for transformation_class in transformation_classes:
              if isinstance(transformation, transformation_class):
                  return True
          return False
  
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 3 for calling a global function with example usage: transformation_consists_of(transformation, transformation_classes) and returns: True, False, False, True