@classmethod<EOL><INDENT>def query_dqsegdb(cls, flag, *args, **kwargs):<DEDENT>
<EOL>qsegs = _parse_query_segments(args, cls.query_dqsegdb)<EOL>url = kwargs.pop('<STR_LIT:url>', DEFAULT_SEGMENT_SERVER)<EOL>out = cls(name=flag)<EOL>if out.ifo is None or out.tag is None:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>% flag)<EOL><DEDENT>for start, end in qsegs:<EOL><INDENT>if float(end) == +inf:<EOL><INDENT>end = to_gps('<STR_LIT>').seconds<EOL><DEDENT>try:<EOL><INDENT>data = query_segments(flag, int(start), int(end), host=url)<EOL><DEDENT>except HTTPError as exc:<EOL><INDENT>if exc.code == <NUM_LIT>:  <EOL><INDENT>exc.msg += '<STR_LIT>'.format(flag)<EOL><DEDENT>raise<EOL><DEDENT>new = cls.read(<EOL>BytesIO(json.dumps(data).encode('<STR_LIT:utf-8>')),<EOL>format='<STR_LIT>',<EOL>)<EOL>segl = SegmentList([Segment(start, end)])<EOL>new.known &= segl<EOL>new.active &= segl<EOL>out += new<EOL>out.description = new.description<EOL>out.isgood = new.isgood<EOL><DEDENT>return out<EOL>
Query the advanced LIGO DQSegDB for the given flag

        Parameters
        ----------
        flag : `str`
            The name of the flag 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

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

        Returns
        -------
        flag : `DataQualityFlag`
            A new `DataQualityFlag`, with the `known` and `active` lists
            filled appropriately.