code: def merge_replacement_files(tmpdir, mergefile):
      """Merge all replacement files in a directory into a single file"""
      # The fixes suggested by clang-tidy >= 4.0.0 are given under
      # the top level key 'Diagnostics' in the output yaml files
      mergekey = "Diagnostics"
      merged = []
      for replacefile in glob.iglob(os.path.join(tmpdir, "*.yaml")):
          content = yaml.safe_load(open(replacefile, "r"))
          if not content:
              continue  # Skip empty files.
          merged.extend(content.get(mergekey, []))
  
      if merged:
          # MainSourceFile: The key is required by the definition inside
          # include/clang/Tooling/ReplacementsYaml.h, but the value
          # is actually never used inside clang-apply-replacements,
          # so we set it to '' here.
          output = {"MainSourceFile": "", mergekey: merged}
          with open(mergefile, "w") as out:
              yaml.safe_dump(output, out)
      else:
          # Empty the file:
          open(mergefile, "w").close()
  
file_path: ray/ci/lint/clang-tidy-diff.py
imports: import argparse
  import glob
  import json
  import multiprocessing
  import os
  import re
  import shutil
  import subprocess
  import sys
  import tempfile
  import threading
  import traceback
  import queue
label_desc: Use image node_id 3 for calling a global function with example usage: merge_replacement_files(tmpdir, mergefile) without return types