code: def cut(
      itr: Iterable[T],
      where: int | Callable[[T], bool],
  ) -> tuple[list[T], list[T]]:
      """Cut a list in two at a given index or predicate
  
      Parameters
      ----------
      lst : Iterable[T]
          An iterable of items
  
      at : int | Callable[[T], bool]
          Where to split at, either an index or a predicate
  
      Returns
      -------
      tuple[list[T], list[T]]
          The split items
      """
      if isinstance(where, int):
          lst = list(itr)
          return lst[:where], lst[where:]
  
      a = []
      itr2 = iter(itr)
      broke = False
      for x in itr2:
          if not where(x):
              a.append(x)
          else:
              broke = True
              break
  
      if broke:
          return a, [x] + list(itr2)
      else:
          return a, []
  
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 2 for calling a global function with example usage: cut(itr, where) and returns: lst,  lst, a,  unknown, a,  list