code: def project(
      original_image, perturbed_images, alphas, shape, constraint
  ):
      """Projection onto given l2 / linf balls in a batch."""
      alphas_shape = [len(alphas)] + [1] * len(shape)
      alphas = alphas.reshape(alphas_shape)
      if constraint == "l2":
          projected = (
              1 - alphas
          ) * original_image + alphas * perturbed_images
      elif constraint == "linf":
          projected = clip_image(
              perturbed_images,
              original_image - alphas,
              original_image + alphas,
          )
      return projected
  
imports: import logging
  import numpy
  import tensorflow
  from warnings import warn
  from cleverhans.attacks import Attack
  from cleverhans.model import CallableModelWrapper, Model, wrapper_warning_logits
  from cleverhans import utils, utils_tf
label_desc: Use image node_id 6 for calling a global function with example usage: project(original_image, perturbed_images, alphas, shape, constraint) and returns: projected