<s> import numpy , h5py <EOL> from prototype . hdf . hdf_codec import HDFEncoder , HDFDecoder <EOL> array1 = numpy . ones ( ( <NUM_LIT:4> , <NUM_LIT:5> ) ) <EOL> array2 = numpy . ones ( ( <NUM_LIT:2> , <NUM_LIT:3> ) ) <EOL> array3 = numpy . ones ( ( <NUM_LIT:10> , <NUM_LIT:2> ) ) <EOL> dataset_name1 = '<STR_LIT>' <EOL> dataset_name2 = '<STR_LIT>' <EOL> dname = '<STR_LIT>' <EOL> hdfencoder = HDFEncoder ( ) <EOL> hdfencoder . add_hdf_dataset ( dataset_name1 , array1 ) <EOL> hdfencoder . add_hdf_dataset ( dataset_name2 , array2 ) <EOL> hdfstring1 = hdfencoder . encoder_close ( ) <EOL> hdfencoder = HDFEncoder ( '<STR_LIT>' ) <EOL> hdfencoder . add_hdf_dataset ( dataset_name1 , array1 ) <EOL> hdfencoder . add_hdf_dataset ( dataset_name2 , array2 ) <EOL> hdfstring2 = hdfencoder . encoder_close ( ) <EOL> hdfencoder = HDFEncoder ( '<STR_LIT>' ) <EOL> hdfencoder . add_hdf_dataset ( dname , array3 ) <EOL> hdfstring3 = hdfencoder . encoder_close ( ) <EOL> print ( '<STR_LIT>' % dataset_name2 ) <EOL> hdfdecoder = HDFDecoder ( hdfstring1 ) <EOL> print hdfdecoder . read_hdf_dataset ( dataset_name2 ) <EOL> print ( '<STR_LIT>' % dataset_name1 ) <EOL> hdfdecoder = HDFDecoder ( hdfstring2 ) <EOL> print hdfdecoder . read_hdf_dataset ( dataset_name1 ) <EOL> hdfdecoder = HDFDecoder ( hdfstring3 ) <EOL> print ( '<STR_LIT>' % dataset_name1 ) <EOL> print hdfdecoder . read_hdf_dataset ( dataset_name1 ) <EOL> hdfdecoder = HDFDecoder ( hdfstring3 ) <EOL> print ( "<STR_LIT>" % dataset_name2 ) <EOL> print hdfdecoder . read_hdf_dataset ( dataset_name2 ) <EOL> hdfdecoder = HDFDecoder ( hdfstring3 ) <EOL> print ( "<STR_LIT>" % dname ) <EOL> print hdfdecoder . read_hdf_dataset ( dname ) </s>
