def get_numpy(required=True):
    """Tries to import numpy.

    If `required` is False, don't ask again if the user already declined;
    return None if numpy is not available.
    If `required` is True, do ask to install, and raise ImportError if numpy
    can't be set up.
    """
    global _numpy

    if _numpy is False:
        try:
            _numpy = py_import(
                    'numpy', {
                        'pip': 'numpy',
                        'linux-debian': 'python-numpy',
                        'linux-ubuntu': 'python-numpy',
                        'linux-fedora': 'numpy'},
                    store_in_config=not required)
        except __HOLE__:
            _numpy = None
    if _numpy is None and required:
        raise ImportError("No module named numpy")
    return _numpy
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/tabledata/common.py/get_numpy