Did I find the right examples for you? yes no

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

src/s/c/scikit-learn-0.14.1/sklearn/datasets/tests/test_mldata.py   scikit-learn(Download)
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.testing import mock_mldata_urlopen
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises
def test_download():
    """Test that fetch_mldata is able to download and cache a data set."""
 
    _urlopen_ref = datasets.mldata.urlopen
    datasets.mldata.urlopen = mock_mldata_urlopen({
        # create fake data set in cache
        x = sp.arange(6).reshape(2, 3)
        datasets.mldata.urlopen = mock_mldata_urlopen({dataname: {'x': x}})
 
        dset = fetch_mldata(dataname, data_home=tmpdir)
        # by default
        dataname = 'threecol-default'
        datasets.mldata.urlopen = mock_mldata_urlopen({
            dataname: (
                {
        # by order
        dataname = 'threecol-order'
        datasets.mldata.urlopen = mock_mldata_urlopen({
            dataname: ({'y': y, 'x': x, 'z': z},
                       ['y', 'x', 'z']), })