class_docstr: Reduces the sensibility of the features of a sample.
  
  | Paper link: https://arxiv.org/abs/1704.01155
  
  | Please keep in mind the limitations of defences. For more information on the limitations of this defence,
      see https://arxiv.org/abs/1803.09868 . For details on how to evaluate classifier security in general,
      see https://arxiv.org/abs/1902.06705
class_docstr_tok: ["Reduces","the","sensibility","of","the","features","of","a","sample",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1704.01155","|","Please","keep","in","mind","the","limitations","of","defences",".","For","more","information","on","the","limitations","of","this","defence",",","see","https",":","\/\/arxiv.org\/abs\/1803.09868",".","For","details","on","how","to","evaluate","classifier","security","in","general",",","see","https",":","\/\/arxiv.org\/abs\/1902.06705"]
docstr: Apply feature squeezing to sample `x`.
  
  :param x: Sample to squeeze. `x` values are expected to be in the data range provided by `clip_values`.
  :param y: Labels of the sample `x`. This function does not affect them in any way.
  :return: Squeezed sample.
docstr_tok: ["Apply","feature","squeezing","to","sample","`","x","`",".",":","param","x",":","Sample","to","squeeze",".","`","x","`","values","are","expected","to","be","in","the","data","range","provided","by","`","clip_values","`",".",":","param","y",":","Labels","of","the","sample","`","x","`",".","This","function","does","not","affect","them","in","any","way",".",":","return",":","Squeezed","sample","."]
code: def __call__(
      self, x: np.ndarray, y: Optional[np.ndarray] = None
  ) -> Tuple[np.ndarray, Optional[np.ndarray]]:
      """
      Apply feature squeezing to sample `x`.
  
      :param x: Sample to squeeze. `x` values are expected to be in the data range provided by `clip_values`.
      :param y: Labels of the sample `x`. This function does not affect them in any way.
      :return: Squeezed sample.
      """
      x_normalized = x - self.clip_values[0]
      x_normalized = x_normalized / (
          self.clip_values[1] - self.clip_values[0]
      )
  
      max_value = np.rint(2**self.bit_depth - 1)
      res = np.rint(x_normalized * max_value) / max_value
  
      res = res * (self.clip_values[1] - self.clip_values[0])
      res = res + self.clip_values[0]
  
      return res, y
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/feature_squeezing.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple
  import numpy
  from art.utils import CLIP_VALUES_TYPE
  from art.defences.preprocessor.preprocessor import Preprocessor
label_desc: Use image node_id 2 for calling the FeatureSqueezing obj's underlying member method code with example usage: obj.__call__(x, y) and returns: res,  y