code: 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 == 2:
              delta = np.sqrt(d) * theta * dist_post_update
          elif constraint == np.inf:
              delta = d * theta * dist_post_update
  
      return delta
  
file_path: cleverhans/cleverhans/torch/attacks/hop_skip_jump_attack.py
imports: import numpy
  import torch
label_desc: Use image node_id 8 for calling a global function with example usage: select_delta(dist_post_update, current_iteration, clip_max, clip_min, d, theta, constraint) and returns: delta