class_docstr: Computes a vector of smooth labels from a vector of hard ones. The hard labels have to contain ones for the
  correct classes and zeros for all the others. The remaining probability mass between `max_value` and 1 is
  distributed uniformly between the incorrect classes for each instance.
  
  
  | Paper link: https://pdfs.semanticscholar.org/b5ec/486044c6218dd41b17d8bba502b32a12b91a.pdf
  
  | Please keep in mind the limitations of defences. For details on how to evaluate classifier security in general,
      see https://arxiv.org/abs/1902.06705  .
docstr: Apply label smoothing.
  
  :param x: Input data, will not be modified by this method.
  :param y: Original vector of label probabilities (one-vs-rest).
  :return: Unmodified input data and the vector of smooth probabilities as correct labels.
  :raises `ValueError`: If no labels are provided.
code: def __call__(
      self, x: np.ndarray, y: Optional[np.ndarray] = None
  ) -> Tuple[np.ndarray, Optional[np.ndarray]]:
      """
      Apply label smoothing.
  
      :param x: Input data, will not be modified by this method.
      :param y: Original vector of label probabilities (one-vs-rest).
      :return: Unmodified input data and the vector of smooth probabilities as correct labels.
      :raises `ValueError`: If no labels are provided.
      """
      if y is None:
          raise ValueError("Labels `y` cannot be None.")
  
      min_value = (1 - self.max_value) / (y.shape[1] - 1)
      assert self.max_value >= min_value
  
      smooth_y = y.copy()
      smooth_y[smooth_y == 1.0] = self.max_value
      smooth_y[smooth_y == 0.0] = min_value
      return x, smooth_y
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/label_smoothing.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple
  import numpy
  from art.defences.preprocessor.preprocessor import Preprocessor
label_desc: Use image node_id 2 for calling the LabelSmoothing obj's underlying member method code with example usage: obj.__call__(x, y) and returns: x,  smooth_y