def read_hdf5(fname, title='h5io'):
    """Read python object from HDF5 format using h5py

    Parameters
    ----------
    fname : str
        File to load.
    title : str
        The top-level directory name to use. Typically it is useful to make
        this your package name, e.g. ``'mnepython'``.

    Returns
    -------
    data : object
        The loaded data. Can be of any type supported by ``write_hdf5``.
    """
    h5py = _check_h5py()
    if not op.isfile(fname):
        raise IOError('file "%s" not found' % fname)
    if not isinstance(title, string_types):
        raise ValueError('title must be a string')
    with h5py.File(fname, mode='r') as fid:
        if title not in fid.keys():
            raise ValueError('no "%s" data found' % title)
        data = _triage_read(fid[title])
    return data
dataset/ETHPy150Open mne-tools/mne-python/mne/externals/h5io/_h5io.py/read_hdf5/original