parameters: (boxes, im_shape)
return_statement: return boxes
docstring: Clip boxes to image boundaries.
      :param boxes: [N, 4* num_classes]
      :param im_shape: tuple of 2
      :return: [N, 4* num_classes]
docstring_summary: Clip boxes to image boundaries.
      :param boxes: [N, 4* num_classes]
      :param im_shape: tuple of 2
      :return: [N, 4* num_classes]
docstring_tokens: Clip boxes to image boundaries . : param boxes : [ N 4 * num_classes ] : param im_shape : tuple of 2 : return : [ N 4 * num_classes ]
function: def clip_boxes(boxes, im_shape):
      """
      Clip boxes to image boundaries.
      :param boxes: [N, 4* num_classes]
      :param im_shape: tuple of 2
      :return: [N, 4* num_classes]
      """
      # 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
function_tokens: def clip_boxes ( boxes , im_shape ) : # 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