code: def test_roi_random_crop():
      batch_size = 16
      niter = 3
      for ndim in (2, 3):
          in_shape_min = 250
          in_shape_max = 300
          for (
              roi_start_min,
              roi_start_max,
              roi_extent_min,
              roi_extent_max,
              crop_extent_min,
              crop_extent_max,
          ) in [
              (20, 50, 10, 20, 30, 40),
              (20, 50, 100, 140, 30, 40),
              (0, 1, 10, 20, 80, 100),
          ]:
              yield (
                  check_roi_random_crop,
                  ndim,
                  batch_size,
                  roi_start_min,
                  roi_start_max,
                  roi_extent_min,
                  roi_extent_max,
                  crop_extent_min,
                  crop_extent_max,
                  in_shape_min,
                  in_shape_max,
                  niter,
              )
  
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 4 for calling a global function with example usage: test_roi_random_crop() without return types