code: def get_or_guess_labels(self, x, kwargs):
      
      if 'y' in kwargs and 'y_target' in kwargs:
        raise ValueError("Can not set both 'y' and 'y_target'.")
      elif 'y' in kwargs:
        labels = kwargs['y']
      elif 'y_target' in kwargs and kwargs['y_target'] is not None:
        labels = kwargs['y_target']
      else:
        preds = self.model.get_probs(x)
        preds_max = reduce_max(preds, 1, keepdims=True)
        original_predictions = tf.to_float(tf.equal(preds, preds_max))
        labels = tf.stop_gradient(original_predictions)
        del preds
      if isinstance(labels, np.ndarray):
        nb_classes = labels.shape[1]
      else:
        nb_classes = labels.get_shape().as_list()[1]
      return labels, nb_classes
docs: Get the label to use in generating an adversarial example for x.
      The kwargs are fed directly from the kwargs of the attack.
      If 'y' is in kwargs, then assume it's an untargeted attack and
      use that as the label.
      If 'y_target' is in kwargs and is not none, then assume it's a
      targeted attack and use that as the label.
      Otherwise, use the model's prediction as the label and perform an
      untargeted attack.