code: def check_and_cythonize(root_dir):
      print(root_dir)
      hashes = load_hashes(HASH_FILE)
  
      for cur_dir, dirs, files in os.walk(root_dir):
          for filename in files:
              if filename.endswith(".pyx"):
                  gen_file_ext = ".c"
                  # Cython files with libcpp imports should be compiled to cpp
                  with open(os.path.join(cur_dir, filename), "rb") as f:
                      data = f.read()
                      m = re.search(b"libcpp", data, re.I | re.M)
                      if m:
                          gen_file_ext = ".cpp"
                  cython_file = filename
                  gen_file = filename.replace(".pyx", gen_file_ext)
                  cythonize_if_unchanged(
                      cur_dir, cython_file, gen_file, hashes
                  )
  
                  # Save hashes once per module. This prevents cythonizing prev.
                  # files again when debugging broken code in a single file
                  save_hashes(hashes, HASH_FILE)
  
file_path: pyflux/tools/cythonize.py
imports: from __future__ import division, print_function, absolute_import
  import os
  import re
  import sys
  import hashlib
  import subprocess
label_desc: Use image node_id 8 for calling a global function with example usage: check_and_cythonize(root_dir) without return types