code: def token_from_char_pos(
      doc: DocProto[T_Token, T_Ent], i: int
  ) -> Optional[T_Token]:
      idx = binary_search(doc, lambda token: token.end_char > i)
      if idx < len(doc):
          token = doc[idx]
          if token.start_char <= i < token.end_char:
              return token
          else:
              return None
      return None
  
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 2 for calling a global function with example usage: token_from_char_pos(doc, i) and returns: None, token, None