code: def test_channel_last(self):
      # Test data
      x = np.array(
          [
              [
                  [[0.2, 0.6, 0.8], [0.9, 0.4, 0.3], [0.2, 0.8, 0.5]],
                  [[0.2, 0.6, 0.8], [0.9, 0.4, 0.3], [0.2, 0.8, 0.5]],
              ],
              [
                  [[0.2, 0.6, 0.8], [0.9, 0.4, 0.3], [0.2, 0.8, 0.5]],
                  [[0.2, 0.6, 0.8], [0.9, 0.4, 0.3], [0.2, 0.8, 0.5]],
              ],
          ]
      )
  
      # Create an instance of ThermometerEncoding
      th_encoder = ThermometerEncoding(clip_values=(0, 1), num_space=4)
  
      # Preprocess
      x_preproc, _ = th_encoder(x)
  
      # Test
      self.assertEqual(x_preproc.shape, (2, 2, 3, 12))
  
      true_value = np.array(
          [
              [
                  [
                      [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1],
                      [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
                  ],
                  [
                      [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1],
                      [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
                  ],
              ],
              [
                  [
                      [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1],
                      [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
                  ],
                  [
                      [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1],
                      [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0],
                      [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
                  ],
              ],
          ]
      )
      self.assertTrue((x_preproc == true_value).all())
  
      # Create an instance of ThermometerEncoding
      th_encoder_scaled = ThermometerEncoding(
          clip_values=(-10, 10), num_space=4
      )
      x_preproc_scaled, _ = th_encoder_scaled(20 * x - 10)
      self.assertTrue((x_preproc_scaled == true_value).all())
  
file_path: adversarial-robustness-toolbox/tests/defences/test_thermometer_encoding.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import numpy
  from art.defences.preprocessor import ThermometerEncoding
  from tests.utils import master_seed
label_desc: Use image node_id 2 for calling the TestThermometerEncoding obj's underlying member method code with example usage: obj.test_channel_last() without return types