code: def test_determinism():
      reseed()
  
      images = [
          ia.data.quokka(size=(128, 128)),
          ia.data.quokka(size=(64, 64)),
          ia.data.quokka((128, 256)),
      ]
      images.extend([ia.data.quokka(size=(16, 16))] * 20)
  
      keypoints = [
          ia.KeypointsOnImage(
              [
                  ia.Keypoint(x=20, y=10),
                  ia.Keypoint(x=5, y=5),
                  ia.Keypoint(x=10, y=43),
              ],
              shape=(50, 60, 3),
          )
      ] * 20
  
      augs = [
          iaa.Sequential([iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.SomeOf(1, [iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.OneOf([iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.Sometimes(0.5, iaa.Fliplr(1.0)),
          iaa.WithColorspace("HSV", children=iaa.Add((-50, 50))),
          iaa.Resize((0.5, 0.9)),
          iaa.CropAndPad(px=(-50, 50)),
          iaa.Pad(px=(1, 50)),
          iaa.Crop(px=(1, 50)),
          iaa.Fliplr(0.5),
          iaa.Flipud(0.5),
          iaa.Superpixels(p_replace=(0.25, 1.0), n_segments=(16, 128)),
          iaa.Grayscale(alpha=(0.1, 1.0)),
          iaa.GaussianBlur((0.1, 3.0)),
          iaa.AverageBlur((3, 11)),
          iaa.MedianBlur((3, 11)),
          iaa.Sharpen(alpha=(0.1, 1.0), lightness=(0.8, 1.2)),
          iaa.Emboss(alpha=(0.1, 1.0), strength=(0.8, 1.2)),
          iaa.EdgeDetect(alpha=(0.1, 1.0)),
          iaa.DirectedEdgeDetect(
              alpha=(0.1, 1.0), direction=(0.0, 1.0)
          ),
          iaa.Add((-50, 50)),
          iaa.AddElementwise((-50, 50)),
          iaa.AdditiveGaussianNoise(scale=(0.1, 1.0)),
          iaa.Multiply((0.6, 1.4)),
          iaa.MultiplyElementwise((0.6, 1.4)),
          iaa.Dropout((0.3, 0.5)),
          iaa.CoarseDropout((0.3, 0.5), size_percent=(0.05, 0.2)),
          iaa.Invert(0.5),
          iaa.Affine(
              scale=(0.7, 1.3),
              translate_percent=(-0.1, 0.1),
              rotate=(-20, 20),
              shear=(-20, 20),
              order=ia.ALL,
              mode=ia.ALL,
              cval=(0, 255),
          ),
          iaa.PiecewiseAffine(scale=(0.1, 0.3)),
          iaa.ElasticTransformation(alpha=10.0),
      ]
  
      augs_affect_geometry = [
          iaa.Sequential([iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.SomeOf(1, [iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.OneOf([iaa.Fliplr(0.5), iaa.Flipud(0.5)]),
          iaa.Sometimes(0.5, iaa.Fliplr(1.0)),
          iaa.Resize((0.5, 0.9)),
          iaa.CropAndPad(px=(-50, 50)),
          iaa.Pad(px=(1, 50)),
          iaa.Crop(px=(1, 50)),
          iaa.Fliplr(0.5),
          iaa.Flipud(0.5),
          iaa.Affine(
              scale=(0.7, 1.3),
              translate_percent=(-0.1, 0.1),
              rotate=(-20, 20),
              shear=(-20, 20),
              order=ia.ALL,
              mode=ia.ALL,
              cval=(0, 255),
          ),
          iaa.PiecewiseAffine(scale=(0.1, 0.3)),
          iaa.ElasticTransformation(alpha=(5, 100), sigma=(3, 5)),
      ]
  
      for aug in augs:
          aug_det = aug.to_deterministic()
          images_aug1 = aug_det.augment_images(images)
          images_aug2 = aug_det.augment_images(images)
  
          aug_det = aug.to_deterministic()
          images_aug3 = aug_det.augment_images(images)
          images_aug4 = aug_det.augment_images(images)
  
          assert array_equal_lists(
              images_aug1, images_aug2
          ), "Images (1, 2) expected to be identical for %s" % (
              aug.name,
          )
  
          assert array_equal_lists(
              images_aug3, images_aug4
          ), "Images (3, 4) expected to be identical for %s" % (
              aug.name,
          )
  
          assert not array_equal_lists(
              images_aug1, images_aug3
          ), "Images (1, 3) expected to be different for %s" % (
              aug.name,
          )
  
      for aug in augs_affect_geometry:
          aug_det = aug.to_deterministic()
          kps_aug1 = aug_det.augment_keypoints(keypoints)
          kps_aug2 = aug_det.augment_keypoints(keypoints)
  
          aug_det = aug.to_deterministic()
          kps_aug3 = aug_det.augment_keypoints(keypoints)
          kps_aug4 = aug_det.augment_keypoints(keypoints)
  
          assert keypoints_equal(
              kps_aug1, kps_aug2
          ), "Keypoints (1, 2) expected to be identical for %s" % (
              aug.name,
          )
  
          assert keypoints_equal(
              kps_aug3, kps_aug4
          ), "Keypoints (3, 4) expected to be identical for %s" % (
              aug.name,
          )
  
          assert not keypoints_equal(
              kps_aug1, kps_aug3
          ), "Keypoints (1, 3) expected to be different for %s" % (
              aug.name,
          )
  
file_path: imgaug/test/augmenters/test_mixed_files.py
imports: from __future__ import print_function, division, absolute_import
  import sys
  import numpy
  import skimage
  import skimage.data
  import six.moves
  import imgaug
  from imgaug import augmenters
  from imgaug.testutils import create_random_images, array_equal_lists, keypoints_equal, reseed, assertWarns
label_desc: Use image node_id 1 for calling a global function with example usage: test_determinism() without return types