@classmethod<EOL><INDENT>def query_segdb(cls, flags, *args, **kwargs):<DEDENT>
warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>", DeprecationWarning)<EOL>qsegs = _parse_query_segments(args, cls.query_segdb)<EOL>url = kwargs.pop('<STR_LIT:url>', DEFAULT_SEGMENT_SERVER)<EOL>if kwargs.pop('<STR_LIT>', None) is not None:<EOL><INDENT>warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if kwargs.keys():<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>" % list(kwargs.keys()[<NUM_LIT:0>]))<EOL><DEDENT>from glue.segmentdb import (segmentdb_utils as segdb_utils,<EOL>query_engine as segdb_engine)<EOL>connection = segdb_utils.setup_database(url)<EOL>engine = segdb_engine.LdbdQueryEngine(connection)<EOL>segdefs = []<EOL>for flag in flags:<EOL><INDENT>dqflag = DataQualityFlag(name=flag)<EOL>ifo = dqflag.ifo<EOL>name = dqflag.tag<EOL>if dqflag.version is None:<EOL><INDENT>vers = '<STR_LIT:*>'<EOL><DEDENT>else:<EOL><INDENT>vers = dqflag.version<EOL><DEDENT>for gpsstart, gpsend in qsegs:<EOL><INDENT>if float(gpsend) == +inf:<EOL><INDENT>gpsend = to_gps('<STR_LIT>').seconds<EOL><DEDENT>gpsstart = float(gpsstart)<EOL>if not gpsstart.is_integer():<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>gpsend = float(gpsend)<EOL>if not gpsend.is_integer():<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>segdefs += segdb_utils.expand_version_number(<EOL>engine, (ifo, name, vers, gpsstart, gpsend, <NUM_LIT:0>, <NUM_LIT:0>))<EOL><DEDENT><DEDENT>segs = segdb_utils.query_segments(engine, '<STR_LIT>', segdefs)<EOL>segsum = segdb_utils.query_segments(engine, '<STR_LIT>', segdefs)<EOL>out = cls()<EOL>for definition, segments, summary in zip(segdefs, segs, segsum):<EOL><INDENT>flag = '<STR_LIT::>'.join(map(str, definition[:<NUM_LIT:3>]))<EOL>name = flag.rsplit('<STR_LIT::>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>if flag.endswith('<STR_LIT:*>'):<EOL><INDENT>flag = name<EOL>key = name<EOL><DEDENT>elif flag not in flags and name in flags:<EOL><INDENT>key = name<EOL><DEDENT>else:<EOL><INDENT>key = flag<EOL><DEDENT>if key not in out:<EOL><INDENT>out[key] = DataQualityFlag(name=flag)<EOL><DEDENT>out[key].known.extend(summary)<EOL>out[key].active.extend(segments)<EOL><DEDENT>return out<EOL>
Query the inital LIGO segment database 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.
        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.