code: def _make_projector(eps, order, x, clip_min, clip_max):
      if order == inf:
  
          def proj(delta):
              delta = batch_clamp(eps, delta)
              delta = (
                  sample_clamp(
                      x[:, None, :] + delta,
                      clip_min[:, None, :],
                      clip_max[:, None, :],
                  )
                  - x[:, None, :]
              )
              return delta
  
      else:
  
          def proj(delta):
              # find the samples that exceed the bounds
              # and project them back inside
              norm = torch.norm(delta, p=order, dim=-1)
              mask = (norm > eps[:, None]).float()  # out of bounds
              factor = torch.min(
                  eps[:, None] / norm, torch.ones_like(norm)
              )
              delta_norm = delta * factor[:, :, None]
              delta = (
                  mask[:, :, None] * delta_norm
                  + (1 - mask)[:, :, None] * delta
              )
  
              delta = (
                  sample_clamp(
                      x[:, None, :] + delta,
                      clip_min[:, None, :],
                      clip_max[:, None, :],
                  )
                  - x[:, None, :]
              )
              return delta
  
      return proj
  
file_path: advertorch/advertorch/attacks/blackbox/utils.py
imports: from math import inf
  from operator import mul
  from functools import reduce
  import numpy
  import torch
  from advertorch.utils import batch_clamp
label_desc: Use image node_id 5 for calling a global function with example usage: _make_projector(eps, order, x, clip_min, clip_max) and returns: proj, delta, delta