code: def test_invert_normalize_images(self):
      assert normalization.invert_normalize_images(None, None) is None
  
      arr = np.zeros((1, 4, 4, 3), dtype=np.uint8)
      arr_old = np.zeros((1, 4, 4, 3), dtype=np.uint8)
      observed = normalization.invert_normalize_images(arr, arr_old)
      assert ia.is_np_array(observed)
      assert observed.shape == (1, 4, 4, 3)
      assert observed.dtype.name == "uint8"
  
      arr = np.zeros((1, 4, 4, 1), dtype=np.uint8)
      arr_old = np.zeros((4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(arr, arr_old)
      assert ia.is_np_array(observed)
      assert observed.shape == (4, 4)
      assert observed.dtype.name == "uint8"
  
      arr = np.zeros((1, 4, 4, 1), dtype=np.uint8)
      arr_old = np.zeros((1, 4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(arr, arr_old)
      assert ia.is_np_array(observed)
      assert observed.shape == (1, 4, 4)
      assert observed.dtype.name == "uint8"
  
      images = []
      images_old = []
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      assert isinstance(observed, list)
      assert len(observed) == 0
  
      arr1 = np.zeros((4, 4, 1), dtype=np.uint8)
      arr2 = np.zeros((5, 5, 3), dtype=np.uint8)
      arr1_old = np.zeros((4, 4), dtype=np.uint8)
      arr2_old = np.zeros((5, 5, 3), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          [arr1, arr2], [arr1_old, arr2_old]
      )
      assert isinstance(observed, list)
      assert len(observed) == 2
      assert ia.is_np_array(observed[0])
      assert ia.is_np_array(observed[1])
      assert observed[0].shape == (4, 4)
      assert observed[1].shape == (5, 5, 3)
      assert observed[0].dtype.name == "uint8"
      assert observed[1].dtype.name == "uint8"
  
      # ---------
      # images turned to list during augmentation
      # ---------
      # different shapes, each 3D
      images = [
          np.zeros((3, 4, 1), dtype=np.uint8),
          np.zeros((4, 3, 1), dtype=np.uint8),
      ]
      images_old = np.zeros((2, 4, 4, 1), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      assert isinstance(observed, list)
      assert len(observed) == 2
      assert observed[0] is images[0]
      assert observed[1] is images[1]
  
      # different shapes, each 2D
      images = [
          np.zeros((3, 4, 1), dtype=np.uint8),
          np.zeros((4, 3, 1), dtype=np.uint8),
      ]
      images_old = np.zeros((2, 4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      assert isinstance(observed, list)
      assert len(observed) == 2
      assert observed[0].shape == (3, 4)
      assert observed[1].shape == (4, 3)
  
      # same shapes, each 3D
      images = [
          np.zeros((3, 4, 1), dtype=np.uint8),
          np.zeros((3, 4, 1), dtype=np.uint8),
      ]
      images_old = np.zeros((2, 4, 4, 1), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      # assert ia.is_np_array(observed)
      # assert observed.shape == (2, 3, 4, 1)
      assert isinstance(observed, list)
      assert len(observed) == 2
      assert observed[0] is images[0]
      assert observed[1] is images[1]
  
      # same shapes, each 2D
      images = [
          np.zeros((3, 4, 1), dtype=np.uint8),
          np.zeros((3, 4, 1), dtype=np.uint8),
      ]
      images_old = np.zeros((2, 4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      # assert ia.is_np_array(observed)
      # assert observed.shape == (2, 3, 4)
      assert isinstance(observed, list)
      assert len(observed) == 2
      assert observed[0].shape == (3, 4)
      assert observed[1].shape == (3, 4)
  
      # single item in list
      images = [np.zeros((3, 4, 1), dtype=np.uint8)]
      images_old = np.zeros((1, 4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      # assert ia.is_np_array(observed)
      # assert observed.shape == (1, 3, 4)
      assert isinstance(observed, list)
      assert len(observed) == 1
      assert observed[0].shape == (3, 4)
  
      # single item in list, original was 2D
      images = [np.zeros((3, 4, 1), dtype=np.uint8)]
      images_old = np.zeros((4, 4), dtype=np.uint8)
      observed = normalization.invert_normalize_images(
          images, images_old
      )
      # assert ia.is_np_array(observed)
      # assert observed.shape == (3, 4)
      assert isinstance(observed, list)
      assert len(observed) == 1
      assert observed[0].shape == (3, 4)
  
      with self.assertRaises(ValueError):
          normalization.invert_normalize_images(False, False)
  
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 2 for calling the TestNormalization obj's underlying member method code with example usage: obj.test_invert_normalize_images() without return types