code: def cythonize(cython_file, gen_file):
      try:
          from Cython.Compiler.Version import version as cython_version
          from distutils.version import LooseVersion
  
          if LooseVersion(cython_version) < LooseVersion("0.21"):
              raise Exception(
                  "Building scikit-learn requires Cython >= 0.21"
              )
  
      except ImportError:
          pass
  
      flags = ["--fast-fail"]
      if gen_file.endswith(".cpp"):
          flags += ["--cplus"]
  
      try:
          try:
              rc = subprocess.call(
                  ["cython"] + flags + ["-o", gen_file, cython_file]
              )
              if rc != 0:
                  raise Exception("Cythonizing %s failed" % cython_file)
          except OSError:
              # There are ways of installing Cython that don't result in a cython
              # executable on the path, see scipy issue gh-2397.
              rc = subprocess.call(
                  [
                      sys.executable,
                      "-c",
                      "import sys; from Cython.Compiler.Main "
                      "import setuptools_main as main;"
                      " sys.exit(main())",
                  ]
                  + flags
                  + ["-o", gen_file, cython_file]
              )
              if rc != 0:
                  raise Exception("Cythonizing %s failed" % cython_file)
      except OSError:
          raise OSError("Cython needs to be installed")
  
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 1 for calling a global function with example usage: cythonize(cython_file, gen_file) without return types