code: def _external_stacklevel(internal: list[str]) -> int:
      """Find the stacklevel of the first frame that doesn't contain any of the given internal strings
  
      The depth will be 1 at minimum in order to start checking at the caller of
      the function that called this utility method.
      """
      # Get the level of my caller's caller
      level = 2
      frame = _get_frame(level)
  
      # Normalize the path separators:
      normalized_internal = [str(Path(s)) for s in internal]
  
      # climb the stack frames while we see internal frames
      while frame and any(
          s in str(Path(frame.f_code.co_filename))
          for s in normalized_internal
      ):
          level += 1
          frame = frame.f_back
  
      # Return the stack level from the perspective of whoever called us (i.e., one level up)
      return level - 1
  
imports: from __future__ import annotations
  import asyncio
  import atexit
  import errno
  import inspect
  import sys
  import threading
  import warnings
  from pathlib import Path
  from types import FrameType
  from typing import Any, Awaitable, Callable, TypeVar, cast
label_desc: Use image node_id 3 for calling a global function with example usage: _external_stacklevel(internal) and returns: unknown