@io_hdf5.with_read_hdf5<EOL>def read_hdf5_dict(h5f, names=None, path=None, on_missing='<STR_LIT:error>', **kwargs):
if path:<EOL><INDENT>h5f = h5f[path]<EOL><DEDENT>if names is None:<EOL><INDENT>names = kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>if names is None:<EOL><INDENT>try:<EOL><INDENT>names = find_flag_groups(h5f, strict=True)<EOL><DEDENT>except KeyError:<EOL><INDENT>names = None<EOL><DEDENT>if not names:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>out = DataQualityDict()<EOL>for name in names:<EOL><INDENT>try:<EOL><INDENT>out[name] = read_hdf5_flag(h5f, name, **kwargs)<EOL><DEDENT>except KeyError as exc:<EOL><INDENT>if on_missing == '<STR_LIT:ignore>':<EOL><INDENT>pass<EOL><DEDENT>elif on_missing == '<STR_LIT>':<EOL><INDENT>warnings.warn(str(exc))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'.format(name))<EOL><DEDENT><DEDENT><DEDENT>return out<EOL>
Read a `DataQualityDict` from an HDF5 file