def _scores_to_labels(scores, classes):
    """Convert a list of scores into a sorted list of (label,score) for which the score is positive

    If no score is positive, return the largest.

    The returned list is sorted in decreasing order, so the first entry is the class label to be assigned
    in non-multilabel case
    """
    if max(scores) <= 0:
        # return [(classes[numpy.argmax(scores)], max(scores))]  # Return the highest class
        return [("others", 1.0)]  # Return "others" when there is no positive score
    else:
        result = sorted([(classes[idx], value) for idx, value in enumerate(scores) if value > 0],
                        key=lambda x: x[1], reverse=True)  # Return only positive scores
        # result = sorted([(classes[idx], value) for idx, value in enumerate(scores)],
        #                key=lambda x: x[1], reverse=True)  # Return all scores
        return result