code: def test_cmn_random_data_vs_numpy():
      norm_data = [
          ([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]),
          (
              [0.485 * 255, 0.456 * 255, 0.406 * 255],
              [0.229 * 255, 0.224 * 255, 0.225 * 255],
          ),
          ([0.485 * 255, 0.456 * 255, 0.406 * 255], None),
          (
              [0.485 * 255, 0.456 * 255, 0.406 * 255],
              [
                  255.0,
              ],
          ),
          (None, [0.229 * 255, 0.224 * 255, 0.225 * 255]),
          (
              [
                  128,
              ],
              [0.229 * 255, 0.224 * 255, 0.225 * 255],
          ),
      ]
      output_layouts = {
          "HWC": ["HWC", "CHW"],
          "FHWC": ["FHWC", "FCHW"],
          "DHWC": ["DHWC", "CDHW"],
          "FDHWC": ["FDHWC", "FCDHW"],
      }
  
      input_shapes = {
          "HWC": [(60, 80, 3)],
          "FHWC": [(3, 60, 80, 3)],
          "DHWC": [(10, 60, 80, 3)],
          "FDHWC": [(3, 10, 60, 80, 3)],
      }
  
      np.random.seed(12345)
  
      type_scale_shift = [
          (types.FLOAT, None, None),
          (types.FLOAT16, None, None),
          (types.UINT8, 64, 128),
          (types.INT8, 50, 5),
      ]
  
      for cmn_op, device in op_dev_pairs:
          for batch_size in [1, 4]:
              for input_layout in ["HWC", "FHWC", "DHWC", "FDHWC"]:
                  for input_shape in input_shapes[input_layout]:
                      assert len(input_layout) == len(input_shape)
                      for output_layout in output_layouts[input_layout]:
                          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_random_data_vs_numpy,
                                      cmn_op,
                                      device,
                                      batch_size,
                                      dtype,
                                      input_layout,
                                      input_shape,
                                      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 8 for calling a global function with example usage: test_cmn_random_data_vs_numpy() without return types