code: def test_print(func_type: str, data_type: str):
      proc = subprocess.Popen(
          [sys.executable, print_path, func_type, data_type],
          stdout=subprocess.PIPE,
          shell=False,
      )
      outs, _ = proc.communicate()
      outs = [line for line in outs.decode("UTF-8").split("\n") if line]
  
      # Format is
      #   pid (<x>, <y>, <z>) idx (<i1>, <i2>, ...) <prefix> (operand <n>) <elem>
      expected_lines = Counter()
      if func_type == "print" or func_type == "device_print":
          for i in range(128):
              line = f"pid (0, 0, 0) idx ({i:3}) x: {i}"
              if data_type.startswith("float"):
                  line += ".000000"
              expected_lines[line] = 1
      elif func_type == "static_print":
          expected_lines[" int32[constexpr[128]]"] = 1
      elif func_type == "no_arg_print":
          expected_lines["pid (0, 0, 0) idx (): 0"] = 128
      elif func_type == "print_no_arg":
          expected_lines["pid (0, 0, 0) no arg"] = 128
      elif func_type == "device_print_large":
          for i, j, k in itertools.product(
              range(2), range(64), range(128)
          ):
              expected_lines[
                  f"pid (0, {i}, 0) idx ({j:2}, {k:3}) x: 1"
              ] = 1
      elif (
          func_type == "print_multiple_args"
          or func_type == "device_print_multiple_args"
      ):
          for i in range(128):
              expected_lines[
                  f"pid (0, 0, 0) idx ({i:3}): (operand 0) {i}"
              ] = 1
              expected_lines[
                  f"pid (0, 0, 0) idx ({i:3}): (operand 1) 1"
              ] = 1
  
      actual_lines = Counter()
      for line in outs:
          actual_lines[line] += 1
  
      diff = Counter(actual_lines)
      diff.subtract(expected_lines)
      for line, delta in diff.items():
          if delta == 0:
              continue
          print(
              f'Expected line "{line}" {expected_lines[line]} time(s), but saw {actual_lines[line]} time(s)'
          )
      assert all(delta == 0 for delta in diff.values())
  
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 1 for calling a global function with example usage: test_print(func_type, data_type) without return types