code: def get_regions(in_shape, axes, arg_anchor, arg_shape):
      assert len(arg_shape) % len(axes) == 0
      nregions = int(len(arg_shape) / len(axes))
      region_length = int(len(arg_shape) / nregions)
      starts = []
      ends = []
      for region_idx in range(nregions):
          start_i = [0] * len(in_shape)
          end_i = list(in_shape)
          for k in range(region_length):
              axis = axes[k]
              anchor_val = arg_anchor[region_idx * region_length + k]
              shape_val = arg_shape[region_idx * region_length + k]
              end_val = anchor_val + shape_val
              start_i[axis] = anchor_val
              end_i[axis] = end_val
          starts.append(start_i)
          ends.append(end_i)
      return (starts, ends)
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import numpy
  from functools import partial
  from test_utils import compare_pipelines
  from test_utils import RandomDataIterator
label_desc: Use image node_id 2 for calling a global function with example usage: get_regions(in_shape, axes, arg_anchor, arg_shape) and returns: starts,  ends