def __call__(self, x: np.ndarray, y: np.ndarray | None = None) -> tuple[np.ndarray, np.ndarray | None]:
        """
        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

        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.
        
art/defences/preprocessor/label_smoothing.py