code: def clang_formatter(output):
      """Process iwyu's output into something clang-like."""
      state = (GENERAL, None)
      for line in output:
          match = CORRECT_RE.match(line)
          if match:
              print(
                  "%s:1:1: note: #includes/fwd-decls are correct",
                  match.groups(1),
              )
              continue
          match = SHOULD_ADD_RE.match(line)
          if match:
              state = (ADD, match.group(1))
              continue
          match = SHOULD_REMOVE_RE.match(line)
          if match:
              state = (REMOVE, match.group(1))
              continue
          match = FULL_LIST_RE.match(line)
          if match:
              state = (LIST, match.group(1))
          elif END_RE.match(line):
              state = (GENERAL, None)
          elif not line.strip():
              continue
          elif state[0] == GENERAL:
              print(line)
          elif state[0] == ADD:
              print("%s:1:1: error: add the following line", state[1])
              print(line)
          elif state[0] == REMOVE:
              match = LINES_RE.match(line)
              line_no = match.group(2) if match else "1"
              print(
                  "%s:%s:1: error: remove the following line",
                  state[1],
                  line_no,
              )
              print(match.group(1))
  
file_path: arrow/cpp/build-support/iwyu/iwyu_tool.py
imports: import os
  import sys
  import json
  import argparse
  import subprocess
  import re
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: clang_formatter(output) without return types