code: def test_auto_contrast_mono_channels(modality, dev):
      def modal_shape(shape, num_frames=15):
          if modality != "video":
              return shape
          return (num_frames,) + shape
  
      rng = np.random.default_rng(seed=42)
      const_single_channel = np.full(
          modal_shape((101, 205, 1)), 0, dtype=np.uint8
      )
      const_multi_channel = np.full(
          modal_shape((200, 512, 3)), 255, dtype=np.uint8
      )
      const_multi_per_channel = np.stack(
          [
              np.full(modal_shape((300, 300), 7), 254, dtype=np.uint8),
              np.full(modal_shape((300, 300), 7), 159, dtype=np.uint8),
              np.full(modal_shape((300, 300), 7), 1, dtype=np.uint8),
          ],
          axis=-1,
      )
      rnd_uniform_and_fixed_channel = np.stack(
          [
              np.uint8(
                  rng.uniform(50, 160, modal_shape((400, 400), 32))
              ),
              np.full(modal_shape((400, 400), 32), 159, dtype=np.uint8),
              np.uint8(
                  rng.uniform(0, 255, modal_shape((400, 400), 32))
              ),
          ],
          axis=-1,
      )
      imgs = [
          const_single_channel,
          const_multi_channel,
          const_multi_per_channel,
          rnd_uniform_and_fixed_channel,
      ]
  
      def get_batch():
          layout = "HWC" if modality != "video" else "FHWC"
          return fn.external_source(
              lambda: imgs, batch=True, layout=layout
          )
  
      compare_against_baseline(
          a.auto_contrast,
          pil_baseline(ImageOps.autocontrast),
          get_batch,
          batch_size=len(imgs),
          max_allowed_error=1,
          dev=dev,
          modality=modality,
      )
  
imports: import itertools
  import os
  import numpy
  from PIL import Image, ImageEnhance, ImageOps
  from nose2.tools import params, cartesian_params
  import nvidia.dali.tensors
  from nvidia.dali import fn, pipeline_def
  from nvidia.dali.auto_aug import augmentations
  from nvidia.dali.auto_aug.core._utils import get_translations
  from test_utils import get_dali_extra_path, check_batch
label_desc: Use image node_id 24 for calling a global function with example usage: test_auto_contrast_mono_channels(modality, dev) and returns: unknown, fn, shape