code: def _project_perturbation(
      perturbation,
      norm,
      epsilon,
      input_image,
      clip_min=-np.inf,
      clip_max=np.inf,
  ):
      """
      Project `perturbation` onto L-infinity ball of radius `epsilon`. Also project into
      hypercube such that the resulting adversarial example is between clip_min and clip_max,
      if applicable. This is an in-place operation.
      """
  
      clipped_perturbation = clip_eta(perturbation, norm, epsilon)
      new_image = torch.clamp(
          input_image + clipped_perturbation, clip_min, clip_max
      )
  
      perturbation.add_((new_image - input_image) - perturbation)
  
file_path: cleverhans/cleverhans/torch/attacks/spsa.py
imports: import numpy
  import torch
  from torch import optim
  from cleverhans.torch.utils import clip_eta
label_desc: Use image node_id 2 for calling a global function with example usage: _project_perturbation(perturbation, norm, epsilon, input_image, clip_min, clip_max) without return types