def package_available(pkg):
    """Test whether a package is available or not

    Parameters
    ----------
    pkg : string
        Name of the package to look for

    Returns
    -------
    pkg_available : bool
        *True* if the package is available, *False* otherwise
    """
    try:
        exec('import %s' % pkg)
    except ImportError:
        return False
    else:
        return True