code: def check_crop_dims_variable_size(
      anchor, shape, scaling, aspect_ratio
  ):
      ndim = len(shape)
      k = 0
      nranges = len(aspect_ratio) / 2
  
      max_extent = 0.0
      for d in range(ndim):
          max_extent = shape[d] if shape[d] > max_extent else max_extent
      assert max_extent >= scaling[0] or np.isclose(
          max_extent, scaling[0]
      )
      assert max_extent <= scaling[1] or np.isclose(
          max_extent, scaling[1]
      )
      for d in range(ndim):
          assert anchor[d] >= 0.0 and anchor[d] <= 1.0, anchor
          assert (
              anchor[d] + shape[d] > 0.0 and anchor[d] + shape[d] <= 1.0
          )
  
          for d2 in range(d + 1, ndim):
              ar = shape[d] / shape[d2]
              ar_min = aspect_ratio[k * 2]
              ar_max = aspect_ratio[k * 2 + 1]
              if ar_min == ar_max:
                  assert np.isclose(
                      ar, ar_min
                  ), "ar {}/{} = {} is not close to ar_min={}".format(
                      d, d2, ar, ar_min
                  )
              else:
                  assert (
                      ar >= aspect_ratio[k * 2]
                      and ar <= aspect_ratio[k * 2 + 1]
                  )
              k = int((k + 1) % nranges)
  
imports: from nvidia.dali.pipeline import Pipeline
  from nvidia.dali import pipeline_def
  import nvidia.dali.ops
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  import random
label_desc: Use image node_id 5 for calling a global function with example usage: check_crop_dims_variable_size(anchor, shape, scaling, aspect_ratio) without return types