code: def count_if(predicate, seq):
      
      f = lambda count, x: count + (not not predicate(x))
      return reduce(f, seq, 0)
docs: Count the number of elements of seq for which the predicate is true.
      >>> count_if(callable, [42, None, max, min])
      2