class_docstr: The abstract base class `BaseEstimator` defines the basic requirements of an estimator in ART. The BaseEstimator is
  is the highest abstraction of a machine learning model in ART.
class_docstr_tok: ["The","abstract","base","class","`","BaseEstimator","`","defines","the","basic","requirements","of","an","estimator","in","ART",".","The","BaseEstimator","is","is","the","highest","abstraction","of","a","machine","learning","model","in","ART","."]
docstr: Apply all defences and preprocessing operations on the inputs `x` and `y`. This function has to be applied to
  all raw inputs `x` and `y` provided to the estimator.
  
  :param x: Samples.
  :type x: Format as expected by the `model`
  :param y: Target values.
  :type y: Format as expected by the `model` or `None`
  :param fit: `True` if the defences are applied during training.
  :return: Tuple of `x` and `y` after applying the defences and standardisation.
  :rtype: Format as expected by the `model`
code: def _apply_preprocessing(self, x, y, fit: bool) -> Tuple[Any, Any]:
      """
      Apply all defences and preprocessing operations on the inputs `x` and `y`. This function has to be applied to
      all raw inputs `x` and `y` provided to the estimator.
  
      :param x: Samples.
      :type x: Format as expected by the `model`
      :param y: Target values.
      :type y: Format as expected by the `model` or `None`
      :param fit: `True` if the defences are applied during training.
      :return: Tuple of `x` and `y` after applying the defences and standardisation.
      :rtype: Format as expected by the `model`
      """
      if self.preprocessing_operations:
          for preprocess in self.preprocessing_operations:
              if fit:
                  if preprocess.apply_fit:
                      x, y = preprocess(x, y)
              else:
                  if preprocess.apply_predict:
                      x, y = preprocess(x, y)
  
      return x, y
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
label_desc: Use image node_id 15 for calling the BaseEstimator obj's underlying member method code with example usage: obj._apply_preprocessing(x, y, fit) and returns: x,  y