code: def emit_to(
      out: CWriter, tkn_iter: Iterator[Token], end: str
  ) -> None:
      parens = 0
      for tkn in tkn_iter:
          if tkn.kind == end and parens == 0:
              return
          if tkn.kind == "LPAREN":
              parens += 1
          if tkn.kind == "RPAREN":
              parens -= 1
          out.emit(tkn)
  
file_path: cpython/Tools/cases_generator/generators_common.py
imports: from pathlib import Path
  from typing import TextIO
  from analyzer import Instruction, Uop, analyze_files, Properties, Skip
  from cwriter import CWriter
  from typing import Callable, Mapping, TextIO, Iterator
  from lexer import Token
  from stack import StackOffset, Stack
label_desc: Use image node_id 3 for calling a global function with example usage: emit_to(out, tkn_iter, end) without return types