def test_hdf5_topo_view():
    skip_if_no_h5py()
    import h5py

    # save random data to HDF5
    handle, filename = tempfile.mkstemp()
    dataset = random_one_hot_topological_dense_design_matrix(
        np.random.RandomState(1), num_examples=10, shape=(2, 2), channels=3,
        axes=('b', 0, 1, 'c'), num_classes=3)
    with h5py.File(filename, 'w') as f:
        f.create_dataset('topo_view', data=dataset.get_topological_view())
        f.create_dataset('y', data=dataset.get_targets())

    # instantiate Train object
    trainer = yaml_parse.load(topo_view_yaml % {'filename': filename})
    trainer.main_loop()

    # cleanup
    os.remove(filename)
delete the tmp directory
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/tests/test_hdf5.py/test_hdf5_topo_view--crossover with--dataset/ETHPy150Open linkedin/naarad/test/test_httpdownload.py/delete_tmp_dir