def pick(seq, func, maxobj=None):
 maxscore = None
 for obj in seq:
  score = func(obj)
  if ((maxscore is None) or (maxscore < score)):
   (maxscore, maxobj) = (score, obj)
 return maxobj

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