code: def find_matching_paren(s: str, startpos: int) -> int:
      """Given a string "prefix (unknown number of characters) suffix"
      and the position of the first `(` returns the index of the character
      1 past the `)`, accounting for paren nesting
      """
      opening = 0
      for i, c in enumerate(s[startpos:]):
          if c == "(":
              opening += 1
          elif c == ")":
              opening -= 1
              if opening == 0:
                  return startpos + i + 1
  
      raise IndexError("Closing parens not found!")
  
file_path: pytorch/torch/testing/_internal/check_kernel_launches.py
imports: import os
  import re
  import sys
  from typing import List
label_desc: Use image node_id 1 for calling a global function with example usage: find_matching_paren(s, startpos) and returns: unknown