<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_delta(dist_post_update, current_iteration, clip_max, clip_min, d, theta, constraint):
 """ Choose the delta at the scale of distance between x and perturbed sample. """

  if current_iteration == 1:
    delta = 0.1 * (clip_max - clip_min)
  else:
    if constraint == 'l2':
      delta = np.sqrt(d) * theta * dist_post_update
    elif constraint == 'linf':
      delta = d * theta * dist_post_update

  return delta