class_docstr: Implement the resampling defense approach.
  
  Resampling implicitly consists of a step that applies a low-pass filter. The underlying filter in this
  implementation is a Windowed Sinc Interpolation function.
docstr: Create an instance of the resample preprocessor.
  
  :param sr_original: Original sampling rate of sample.
  :param sr_new: New sampling rate of sample.
  :param channels_first: Set channels first or last.
  :param apply_fit: True if applied during fitting/training.
  :param apply_predict: True if applied during predicting.
docstr_tok: ["Create","an","instance","of","the","resample","preprocessor",".",":","param","sr_original",":","Original","sampling","rate","of","sample",".",":","param","sr_new",":","New","sampling","rate","of","sample",".",":","param","channels_first",":","Set","channels","first","or","last",".",":","param","apply_fit",":","True","if","applied","during","fitting\/training",".",":","param","apply_predict",":","True","if","applied","during","predicting","."]
code: def __init__(
      self,
      sr_original: int,
      sr_new: int,
      channels_first: bool = False,
      apply_fit: bool = False,
      apply_predict: bool = True,
  ):
      """
      Create an instance of the resample preprocessor.
  
      :param sr_original: Original sampling rate of sample.
      :param sr_new: New sampling rate of sample.
      :param channels_first: Set channels first or last.
      :param apply_fit: True if applied during fitting/training.
      :param apply_predict: True if applied during predicting.
      """
      super().__init__(
          is_fitted=True,
          apply_fit=apply_fit,
          apply_predict=apply_predict,
      )
      self.sr_original = sr_original
      self.sr_new = sr_new
      self.channels_first = channels_first
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/resample.py
imports: import logging
  from typing import Optional, Tuple
  import numpy
  from art.defences.preprocessor.preprocessor import Preprocessor
label_desc: Use image node_id 1 to create a new Resample object from inherited base classes: Preprocessor with example: obj = Resample(sr_original, sr_new, channels_first, apply_fit, apply_predict)