def compile_function(code,arg_names,local_dict,global_dict,
                     module_dir,
                     compiler='',
                     verbose=1,
                     support_code=None,
                     headers=[],
                     customize=None,
                     type_converters=None,
                     auto_downcast=1,
                     **kw):
    # figure out where to store and what to name the extension module
    # that will contain the function.
    # storage_dir = catalog.intermediate_dir()
    code = ndarray_api_version + '\n' + code
    module_path = function_catalog.unique_module_name(code, module_dir)
    storage_dir, module_name = os.path.split(module_path)
    mod = inline_ext_module(module_name,compiler)

    # create the function.  This relies on the auto_downcast and
    # type factories setting
    ext_func = inline_ext_function('compiled_func',code,arg_names,
                                   local_dict,global_dict,auto_downcast,
                                   type_converters=type_converters)
    mod.add_function(ext_func)

    # if customize (a custom_info object), then set the module customization.
    if customize:
        mod.customize = customize

    # add the extra "support code" needed by the function to the module.
    if support_code:
        mod.customize.add_support_code(support_code)

    # add the extra headers needed by the function to the module.
    for header in headers:
        mod.customize.add_header(header)

    # it's nice to let the users know when anything gets compiled, as the
    # slowdown is very noticeable.
    if 0 > verbose:
        print('<weave: compiling>')

    # compile code in correct location, with the given compiler and verbosity
    # setting.  All input keywords are passed through to distutils
    mod.compile(location=storage_dir,compiler=compiler,
                verbose=verbose, **kw)

    # import the module and return the function.  Make sure
    # the directory where it lives is in the python path.
    try:
        sys.path.insert(0,storage_dir)
        exec('import ' + module_name)
        func = eval(module_name+'.compiled_func')
    finally:
        del sys.path[0]
    return func
dataset/ETHPy150Open scipy/scipy/scipy/weave/inline_tools.py/compile_function/swapped operands of `>`