code: def test_invert_normalize_heatmaps(self):
      def _norm_and_invert(heatmaps, images):
          return normalization.invert_normalize_heatmaps(
              normalization.normalize_heatmaps(heatmaps, shapes=images),
              heatmaps,
          )
  
      # ----
      # None
      # ----
      observed = normalization.invert_normalize_heatmaps(None, None)
      assert observed is None
  
      # ----
      # array
      # ----
      for images in [
          [np.zeros((1, 1, 3), dtype=np.uint8)],
          np.zeros((1, 1, 1, 3), dtype=np.uint8),
      ]:
          before = np.zeros((1, 1, 1, 1), dtype=np.float32) + 0.1
          after = _norm_and_invert(before, images=images)
          assert ia.is_np_array(after)
          assert after.shape == (1, 1, 1, 1)
          assert after.dtype.name == "float32"
          assert np.allclose(after, before)
  
      # ----
      # single HeatmapsOnImage
      # ----
      before = ia.HeatmapsOnImage(
          np.zeros((1, 1, 1), dtype=np.float32) + 0.1, shape=(1, 1, 3)
      )
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, ia.HeatmapsOnImage)
      assert after.shape == before.shape
      assert np.allclose(after.arr_0to1, before.arr_0to1)
  
      # ----
      # empty iterable
      # ----
      before = []
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, list)
      assert len(after) == 0
  
      # ----
      # iterable of arrays
      # ----
      for images in [
          [np.zeros((1, 1, 3), dtype=np.uint8)],
          np.zeros((1, 1, 1, 3), dtype=np.uint8),
      ]:
          before = [np.zeros((1, 1, 1), dtype=np.float32) + 0.1]
          after = _norm_and_invert(before, images=images)
          assert isinstance(after, list)
          assert len(after) == 1
          assert after[0].shape == (1, 1, 1)
          assert after[0].dtype.name == "float32"
          assert np.allclose(after[0], before[0])
  
      # ----
      # iterable of HeatmapsOnImage
      # ----
      before = [
          ia.HeatmapsOnImage(
              np.zeros((1, 1, 1), dtype=np.float32) + 0.1,
              shape=(1, 1, 3),
          )
      ]
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, list)
      assert isinstance(after[0], ia.HeatmapsOnImage)
      assert after[0].shape == before[0].shape
      assert np.allclose(after[0].arr_0to1, before[0].arr_0to1)
  
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 3 for calling the TestNormalization obj's underlying member method code with example usage: obj.test_invert_normalize_heatmaps() and returns: normalization