code: def compute_distance(x_ori, x_pert, constraint="l2"):
      """Compute the distance between two images."""
      if constraint == "l2":
          dist = np.linalg.norm(x_ori - x_pert)
      elif constraint == "linf":
          dist = np.max(abs(x_ori - x_pert))
      return dist
  
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 4 for calling a global function with example usage: compute_distance(x_ori, x_pert, constraint) and returns: dist