<s> import os <EOL> import h5py <EOL> import numpy <EOL> from numpy . testing import assert_equal <EOL> from fuel import config <EOL> from fuel . datasets import H5PYDataset , SVHN <EOL> def test_svhn ( ) : <EOL> data_path = config . data_path <EOL> try : <EOL> config . data_path = '<STR_LIT:.>' <EOL> f = h5py . File ( '<STR_LIT>' , '<STR_LIT:w>' ) <EOL> f [ '<STR_LIT>' ] = numpy . arange ( <NUM_LIT:100> , dtype = '<STR_LIT>' ) . reshape ( ( <NUM_LIT:10> , <NUM_LIT:10> ) ) <EOL> f [ '<STR_LIT>' ] = numpy . arange ( <NUM_LIT:10> , dtype = '<STR_LIT>' ) . reshape ( ( <NUM_LIT:10> , <NUM_LIT:1> ) ) <EOL> split_dict = { '<STR_LIT:train>' : { '<STR_LIT>' : ( <NUM_LIT:0> , <NUM_LIT:8> ) , '<STR_LIT>' : ( <NUM_LIT:0> , <NUM_LIT:8> ) } , <EOL> '<STR_LIT:test>' : { '<STR_LIT>' : ( <NUM_LIT:8> , <NUM_LIT:10> ) , '<STR_LIT>' : ( <NUM_LIT:8> , <NUM_LIT:10> ) } } <EOL> f . attrs [ '<STR_LIT>' ] = H5PYDataset . create_split_array ( split_dict ) <EOL> f . close ( ) <EOL> dataset = SVHN ( which_format = <NUM_LIT:2> , which_sets = ( '<STR_LIT:train>' , ) ) <EOL> assert_equal ( dataset . filename , '<STR_LIT>' ) <EOL> finally : <EOL> config . data_path = data_path <EOL> os . remove ( '<STR_LIT>' ) </s>
