code: def test_normalize_heatmaps(self):
      # ----
      # None
      # ----
      heatmaps_norm = normalization.normalize_heatmaps(None)
      assert heatmaps_norm is None
  
      # ----
      # array
      # ----
      heatmaps_norm = normalization.normalize_heatmaps(
          np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1,
          shapes=[np.zeros((1, 1, 3), dtype=np.uint8)],
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
      heatmaps_norm = normalization.normalize_heatmaps(
          np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1,
          shapes=np.zeros((1, 1, 1, 3), dtype=np.uint8),
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
      # --> heatmaps for too many images
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              np.zeros((2, 1, 1, 1), dtype=np.float32) + 0.1,
              shapes=[np.zeros((1, 1, 3), dtype=np.uint8)],
          )
  
      # --> too few heatmaps
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1,
              np.zeros((2, 1, 1, 3), dtype=np.uint8),
          )
  
      # --> wrong channel number
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
              shapes=np.zeros((1, 1, 1, 3), dtype=np.uint8),
          )
  
      # --> images None
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1,
              shapes=None,
          )
  
      # ----
      # single HeatmapsOnImage
      # ----
      heatmaps_norm = normalization.normalize_heatmaps(
          ia.HeatmapsOnImage(
              np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
              shape=(1, 1, 3),
          ),
          shapes=None,
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
      # ----
      # empty iterable
      # ----
      heatmaps_norm = normalization.normalize_heatmaps([], shapes=None)
      assert heatmaps_norm is None
  
      # ----
      # iterable of arrays
      # ----
      heatmaps_norm = normalization.normalize_heatmaps(
          [np.zeros((1, 1, 1), dtype=np.float32) + 0.1],
          shapes=[np.zeros((1, 1, 3), dtype=np.uint8)],
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
      heatmaps_norm = normalization.normalize_heatmaps(
          [np.zeros((1, 1, 1), dtype=np.float32) + 0.1],
          shapes=np.zeros((1, 1, 1, 3), dtype=np.uint8),
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
      # --> heatmaps for too many images
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              [
                  np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
                  np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
              ],
              shapes=[np.zeros((1, 1, 3), dtype=np.uint8)],
          )
  
      # --> too few heatmaps
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              [np.zeros((1, 1, 1), dtype=np.float32) + 0.1],
              shapes=np.zeros((2, 1, 1, 3), dtype=np.uint8),
          )
  
      # --> images None
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              [np.zeros((1, 1, 1), dtype=np.float32) + 0.1],
              shapes=None,
          )
  
      # --> wrong number of dimensions
      with self.assertRaises(ValueError):
          _heatmaps_norm = normalization.normalize_heatmaps(
              [np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1],
              shapes=np.zeros((1, 1, 1, 3), dtype=np.uint8),
          )
  
      # ----
      # iterable of HeatmapsOnImage
      # ----
      heatmaps_norm = normalization.normalize_heatmaps(
          [
              ia.HeatmapsOnImage(
                  np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
                  shape=(1, 1, 3),
              )
          ],
          shapes=None,
      )
      assert isinstance(heatmaps_norm, list)
      assert isinstance(heatmaps_norm[0], ia.HeatmapsOnImage)
      assert np.allclose(heatmaps_norm[0].arr_0to1, 0 + 0.1)
  
imports: from __future__ import print_function, division, absolute_import
  import sys
  import numpy
  import six.moves
  import imgaug
  import imgaug.augmentables.normalization
  from imgaug.testutils import reseed
label_desc: Use image node_id 10 for calling the TestNormalization obj's underlying member method code with example usage: obj.test_normalize_heatmaps() without return types