Python 2.7 Counting number of dictionary items with given value,sum(1 for x in list(d.values()) if some_condition(x))