def normalize(smallisbetter,score):
    vsmall=0.00001
    if smallisbetter:
        minscore=max(vsmall,min(score.values()))
        return dict([(u,float(minscore)/max(vsmall,l)) for (u,l) in score.items()])
    else:
        maxscore=max(score.values())
        if maxscore==0:maxscore=vsmall
        return dict([(u,float(c)/maxscore) for (u,c) in score.items()])
00750bbb244912064f3c0de9b030102b901318ea
<mask token>

def normalize(smallisbetter, score):
    vsmall = 1e-05
    if smallisbetter:
        minscore = max(vsmall, min(score.values()))
        return dict([(u, float(minscore) / max(vsmall, l)) for u, l in
            score.items()])
    else:
        maxscore = max(score.values())
        if maxscore == 0:
            maxscore = vsmall
        return dict([(u, float(c) / maxscore) for u, c in score.items()])

def normalize(smallisbetter,score):
    vsmall=0.00001
    if smallisbetter:
        minscore=max(vsmall,min(score.values()))
        return dict([(u,float(minscore)/max(vsmall,l)) for (u,l) in score.items()])
    else:
        maxscore=max(score.values())
        if maxscore==0:maxscore=vsmall
        return dict([(u,float(c)/maxscore) for (u,c) in score.items()])