code: def clip_boxes_to_image(boxes, height, width):
      """
      Clip the boxes with the height and width of the image size.
      Args:
          boxes (ndarray): bounding boxes to peform crop. The dimension is
          `num boxes` x 4.
          height (int): the height of the image.
          width (int): the width of the image.
      Returns:
          boxes (ndarray): cropped bounding boxes.
      """
      boxes[:, [0, 2]] = np.minimum(
          width - 1.0, np.maximum(0.0, boxes[:, [0, 2]])
      )
      boxes[:, [1, 3]] = np.minimum(
          height - 1.0, np.maximum(0.0, boxes[:, [1, 3]])
      )
      return boxes
  
imports: import math
  import numpy
  import cv2
label_desc: Use image node_id 1 for calling a global function with example usage: clip_boxes_to_image(boxes, height, width) and returns: boxes