code: def check_crop_mirror_normalize_wrong_layout(
      cmn_fn,
      device,
      batch_size,
      input_shape=(100, 200, 3),
      layout="ABC",
  ):
      assert len(layout) == len(input_shape)
  
      @pipeline_def
      def get_pipe():
          def get_data():
              out = [
                  np.zeros(input_shape, dtype=np.uint8)
                  for _ in range(batch_size)
              ]
              return out
  
          data = fn.external_source(
              source=get_data, layout=layout, device=device
          )
          return cmn_fn(data, crop_h=10, crop_w=10)
  
      pipe = get_pipe(batch_size=batch_size, device_id=0, num_threads=3)
      pipe.build()
      with assert_raises(
          RuntimeError,
          glob=f'The layout "{layout}" does not match any of the allowed layouts',
      ):
          pipe.run()
  
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 17 for calling a global function with example usage: check_crop_mirror_normalize_wrong_layout(cmn_fn, device, batch_size, input_shape, layout) and returns: cmn_fn, out