<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query(cls, flag, *args, **kwargs):
 """Query for segments of a given flag This method intelligently selects the `~DataQualityFlag.query_segdb` or the `~DataQualityFlag.query_dqsegdb` methods based on the ``url`` kwarg given. 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'`` See Also -------- DataQualityFlag.query_segdb DataQualityFlag.query_dqsegdb for details on the actual query engine, and documentation of other keyword arguments appropriate for each query Returns ------- flag : `DataQualityFlag` A new `DataQualityFlag`, with the `known` and `active` lists filled appropriately. """

        query_ = _select_query_method(
            cls, kwargs.get('url', DEFAULT_SEGMENT_SERVER))
        return query_(flag, *args, **kwargs)