def METHOD_NAME(boxes: np.ndarray) -> np.ndarray:
  """Sort boxes according the confidence in descending order.
    It is using merge sort to agree with COCO metrics.
  Args:
   boxes: a numpy array representing the bounding boxes in the following format
     [LEFT, TOP, RIGHT, BOTTOM, CLASS, CONFIDENCE]
  Returns:
   sorted_boxes: the sorted list of bounding boxes
  """
  if boxes.ndim != 2:
    raise ValueError(f'Input boxes list should be a 2d array of shape '
                     f'( <batch_size>, {CONFIDENCE}+)')
  if boxes.shape[1] <= CONFIDENCE:
    warnings.warn('The axis for sort does not exist, return the original data')
    return boxes
  inds = np.argsort(-boxes[:, CONFIDENCE], kind='mergesort')
  return boxes[inds]