def pick(seq, func, maxobj=None):
maxscore = None<EOL>for obj in seq:<EOL><INDENT>score = func(obj)<EOL>if maxscore is None or maxscore < score:<EOL><INDENT>(maxscore, maxobj) = (score, obj)<EOL><DEDENT><DEDENT>return maxobj<EOL>
Picks the object obj where func(obj) has the highest value.