code: def check_roi_random_crop_error(
      shape_like_in=None,
      in_shape=None,
      crop_shape=None,
      roi_start=None,
      roi_shape=None,
      roi_end=None,
      error_msg="",
  ):
      batch_size = 3
      niter = 3
      pipe = dali.pipeline.Pipeline(
          batch_size=batch_size, num_threads=4, device_id=0, seed=1234
      )
      with pipe:
          inputs = [] if shape_like_in is None else [shape_like_in]
          out = fn.roi_random_crop(
              *inputs,
              in_shape=in_shape,
              crop_shape=crop_shape,
              roi_start=roi_start,
              roi_shape=roi_shape,
              roi_end=roi_end,
              device="cpu",
          )
      pipe.set_outputs(out)
      with assert_raises(RuntimeError, regex=error_msg):
          pipe.build()
          for _ in range(niter):
              pipe.run()
  
file_path: DALI/dali/test/python/operator_2/test_roi_random_crop.py
imports: import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.types
  import random
  from nose_utils import assert_raises
label_desc: Use image node_id 5 for calling a global function with example usage: check_roi_random_crop_error(shape_like_in, in_shape, crop_shape, roi_start, roi_shape, roi_end, error_msg) without return types