code: def test_run_auto_aug(i, args):
      (
          policy_name,
          dev,
          uniformly_resized,
          use_shape,
          fill_value,
          specify_translation_bounds,
      ) = args
      batch_sizes = [1, 8, 7, 64, 13, 41]
      batch_size = batch_sizes[i % len(batch_sizes)]
  
      @pipeline_def(
          enable_conditionals=True,
          batch_size=batch_size,
          num_threads=4,
          device_id=0,
          seed=43,
      )
      def pipeline():
          encoded_image, _ = fn.readers.file(
              name="Reader", file_root=images_dir
          )
          image = fn.decoders.image(
              encoded_image, device="cpu" if dev == "cpu" else "mixed"
          )
          if uniformly_resized:
              image = fn.resize(image, size=(244, 244))
          extra = (
              {}
              if not use_shape
              else {"shape": fn.peek_image_shape(encoded_image)}
          )
          if fill_value is not None:
              extra["fill_value"] = fill_value
          if specify_translation_bounds:
              if use_shape:
                  extra["max_translate_rel"] = 0.9
              else:
                  extra["max_translate_abs"] = 400
          image = auto_augment.auto_augment(image, policy_name, **extra)
          return image
  
      # run the pipeline twice to make sure instantiation preserves determinism
      p1 = pipeline()
      p1.build()
      p2 = pipeline()
      p2.build()
      for _ in range(3):
          (out1,) = p1.run()
          (out2,) = p2.run()
          check_batch(out1, out2)
  
imports: import itertools
  import os
  import unittest
  import random
  import numpy
  from scipy.stats import chisquare
  from nose2.tools import params
  from nvidia.dali import fn, types
  from nvidia.dali import pipeline_def
  from nvidia.dali.auto_aug import auto_augment, augmentations
  from nvidia.dali.auto_aug.core import augmentation, Policy
  from test_utils import get_dali_extra_path, check_batch
  from nose_utils import assert_raises, assert_warns
label_desc: Use image node_id 4 for calling a global function with example usage: test_run_auto_aug(i, args) and returns: image