code: def test_mag_to_param_non_uniform_fail(
      non_uniform_shape, non_uniform_type
  ):
      shape_lo = (2,)
      shape_hi = (3,)
  
      def mag_to_param(magnitude):
          shape = (
              shape_lo
              if not non_uniform_shape or magnitude < 5
              else shape_hi
          )
          dtype = (
              np.uint8
              if not non_uniform_type or magnitude < 3
              else np.uint16
          )
          return np.full(shape, 42, dtype=dtype)
  
      @augmentation(mag_range=(0, 10), mag_to_param=mag_to_param)
      def pass_param(data, param):
          return param
  
      @pipeline_def(num_threads=4, device_id=0, batch_size=8, seed=42)
      def pipeline():
          data = types.Constant(
              np.full((100, 100, 3), 42, dtype=np.uint8)
          )
          mag_bin = sample_info(lambda si: si.idx_in_batch)
          return pass_param(
              data, magnitude_bin=mag_bin, num_magnitude_bins=11
          )
  
      glob_msg = (
          f"augmentation must return the arrays of the same type and shape *"
          f"has shape {shape_hi if non_uniform_shape else shape_lo} and type "
          f"{'uint16' if non_uniform_type else 'uint8'}."
      )
      with assert_raises(Exception, glob=glob_msg):
          pipeline()
  
imports: import numpy
  import nvidia.dali.tensors
  from nvidia.dali import pipeline_def, fn, types
  from nvidia.dali.auto_aug.core import augmentation, signed_bin
  from nvidia.dali.auto_aug.core._args import forbid_unused_kwargs
  from nose2.tools import params
  from test_utils import check_batch
  from nose_utils import assert_warns, assert_raises
label_desc: Use image node_id 12 for calling a global function with example usage: test_mag_to_param_non_uniform_fail(non_uniform_shape, non_uniform_type) and returns: np, param, pass_param