def open_hdf5(filename, mode='<STR_LIT:r>'):
if isinstance(filename, (h5py.Group, h5py.Dataset)):<EOL><INDENT>return filename<EOL><DEDENT>if isinstance(filename, FILE_LIKE):<EOL><INDENT>return h5py.File(filename.name, mode)<EOL><DEDENT>return h5py.File(filename, mode)<EOL>
Wrapper to open a :class:`h5py.File` from disk, gracefully
    handling a few corner cases