code: def _check_all(cmd, filenames, ignore_checks):
      # 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()
      error = False
      try:
          cnt_error = 0
          cnt_warning = 0
          cnt_ignore = 0
          # 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)))
                  # ignore thirdparty header file not found issue, such as:
                  #   error: 'fiu.h' file not found [clang-diagnostic-error]
                  cnt_info = ""
                  for line in stdout.splitlines():
                      if any(
                          [
                              len(re.findall(check, line)) > 0
                              for check in ignore_checks
                          ]
                      ):
                          cnt_info += (
                              line.replace(
                                  " error: ", " ignore: "
                              ).decode("utf-8")
                              + "\n"
                          )
                      else:
                          cnt_info += line.decode("utf-8") + "\n"
                  cnt_error += _count_key(cnt_info, " error: ")
                  cnt_warning += _count_key(cnt_info, " warning: ")
                  cnt_ignore += _count_key(cnt_info, " ignore: ")
                  print(cnt_info)
                  print(
                      "clang-tidy - error: {}, warning: {}, ignore {}".format(
                          cnt_error, cnt_warning, cnt_ignore
                      )
                  )
                  error = error or (cnt_error > 0 or cnt_warning > 0)
      except Exception:
          error = True
          raise
      finally:
          pool.terminate()
          pool.join()
  
      if error:
          sys.exit(1)
  
file_path: milvus/internal/core/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
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: _check_all(cmd, filenames, ignore_checks) without return types