code: def split(
      lst: Iterable[T],
      by: Callable[[T], bool],
  ) -> tuple[list[T], list[T]]:
      """Split a list in two based on a predicate.
  
      Note
      ----
      First element can not contain None
  
      Parameters
      ----------
      lst : Iterable[T]
          The iterator to split
  
      by : Callable[[T], bool]
          The predicate to split it on
  
      Returns
      -------
      (a: list[T], b: list[T])
          a is where the func is True and b is where the func was False.
      """
      a = []
      b = []
      for x in lst:
          if by(x):
              a.append(x)
          else:
              b.append(x)
  
      return a, b
  
file_path: auto-sklearn/autosklearn/util/functional.py
imports: from __future__ import annotations
  from typing import Callable, Hashable, Iterable, Iterator, TypeVar
  from functools import reduce
  from itertools import chain, cycle, islice, tee
label_desc: Use image node_id 3 for calling a global function with example usage: split(lst, by) and returns: a,  b