code: def filter_by_centroid(crop_anchor, crop_shape, bboxes):
      ndim = len(crop_shape)
      nboxes = bboxes.shape[0]
      indexes = []
      for i in range(nboxes):
          bbox = bboxes[i]
          centroid = [
              0.5 * (bbox[d] + bbox[ndim + d]) for d in range(ndim)
          ]
          if crop_contains(crop_anchor, crop_shape, centroid):
              indexes.append(i)
          filtered_boxes = np.array(bboxes[indexes, :])
      return filtered_boxes
  
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 2 for calling a global function with example usage: filter_by_centroid(crop_anchor, crop_shape, bboxes) and returns: filtered_boxes