<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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