class_docstr: The elastic net attack of Pin-Yu Chen et al. (2018).
  
  | Paper link: https://arxiv.org/abs/1709.04114
docstr: Generate adversarial examples for a batch of inputs with a specific batch of constants.
  
  :param x_batch: A batch of original examples.
  :param y_batch: A batch of targets (0-1 hot).
  :param c_batch: A batch of constants.
  :return: A tuple of best elastic distances, best labels, best attacks
docstr_tok: ["Generate","adversarial","examples","for","a","batch","of","inputs","with","a","specific","batch","of","constants",".",":","param","x_batch",":","A","batch","of","original","examples",".",":","param","y_batch",":","A","batch","of","targets","(","0-1","hot",")",".",":","param","c_batch",":","A","batch","of","constants",".",":","return",":","A","tuple","of","best","elastic","distances",",","best","labels",",","best","attacks"]
code: def _generate_bss(
      self,
      x_batch: np.ndarray,
      y_batch: np.ndarray,
      c_batch: np.ndarray,
  ) -> tuple:
      """
      Generate adversarial examples for a batch of inputs with a specific batch of constants.
  
      :param x_batch: A batch of original examples.
      :param y_batch: A batch of targets (0-1 hot).
      :param c_batch: A batch of constants.
      :return: A tuple of best elastic distances, best labels, best attacks
      """
  
      def compare(o_1, o_2):
          if self.targeted:
              return o_1 == o_2
          return o_1 != o_2
  
      # Initialize best distortions and best changed labels and best attacks
      best_dist = np.inf * np.ones(x_batch.shape[0])
      best_label = [-np.inf] * x_batch.shape[0]
      best_attack = x_batch.copy()
  
      # Implement the algorithm 1 in the EAD paper
      x_adv = x_batch.copy()
      y_adv = x_batch.copy()
      for i_iter in range(self.max_iter):
          logger.debug(
              "Iteration step %i out of %i", i_iter, self.max_iter
          )
  
          # Update learning rate
          learning_rate = self._decay_learning_rate(
              global_step=i_iter,
              end_learning_rate=0,
              decay_steps=self.max_iter,
          )
  
          # Compute adversarial examples
          grad = self._gradient_of_loss(
              target=y_batch, x=x_batch, x_adv=y_adv, c_weight=c_batch
          )
          x_adv_next = self._shrinkage_threshold(
              y_adv - learning_rate * grad, x_batch, self.beta
          )
          y_adv = x_adv_next + (1.0 * i_iter / (i_iter + 3)) * (
              x_adv_next - x_adv
          )
          x_adv = x_adv_next
  
          # Adjust the best result
          (logits, l1dist, l2dist, endist) = self._loss(
              x=x_batch, x_adv=x_adv
          )
  
          if self.decision_rule == "EN":
              zip_set = zip(endist, logits)
          elif self.decision_rule == "L1":
              zip_set = zip(l1dist, logits)
          elif self.decision_rule == "L2":
              zip_set = zip(l2dist, logits)
          else:  # pragma: no cover
              raise ValueError(
                  "The decision rule only supports `EN`, `L1`, `L2`."
              )
  
          for j, (distance, label) in enumerate(zip_set):
              if distance < best_dist[j] and compare(
                  label, np.argmax(y_batch[j])
              ):
                  best_dist[j] = distance
                  best_attack[j] = x_adv[j]
                  best_label[j] = label
  
      return best_dist, best_label, best_attack
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  import six
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 8 for calling the ElasticNet obj's underlying member method code with example usage: obj._generate_bss(x_batch, y_batch, c_batch) and returns: best_dist,  best_label,  best_attack, unknown, unknown