@classmethod<EOL><INDENT>def query_dqsegdb(cls, flags, *args, **kwargs):<DEDENT>
<EOL>on_error = kwargs.pop('<STR_LIT>', '<STR_LIT>').lower()<EOL>if on_error not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:ignore>']:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>qsegs = _parse_query_segments(args, cls.query_dqsegdb)<EOL>inq = Queue()<EOL>outq = Queue()<EOL>for i in range(len(flags)):<EOL><INDENT>t = _QueryDQSegDBThread(inq, outq, qsegs, **kwargs)<EOL>t.setDaemon(True)<EOL>t.start()<EOL><DEDENT>for i, flag in enumerate(flags):<EOL><INDENT>inq.put((i, flag))<EOL><DEDENT>inq.join()<EOL>outq.join()<EOL>new = cls()<EOL>results = list(zip(*sorted([outq.get() for i in range(len(flags))],<EOL>key=lambda x: x[<NUM_LIT:0>])))[<NUM_LIT:1>]<EOL>for result, flag in zip(results, flags):<EOL><INDENT>if isinstance(result, Exception):<EOL><INDENT>result.args = ('<STR_LIT>' % (str(result), str(flag)),)<EOL>if on_error == '<STR_LIT:ignore>':<EOL><INDENT>pass<EOL><DEDENT>elif on_error == '<STR_LIT>':<EOL><INDENT>warnings.warn(str(result))<EOL><DEDENT>else:<EOL><INDENT>raise result<EOL><DEDENT><DEDENT>else:<EOL><INDENT>new[flag] = result<EOL><DEDENT><DEDENT>return new<EOL>
Query the advanced LIGO DQSegDB for a list of flags.

        Parameters
        ----------
        flags : `iterable`
            A list of flag names for which to query.

        *args
            Either, two `float`-like numbers indicating the
            GPS [start, stop) interval, or a `SegmentList`
            defining a number of summary segments.

        on_error : `str`
            how to handle an error querying for one flag, one of

            - `'raise'` (default): raise the Exception
            - `'warn'`: print a warning
            - `'ignore'`: move onto the next flag as if nothing happened

        url : `str`, optional
            URL of the segment database, defaults to
            ``$DEFAULT_SEGMENT_SERVER`` environment variable, or
            ``'https://segments.ligo.org'``

        Returns
        -------
        flagdict : `DataQualityDict`
            An ordered `DataQualityDict` of (name, `DataQualityFlag`)
            pairs.