code: def partition(pred, iterable):
      """
      Returns a 2-tuple of iterables derived from the input iterable.
      The first yields the items that have ``pred(item) == False``.
      The second yields the items that have ``pred(item) == True``.
  
          >>> is_odd = lambda x: x % 2 != 0
          >>> iterable = range(10)
          >>> even_items, odd_items = partition(is_odd, iterable)
          >>> list(even_items), list(odd_items)
          ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])
  
      If *pred* is None, :func:`bool` is used.
  
          >>> iterable = [0, 1, False, True, '', ' ']
          >>> false_items, true_items = partition(None, iterable)
          >>> list(false_items), list(true_items)
          ([0, False, ''], [1, True, ' '])
  
      """
      if pred is None:
          pred = bool
  
      t1, t2, p = tee(iterable, 3)
      p1, p2 = tee(map(pred, p))
      return (compress(t1, map(operator.not_, p1)), compress(t2, p2))
  
imports: import math
  import operator
  from collections import deque
  from collections.abc import Sized
  from functools import partial, reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
label_desc: Use image node_id 18 for calling a global function with example usage: partition(pred, iterable) and returns: compress,  compress