def quantify(iterable, pred=bool):
 return sum(imap(pred, iterable))

def quantify ( iterable , pred = bool ) : return sum ( imap ( pred , iterable ) )
quantify -> int count how many times the predicate pred is :const:true .