Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def check_dependency(name):
    if dependencies[name]['check']:
        return dependencies[name]['is_present']
    else:
        try:
            exec("import %s" % name)
            dependencies[name]['is_present'] = True
        except ImportError:
            warnings.warn(get_import_warning(name), DependencyWarning)
        except RuntimeError, errmsg:
            warnings.warn(get_runtime_warning(name, errmsg), DependencyWarning)
        dependencies[name]['check'] = True
        return dependencies[name]['is_present']
        


src/n/e/NeuroTools-0.2.0/test/test_spikes.py   NeuroTools(Download)
 
import numpy, unittest, os
from NeuroTools.__init__ import check_numpy_version, check_dependency
newnum = check_numpy_version()
 
ENABLE_PLOTS = check_dependency('pylab')

src/n/e/NeuroTools-0.2.0/test/test_analogs.py   NeuroTools(Download)
import os
import unittest
from NeuroTools.__init__ import check_numpy_version, check_dependency
newnum = check_numpy_version()
 
ENABLE_PLOTS = check_dependency('pylab')