code: def findwhere(
      itr: Iterable[T], func: Callable[[T], bool], *, default: int = -1
  ) -> int:
      """Find the index of the next occurence where func is True.
  
      Parameters
      ----------
      itr : Iterable[T]
          The iterable to search over
  
      func : Callable[[T], bool]
          The function to use
  
      default : int = -1
          The default value to give if no value was found where func was True
  
      Returns
      -------
      int
          The first index where func was True
      """
      return next((i for i, t in enumerate(itr) if func(t)), default)
  
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 5 for calling a global function with example usage: findwhere(itr, func) and returns: next