code: def clip_boxes(boxes, im_shape):
      """
      Clip boxes to image boundaries.
      """
  
      # x1 >= 0
      boxes[:, 0::4] = np.maximum(
          np.minimum(boxes[:, 0::4], im_shape[1] - 1), 0
      )
      # y1 >= 0
      boxes[:, 1::4] = np.maximum(
          np.minimum(boxes[:, 1::4], im_shape[0] - 1), 0
      )
      # x2 < im_shape[1]
      boxes[:, 2::4] = np.maximum(
          np.minimum(boxes[:, 2::4], im_shape[1] - 1), 0
      )
      # y2 < im_shape[0]
      boxes[:, 3::4] = np.maximum(
          np.minimum(boxes[:, 3::4], im_shape[0] - 1), 0
      )
      return boxes
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: clip_boxes(boxes, im_shape) and returns: boxes