code: def test_invert_normalize_segmentation_maps(self):
      def _norm_and_invert(segmaps, images):
          return normalization.invert_normalize_segmentation_maps(
              normalization.normalize_segmentation_maps(
                  segmaps, shapes=images
              ),
              segmaps,
          )
  
      # ----
      # None
      # ----
      observed = normalization.invert_normalize_segmentation_maps(
          None, None
      )
      assert observed is None
  
      # ----
      # array
      # ----
      for dt in [np.dtype("int32"), np.dtype("uint16"), np.dtype(bool)]:
          for images in [
              [np.zeros((1, 1, 3), dtype=np.uint8)],
              np.zeros((1, 1, 3), dtype=np.uint8),
          ]:
              before = np.ones((1, 1, 1, 1), dtype=dt)
              after = _norm_and_invert(before, images=images)
              assert ia.is_np_array(after)
              assert after.shape == (1, 1, 1, 1)
              assert after.dtype.name == dt.name
              assert np.array_equal(after, before)
  
      # ----
      # single SegmentationMapsOnImage
      # ----
      before = ia.SegmentationMapsOnImage(
          np.zeros((1, 1, 1), dtype=np.int32) + 1, shape=(1, 1, 3)
      )
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, ia.SegmentationMapsOnImage)
      assert after.shape == before.shape
      assert np.array_equal(after.arr, before.arr)
  
      # ----
      # empty iterable
      # ----
      before = []
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, list)
      assert len(after) == 0
  
      # ----
      # iterable of arrays
      # ----
      for dt in [np.dtype("int32"), np.dtype("uint16"), np.dtype(bool)]:
          for images in [
              [np.zeros((1, 1, 3), dtype=np.uint8)],
              np.zeros((1, 1, 1, 3), dtype=np.uint8),
          ]:
              before = [np.ones((1, 1, 1), dtype=dt)]
              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 == dt.name
              assert np.array_equal(after[0], before[0])
  
      # ----
      # iterable of SegmentationMapsOnImage
      # ----
      before = [
          ia.SegmentationMapsOnImage(
              np.zeros((1, 1, 1), dtype=np.int32) + 1, shape=(1, 1, 3)
          )
      ]
      after = _norm_and_invert(before, images=None)
      assert isinstance(after, list)
      assert isinstance(after[0], ia.SegmentationMapsOnImage)
      assert after[0].shape == before[0].shape
      assert np.allclose(after[0].arr, before[0].arr)
  
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 4 for calling the TestNormalization obj's underlying member method code with example usage: obj.test_invert_normalize_segmentation_maps() and returns: normalization