<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read(cls, source, names=None, format=None, **kwargs):
 """Read segments from file into a `DataQualityDict` Parameters source : `str` path of file to read format : `str`, optional source format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats. names : `list`, optional, default: read all names found list of names to read, by default all names are read separately. coalesce : `bool`, optional if `True` coalesce the all segment lists before returning, otherwise return exactly as contained in file(s). nproc : `int`, optional, default: 1 number of CPUs to use for parallel reading of multiple files verbose : `bool`, optional, default: `False` print a progress bar showing read status Returns ------- flagdict : `DataQualityDict` a new `DataQualityDict` of `DataQualityFlag` entries with ``active`` and ``known`` segments seeded from the XML tables in the given file. Notes -----"""

        on_missing = kwargs.pop('on_missing', 'error')
        coalesce = kwargs.pop('coalesce', False)

        if 'flags' in kwargs:  # pragma: no cover
            warnings.warn('\'flags\' keyword was renamed \'names\', this '
                          'warning will result in an error in the future')
            names = kwargs.pop('flags')

        def combiner(inputs):
            out = cls()

            # check all names are contained
            required = set(names or [])
            found = set(name for dqdict in inputs for name in dqdict)
            for name in required - found:  # validate all names are found once
                msg = '{!r} not found in any input file'.format(name)
                if on_missing == 'ignore':
                    continue
                if on_missing == 'warn':
                    warnings.warn(msg)
                else:
                    raise ValueError(msg)

            # combine flags
            for dqdict in inputs:
                for flag in dqdict:
                    try:  # repeated occurence
                        out[flag].known.extend(dqdict[flag].known)
                        out[flag].active.extend(dqdict[flag].active)
                    except KeyError:  # first occurence
                        out[flag] = dqdict[flag]
            if coalesce:
                return out.coalesce()
            return out

        return io_read_multi(combiner, cls, source, names=names,
                             format=format, on_missing='ignore', **kwargs)