code: def transform_chip_box(gt_bbox: "Gx4", boxes_idx: "B", chip: "4"):
      boxes_idx = np.array(boxes_idx)
      cur_gt_bbox = gt_bbox[boxes_idx].copy()  # Bx4
      x1, y1, x2, y2 = chip
      cur_gt_bbox[:, 0] -= x1
      cur_gt_bbox[:, 1] -= y1
      cur_gt_bbox[:, 2] -= x1
      cur_gt_bbox[:, 3] -= y1
      h = y2 - y1
      w = x2 - x1
      cur_gt_bbox = clip_boxes(cur_gt_bbox, (h, w))
      ws = (cur_gt_bbox[:, 2] - cur_gt_bbox[:, 0]).astype(np.int32)
      hs = (cur_gt_bbox[:, 3] - cur_gt_bbox[:, 1]).astype(np.int32)
      valid_idx = (ws >= 2) & (hs >= 2)
      return cur_gt_bbox[valid_idx], boxes_idx[valid_idx]
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: transform_chip_box(gt_bbox, boxes_idx, chip) and returns: cur_gt_bbox,  boxes_idx