code: def compute_distance(x_ori, x_pert, constraint=2):
      """Compute the distance between two images."""
      if constraint == 2:
          dist = torch.norm(x_ori - x_pert, p=2)
      elif constraint == np.inf:
          dist = torch.max(torch.abs(x_ori - x_pert))
      return dist
  
file_path: cleverhans/cleverhans/torch/attacks/hop_skip_jump_attack.py
imports: import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: compute_distance(x_ori, x_pert, constraint) and returns: dist