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: Resample `x` to a new sampling rate.
  
  :param x: Sample to resample of shape `(batch_size, length, channel)` or `(batch_size, channel, length)`.
  :param y: Labels of the sample `x`. This function does not affect them in any way.
  :return: Resampled audio sample.
docstr_tok: ["Resample","`","x","`","to","a","new","sampling","rate",".",":","param","x",":","Sample","to","resample","of","shape","`","(","batch_size",",","length",",","channel",")","`","or","`","(","batch_size",",","channel",",","length",")","`",".",":","param","y",":","Labels","of","the","sample","`","x","`",".","This","function","does","not","affect","them","in","any","way",".",":","return",":","Resampled","audio","sample","."]
code: def __call__(
      self, x: np.ndarray, y: Optional[np.ndarray] = None
  ) -> Tuple[np.ndarray, Optional[np.ndarray]]:
      """
      Resample `x` to a new sampling rate.
  
      :param x: Sample to resample of shape `(batch_size, length, channel)` or `(batch_size, channel, length)`.
      :param y: Labels of the sample `x`. This function does not affect them in any way.
      :return: Resampled audio sample.
      """
      import resampy
  
      if x.ndim != 3:
          raise ValueError(
              "Resampling can only be applied to temporal data across at least one channel."
          )
  
      sample_index = 2 if self.channels_first else 1
  
      return (
          resampy.resample(
              x,
              self.sr_original,
              self.sr_new,
              axis=sample_index,
              filter="sinc_window",
          ),
          y,
      )
  
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 2 for calling the Resample obj's underlying member method code with example usage: obj.__call__(x, y) and returns: resampy,  y