code: def cleverhans_attack_wrapper(cleverhans_attack_fn, reset=True):
      def attack(a):
          session = tf.Session()
          with session.as_default():
              model = RVBCleverhansModel(a)
              adversarial_image = cleverhans_attack_fn(
                  model, session, a
              )
              adversarial_image = np.squeeze(adversarial_image, axis=0)
              if reset:
                  # optionally, reset to ignore other adversarials
                  # found during the search
                  a._reset()
              # run predictions to make sure the returned adversarial
              # is taken into account
              min_, max_ = a.bounds()
              adversarial_image = np.clip(adversarial_image, min_, max_)
              a.predictions(adversarial_image)
  
      return attack
  
file_path: cleverhans/cleverhans_v3.1.0/examples/robust_vision_benchmark/cleverhans_attack_example/utils.py
imports: import cleverhans.model
  import tensorflow
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: cleverhans_attack_wrapper(cleverhans_attack_fn, reset) and returns: attack