def _argsort(y_score, k=None):
    """
    Returns the indexes in descending order of the top k score
        or all scores if k is None
    """
    ranks = y_score.argsort()
    argsort = ranks[::-1]
    if k is not None:
        argsort = argsort[0:k]

    return argsort