def __init__(self, browser, **kwargs):
        if len(kwargs) > 1:
            raise TypeError('BrowserQuery() takes at most 1 keyword argument.')

        if not kwargs:
            raise TypeError('Must pass a query keyword argument to BrowserQuery().')

        query_name, query_value = kwargs.items()[0]

        if query_name not in QUERY_TYPES:
            raise TypeError('{} is not a supported query type for BrowserQuery()'.format(query_name))

        def query_fn():  # pylint: disable=missing-docstring
            return getattr(browser, QUERY_TYPES[query_name])(query_value)

        super(BrowserQuery, self).__init__(
            query_fn,
            desc=u"BrowserQuery({}={!r})".format(query_name, query_value),
        )
        self.browser = browser
Generate a query over a browser.
dataset/ETHPy150Open edx/bok-choy/bok_choy/query.py/BrowserQuery.__init__