code: def _check_all(cmd, filenames):
      # each clang-tidy instance will process 16 files
      chunks = lintutils.chunk(filenames, 16)
      cmds = [cmd + some for some in chunks]
      results = lintutils.run_parallel(cmds, stderr=PIPE, stdout=PIPE)
      error = False
      # record completed processes (keyed by the first filename in the input
      # chunk) for lookup in _check_some_files
      completed_processes = {
          _get_chunk_key(some): result
          for some, result in zip(chunks, results)
      }
      checker = partial(_check_some_files, completed_processes)
      pool = mp.Pool()
      try:
          # check output of completed clang-tidy invocations in parallel
          for problem_files, stdout in pool.imap(checker, chunks):
              if problem_files:
                  msg = "clang-tidy suggested fixes for {}"
                  print("\n".join(map(msg.format, problem_files)))
                  error = True
      except Exception:
          error = True
          raise
      finally:
          pool.terminate()
          pool.join()
  
      if error:
          sys.exit(1)
  
file_path: arrow/cpp/build-support/run_clang_tidy.py
imports: from __future__ import print_function
  import argparse
  import multiprocessing
  import lintutils
  from subprocess import PIPE
  import sys
  from functools import partial
label_desc: Use image node_id 3 for calling a global function with example usage: _check_all(cmd, filenames) without return types