code: def process_ifs(lines: Iterable[str], onnx_ml: bool) -> Iterable[str]:
      in_if = 0
      for line in lines:
          if IF_ONNX_ML_REGEX.match(line):
              assert in_if == 0
              in_if = 1
          elif ELSE_ONNX_ML_REGEX.match(line):
              assert in_if == 1
              in_if = 2
          elif ENDIF_ONNX_ML_REGEX.match(line):
              assert in_if == 1 or in_if == 2  # noqa: PLR1714, PLR2004
              in_if = 0
          else:  # noqa: PLR5501
              if in_if == 0:
                  yield line
              elif in_if == 1 and onnx_ml:
                  yield line
              elif in_if == 2 and not onnx_ml:  # noqa: PLR2004
                  yield line
  
file_path: onnx/onnx/gen_proto.py
imports: import argparse
  import glob
  import os
  import re
  import subprocess
  from textwrap import dedent
  from typing import Iterable, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: process_ifs(lines, onnx_ml) without return types