code: def test_tidy(args):
      """See if clang-tidy and our regex is working correctly.  There are
      many subtleties we need to be careful.  For instances:
  
          * Is the string re-directed to pipe encoded as UTF-8? or is it
      bytes?
  
          * On Jenkins there's no 'xgboost' directory, are we catching the
      right keywords?
  
          * Should we use re.DOTALL?
  
          * Should we use re.MULTILINE?
  
          Tests here are not thorough, at least we want to guarantee tidy is
          not missing anything on Jenkins.
  
      """
      root_path = os.path.abspath(os.path.curdir)
      tidy_file = os.path.join(root_path, ".clang-tidy")
      test_file_path = os.path.join(
          root_path, "tests", "ci_build", "test_tidy.cc"
      )
  
      with open(tidy_file) as fd:
          tidy_config = fd.read()
          tidy_config = str(tidy_config)
      tidy_config = "-config=" + tidy_config
      if not args.tidy_version:
          tidy = "clang-tidy"
      else:
          tidy = "clang-tidy-" + str(args.tidy_version)
      args = [tidy, tidy_config, test_file_path]
      (proc_code, tidy_status, error_msg, _) = call(args)
      assert proc_code == 0
      assert tidy_status == 1
      print("clang-tidy is working.")
  
imports: import argparse
  import json
  import os
  import re
  import shutil
  import subprocess
  import sys
  from multiprocessing import Pool, cpu_count
  from time import time
  import yaml
label_desc: Use image node_id 2 for calling a global function with example usage: test_tidy(args) without return types