Python builtins 模块,__NUMPY_SETUP__ 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用builtins.__NUMPY_SETUP__

项目:SlackBuilds    作者:montagdude    | 项目源码 | 文件源码
def include_dirs_hook():
        if sys.version_info[0] >= 3:
            import builtins
            if hasattr(builtins, '__NUMPY_SETUP__'):
                del builtins.__NUMPY_SETUP__
            import imp
            import numpy
            imp.reload(numpy)
        else:
            import __builtin__
            if hasattr(__builtin__, '__NUMPY_SETUP__'):
                del __builtin__.__NUMPY_SETUP__
            import numpy
            reload(numpy)

        ext = Extension('test', [])
        ext.include_dirs.append(numpy.get_include())
        if not has_include_file(
                ext.include_dirs, os.path.join("numpy", "arrayobject.h")):
            warnings.warn(
                "The C headers for numpy could not be found. "
                "You may need to install the development package")

        return [numpy.get_include()]
项目:radar    作者:amoose136    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:krpcScripts    作者:jwvanderbeck    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:numpythia    作者:scikit-hep    | 项目源码 | 文件源码
def finalize_options(self):
        global libnumpythia
        #global external_fastjet
        _build_ext.finalize_options(self)
        # Prevent numpy from thinking it is still in its setup process
        try:
            del builtins.__NUMPY_SETUP__
        except AttributeError:
            pass
        import numpy
        libnumpythia.include_dirs.append(numpy.get_include())
项目:PyDataLondon29-EmbarrassinglyParallelDAWithAWSLambda    作者:SignalMedia    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:aws-lambda-numpy    作者:vitolimandibhrata    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:lambda-numba    作者:rlhotovy    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:deliver    作者:orchestor    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################
项目:Alfred    作者:jkachhadia    | 项目源码 | 文件源码
def is_bootstrapping():
    if sys.version_info[0] >= 3:
        import builtins
    else:
        import __builtin__ as builtins

    try:
        builtins.__NUMPY_SETUP__
        return True
    except AttributeError:
        return False
        __NUMPY_SETUP__ = False


#########################