def MapKeyToServer(mapping, key):
 hsh = int(hashlib.sha1(key).hexdigest()[:16], 16)
 return _FindServerInMapping(mapping, hsh)

def MapKeyToServer ( mapping , key ) : hsh = int ( hashlib . sha1 ( key ) . hexdigest ( ) [ : 16 ] , 16 ) return _FindServerInMapping ( mapping , hsh )
takes some key and returns the id of the server .