@io_hdf5.with_write_hdf5<EOL>def write_hdf5_dict(flags, output, path=None, append=False, overwrite=False,<EOL>**kwargs):
if path:<EOL><INDENT>try:<EOL><INDENT>parent = output[path]<EOL><DEDENT>except KeyError:<EOL><INDENT>parent = output.create_group(path)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>parent = output<EOL><DEDENT>for name in flags:<EOL><INDENT>if name in parent:<EOL><INDENT>if not (overwrite and append):<EOL><INDENT>raise IOError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% os.path.join(parent.name, name))<EOL><DEDENT>del parent[name]<EOL><DEDENT>group = parent.create_group(name)<EOL>write_hdf5_flag_group(flags[name], group, **kwargs)<EOL><DEDENT>
Write this `DataQualityFlag` to a `h5py.Group`.

    This allows writing to an HDF5-format file.

    Parameters
    ----------
    output : `str`, :class:`h5py.Group`
        path to new output file, or open h5py `Group` to write to.

    path : `str`
        the HDF5 group path in which to write a new group for this flag

    **kwargs
        other keyword arguments passed to :meth:`h5py.Group.create_dataset`

    Returns
    -------
    dqfgroup : :class:`h5py.Group`
        HDF group containing these data. This group contains 'active'
        and 'known' datasets, and metadata attrs.

    See also
    --------
    astropy.io
        for details on acceptable keyword arguments when writing a
        :class:`~astropy.table.Table` to HDF5