def reverse(d):
    """Return a reverse lookup dictionary for the input dictionary"""
    r={}
    for k in d:
        r[d[k]]=k
    return r
def reverse ( d ) : r = { } for k in d : r [ d [ k ] ] = k return r
Return a reverse lookup dictionary for the input dictionary