class_docstr: Common class for different variations of implementation of the Projected Gradient Descent attack. The attack is an
  iterative method in which, after each iteration, the perturbation is projected on an lp-ball of specified radius (in
  addition to clipping the values of the adversarial sample so that it lies in the permitted data range). This is the
  attack proposed by Madry et al. for adversarial training.
  
  | Paper link: https://arxiv.org/abs/1706.06083
docstr: Check and set up targets.
  
  :param x: An array with the original inputs.
  :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices of shape
            (nb_samples,). Only provide this parameter if you'd like to use true labels when crafting adversarial
            samples. Otherwise, model predictions are used as labels to avoid the "label leaking" effect
            (explained in this paper: https://arxiv.org/abs/1611.01236). Default is `None`.
  :param classifier_mixin: Whether the estimator is of type `ClassifierMixin`.
  :return: The targets.
docstr_tok: ["Check","and","set","up","targets",".",":","param","x",":","An","array","with","the","original","inputs",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","`","(","nb_samples",",","nb_classes",")","`","or","indices","of","shape","(","nb_samples",",",")",".","Only","provide","this","parameter","if","you","'d","like","to","use","true","labels","when","crafting","adversarial","samples",".","Otherwise",",","model","predictions","are","used","as","labels","to","avoid","the","``","label","leaking","''","effect","(","explained","in","this","paper",":","https",":","\/\/arxiv.org\/abs\/1611.01236",")",".","Default","is","`","None","`",".",":","param","classifier_mixin",":","Whether","the","estimator","is","of","type","`","ClassifierMixin","`",".",":","return",":","The","targets","."]
code: def _set_targets(
      self,
      x: np.ndarray,
      y: Optional[np.ndarray],
      classifier_mixin: bool = True,
  ) -> np.ndarray:
      """
      Check and set up targets.
  
      :param x: An array with the original inputs.
      :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices of shape
                (nb_samples,). Only provide this parameter if you'd like to use true labels when crafting adversarial
                samples. Otherwise, model predictions are used as labels to avoid the "label leaking" effect
                (explained in this paper: https://arxiv.org/abs/1611.01236). Default is `None`.
      :param classifier_mixin: Whether the estimator is of type `ClassifierMixin`.
      :return: The targets.
      """
      if classifier_mixin:
          if y is not None:
              y = check_and_transform_label_format(
                  y, nb_classes=self.estimator.nb_classes
              )
  
      if y is None:
          # Throw error if attack is targeted, but no targets are provided
          if self.targeted:  # pragma: no cover
              raise ValueError(
                  "Target labels `y` need to be provided for a targeted attack."
              )
  
          # Use model predictions as correct outputs
          if classifier_mixin:
              targets = get_labels_np_array(
                  self.estimator.predict(x, batch_size=self.batch_size)
              )
          else:
              targets = self.estimator.predict(
                  x, batch_size=self.batch_size
              )
  
      else:
          targets = y
  
      return targets
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Union, TYPE_CHECKING
  import numpy
  from scipy.stats import truncnorm
  from tqdm.auto import trange
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format, compute_success_array
  from art.summary_writer import SummaryWriter
label_desc: Use image node_id 3 for calling the ProjectedGradientDescentCommon obj's underlying member method code with example usage: obj._set_targets(x, y, classifier_mixin) and returns: targets