class_docstr: Implementation of the HopSkipJump attack from Jianbo et al. (2019). This is a powerful black-box attack that
  only requires final class prediction, and is an advanced version of the boundary attack.
  
  | Paper link: https://arxiv.org/abs/1904.02144
docstr: Binary search to approach the boundary.
  
  :param current_sample: Current adversarial example.
  :param original_sample: The original input.
  :param target: The target label.
  :param norm: Order of the norm. Possible values: "inf", np.inf or 2.
  :param clip_min: Minimum value of an example.
  :param clip_max: Maximum value of an example.
  :param threshold: The upper threshold in binary search.
  :return: an adversarial example.
docstr_tok: ["Binary","search","to","approach","the","boundary",".",":","param","current_sample",":","Current","adversarial","example",".",":","param","original_sample",":","The","original","input",".",":","param","target",":","The","target","label",".",":","param","norm",":","Order","of","the","norm",".","Possible","values",":","``","inf","''",",","np.inf","or","2.",":","param","clip_min",":","Minimum","value","of","an","example",".",":","param","clip_max",":","Maximum","value","of","an","example",".",":","param","threshold",":","The","upper","threshold","in","binary","search",".",":","return",":","an","adversarial","example","."]
code: def _binary_search(
      self,
      current_sample: np.ndarray,
      original_sample: np.ndarray,
      target: int,
      norm: Union[int, float, str],
      clip_min: float,
      clip_max: float,
      threshold: Optional[float] = None,
  ) -> np.ndarray:
      """
      Binary search to approach the boundary.
  
      :param current_sample: Current adversarial example.
      :param original_sample: The original input.
      :param target: The target label.
      :param norm: Order of the norm. Possible values: "inf", np.inf or 2.
      :param clip_min: Minimum value of an example.
      :param clip_max: Maximum value of an example.
      :param threshold: The upper threshold in binary search.
      :return: an adversarial example.
      """
      # First set upper and lower bounds as well as the threshold for the binary search
      if norm == 2:
          (upper_bound, lower_bound) = (np.array(1.0), np.array(0.0))
  
          if threshold is None:
              threshold = self.theta
  
      else:
          (upper_bound, lower_bound) = (
              np.max(abs(original_sample - current_sample)),
              np.array(0.0),
          )
  
          if threshold is None:
              threshold = np.minimum(
                  upper_bound * self.theta, self.theta
              )
  
      # Then start the binary search
      while (upper_bound - lower_bound) > threshold:
          # Interpolation point
          alpha = (upper_bound + lower_bound) / 2.0
          interpolated_sample = self._interpolate(
              current_sample=current_sample,
              original_sample=original_sample,
              alpha=alpha,
              norm=norm,
          )
  
          # Update upper_bound and lower_bound
          satisfied = self._adversarial_satisfactory(
              samples=interpolated_sample[None],
              target=target,
              clip_min=clip_min,
              clip_max=clip_max,
          )[0]
          lower_bound = np.where(satisfied == 0, alpha, lower_bound)
          upper_bound = np.where(satisfied == 1, alpha, upper_bound)
  
      result = self._interpolate(
          current_sample=current_sample,
          original_sample=original_sample,
          alpha=float(upper_bound),
          norm=norm,
      )
  
      return result
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification import ClassifierMixin
  from art.utils import compute_success, to_categorical, check_and_transform_label_format, get_labels_np_array
label_desc: Use image node_id 6 for calling the HopSkipJump obj's underlying member method code with example usage: obj._binary_search(current_sample, original_sample, target, norm, clip_min, clip_max, threshold) and returns: result