def _keep_topk(boxes_xyxy: Union[ndarray, FloatTensor], k: int = 10) -> Union[ndarray, FloatTensor]:
    """keeps first k elements

    Args:
        boxes_xyxy (Union[ndarray, FloatTensor]): list of boxes
        k (int, optional): the umber to keep. Defaults to 10.

    Returns:
        Union[ndarray, FloatTensor]: _description_
    """
    if k == 0:
        return []

    if len(boxes_xyxy) <= k:
        return boxes_xyxy

    return boxes_xyxy[:k]
keeps first k elements

    Args:
        boxes_xyxy (Union[ndarray, FloatTensor]): list of boxes
        k (int, optional): the umber to keep. Defaults to 10.

    Returns:
        Union[ndarray, FloatTensor]: _description_
    
src/marqo/s2_inference/processing/image_utils.py