code: def test_cmn_vs_numpy():
      norm_data = [
          ([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]),
          ([0.5 * 255], [0.225 * 255]),
          (
              [0.485 * 255, 0.456 * 255, 0.406 * 255],
              [0.229 * 255, 0.224 * 255, 0.225 * 255],
          ),
      ]
  
      type_scale_shift = [
          (types.FLOAT, None, None),
          (types.FLOAT16, None, None),
          (types.UINT8, 64, 128),
          (types.INT8, 50, 5),
      ]
  
      np.random.seed(12321)
  
      for cmn_op, device in op_dev_pairs:
          for batch_size in [1, 4]:
              for output_layout in ["HWC", "CHW"]:
                  mirror_probs = [0.5] if batch_size > 1 else [0.0, 1.0]
                  for mirror_probability in mirror_probs:
                      for should_pad in [False, True]:
                          mean, std = norm_data[
                              np.random.randint(0, len(norm_data))
                          ]
                          (
                              dtype,
                              default_scale,
                              default_shift,
                          ) = type_scale_shift[
                              np.random.randint(
                                  0, len(type_scale_shift)
                              )
                          ]
                          shift = (
                              default_shift
                              if mean and mean[0] > 1
                              else None
                          )
                          scale = (
                              default_scale
                              if std and std[0] > 1
                              else None
                          )
                          yield (
                              check_cmn_vs_numpy,
                              cmn_op,
                              device,
                              batch_size,
                              dtype,
                              output_layout,
                              mirror_probability,
                              mean,
                              std,
                              scale,
                              shift,
                              should_pad,
                          )
  
imports: import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.ops
  import nvidia.dali.types
  import os
  from functools import partial
  from nvidia.dali import pipeline_def
  from nvidia.dali.pipeline import Pipeline
  from nose2.tools import params
  from nose_utils import assert_raises
  from nose_utils import raises
  from test_slice import check_slice_output, abs_slice_start_and_end
  from test_utils import RandomDataIterator
  from test_utils import as_array
  from test_utils import compare_pipelines, dali_type_to_np
  from test_utils import get_dali_extra_path
  import itertools
label_desc: Use image node_id 6 for calling a global function with example usage: test_cmn_vs_numpy() without return types