code: def test_assert(func_type: str):
      os.environ["TRITON_DEBUG"] = "1"
      proc = subprocess.Popen(
          [sys.executable, assert_path, func_type],
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=False,
      )
      _, errs = proc.communicate()
      errs = errs.splitlines()
      num_errs = 0
      for err in errs:
          if "x != 0" in err.decode("utf-8"):
              num_errs += 1
  
      # Check for segfaults.
      assert all(
          "segmentation fault" not in line.decode("utf-8").lower()
          for line in errs
      )
  
      os.environ["TRITON_DEBUG"] = "0"
      if (
          func_type == "static_assert"
          or func_type == "device_assert_passes"
      ):
          assert num_errs == 0
      else:
          assert num_errs == 127
  
file_path: triton/python/test/unit/language/test_subprocess.py
imports: import itertools
  import os
  import subprocess
  import sys
  from collections import Counter
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_assert(func_type) without return types