code: def binary_search(
      arr: _SequenceLike[T_Co], predicate: Callable[[T_Co], bool]
  ) -> int:
      """Returns minimum index of arr item which satisfies  `predicate`."""
      if not arr or predicate(arr[0]):
          return 0
      left: int = 0
      right = len(arr)
      while right - left > 1:
          m = (right + left) // 2
          if predicate(arr[m]):
              right = m
          else:
              left = m
      return right
  
file_path: camphr/packages/camphr/camphr/utils.py
imports: from camphr.doc import DocProto, T_Ent, T_Token
  from typing import Callable, Optional, TypeVar
  from typing_extensions import Protocol
label_desc: Use image node_id 1 for calling a global function with example usage: binary_search(arr, predicate) and returns: right, int