code: def compile(tmpdir, ext, compiler_verbose=0, debug=None):
      """Compile a C extension module using distutils."""
  
      _hack_at_distutils()
      saved_environ = os.environ.copy()
      try:
          outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
          outputfilename = os.path.abspath(outputfilename)
      finally:
          # workaround for a distutils bugs where some env vars can
          # become longer and longer every time it is used
          for key, value in saved_environ.items():
              if os.environ.get(key) != value:
                  os.environ[key] = value
      return outputfilename
  
file_path: catboost/contrib/python/cffi/py2/cffi/ffiplatform.py
imports: import sys, os
  from .error import VerificationError
label_desc: Use image node_id 2 for calling a global function with example usage: compile(tmpdir, ext, compiler_verbose, debug) and returns: outputfilename