code: def exactly_n(iterable, n, predicate=bool):
      
      return len(take(n + 1, filter(predicate, iterable))) == n
docs: Return ``True`` if exactly ``n`` items in the iterable are ``True``
      according to the *predicate* function.
  
          >>> exactly_n([True, True, False], 2)
          True
          >>> exactly_n([True, True, False], 1)
          False
          >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
          True
  
      The iterable will be advanced until ``n + 1`` truthy items are encountered,
      so avoid calling it on infinite iterables.