code: def gen_from_templates(templates, top_path):
      """Generate cython files from a list of templates"""
      # Lazy import because cython is not a runtime dependency.
      from Cython import Tempita
  
      for template in templates:
          outfile = template.replace(".tp", "")
  
          # if the template is not updated, no need to output the cython file
          if not (
              os.path.exists(outfile)
              and os.stat(template).st_mtime < os.stat(outfile).st_mtime
          ):
              with open(template, "r") as f:
                  tmpl = f.read()
  
              tmpl_ = Tempita.sub(tmpl)
  
              with open(outfile, "w") as f:
                  f.write(tmpl_)
  
file_path: pmdarima/pmdarima/_build_utils/__init__.py
imports: from numpy.distutils.system_info import get_info
  from distutils.version import LooseVersion
  import os
  import contextlib
  from .pre_build_helpers import basic_check_build
label_desc: Use image node_id 4 for calling a global function with example usage: gen_from_templates(templates, top_path) without return types