code: def run_clang_format(src, dst, exe, verbose):
      dstdir = os.path.dirname(dst)
      if not os.path.exists(dstdir):
          os.makedirs(dstdir)
      # run the clang format command itself
      if src == dst:
          cmd = "%s -i %s" % (exe, src)
      else:
          cmd = "%s %s > %s" % (exe, src, dst)
      try:
          subprocess.check_call(cmd, shell=True)
      except subprocess.CalledProcessError:
          print(
              "Failed to run clang-format! Maybe your env is not proper?"
          )
          raise
      # run the diff to check if there are any formatting issues
      cmd = "diff -q %s %s >/dev/null" % (src, dst)
      try:
          subprocess.check_call(cmd, shell=True)
          if verbose:
              print("%s passed" % os.path.basename(src))
      except subprocess.CalledProcessError:
          print(
              "%s failed! 'diff %s %s' will show formatting violations!"
              % (os.path.basename(src), src, dst)
          )
          return False
      return True
  
file_path: cuspatial/cpp/scripts/run-clang-format.py
imports: from __future__ import print_function
  import sys
  import re
  import os
  import subprocess
  import argparse
  import tempfile
label_desc: Use image node_id 3 for calling a global function with example usage: run_clang_format(src, dst, exe, verbose) and returns: True, False