def argmaxIndexWithTies(l, f = lambda x: x):
    """
    @param l: C{List} of items
    @param f: C{Procedure} that maps an item into a numeric score
    @returns: the index of C{l} that has the highest score
    """
    best = []; bestScore = f(l[0])
    for i in range(len(l)):
        xScore = f(l[i])
        if xScore > bestScore:
            best, bestScore = [i], xScore
        elif xScore == bestScore:
            best, bestScore = best + [i], xScore
    return (best, bestScore)
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/argmaxIndexWithTies/original