Query.

        Query Amazon search and check for errors.

        :return:
            An lxml root element.
497065
def _query(self, ResponseGroup="Large", **kwargs):
        
        response = self.api.ItemSearch(ResponseGroup=ResponseGroup, **kwargs)
        root = objectify.fromstring(response)
        if (hasattr(root.Items.Request, 'Errors') and
                not hasattr(root.Items, 'Item')):
            code = root.Items.Request.Errors.Error.Code
            msg = root.Items.Request.Errors.Error.Message
            if code == 'AWS.ParameterOutOfRange':
                raise NoMorePages(msg)
            elif code == 'HTTP Error 503':
                raise RequestThrottled(
                    "Request Throttled Error: '{0}', '{1}'".format(code, msg))
            else:
                raise SearchException(
                    "Amazon Search Error: '{0}', '{1}'".format(code, msg))
        if hasattr(root.Items, 'TotalPages'):
            if root.Items.TotalPages == self.current_page:
                self.is_last_page = True
        return root
1173196
def query( self ):
        
        # build a query if not searching all
        q        = Q()
        operator = 'and'
        
        for i in range(self.uiQueryTREE.topLevelItemCount()):
            item = self.uiQueryTREE.topLevelItem(i)
            
            if ( isinstance(item, XQueryItem) ):
                if ( operator == 'and' ):
                    q &= item.query()
                else:
                    q |= item.query()
            else:
                operator = nativestring(item.text(0))
        return q
932210
def xpath(self, query):
        
        for result in self.tree.xpath(query,namespaces={'f': 'http://ilk.uvt.nl/folia','folia': 'http://ilk.uvt.nl/folia' }):
            yield self.parsexml(result)
923720
def search(self, query, indices=None, doc_types=None, model=None, scan=False, headers=None, **query_params):
        
        if isinstance(query, Search):
            search = query
        elif isinstance(query, (Query, dict)):
            search = Search(query)
        else:
            raise InvalidQuery("search() must be supplied with a Search or Query object, or a dict")

        if scan:
            query_params.setdefault("search_type", "scan")
            query_params.setdefault("scroll", "10m")

        return ResultSet(self, search, indices=indices, doc_types=doc_types,
                         model=model, query_params=query_params, headers=headers)
944357
def _parse_search_results_html(self, doc):
        
        subgroups = []
        soup = bs4.BeautifulSoup(doc, 'lxml')
        ele_divs = soup.select('div.item.prel')
        if not ele_divs:
            return subgroups
        for item in ele_divs:
            ele_a = item.select('p.tt > a')
            if not ele_a:
                continue
            link = ele_a[0].get('href')
            title = ele_a[0].get_text().strip()
            subgroups.append({
                'title': title,
                'link': link,
            })
        return subgroups
4186
def pq(self) -> PyQuery:
        
        if self._pq is None:
            self._pq = PyQuery(self.raw_xml)

        return self._pq
577905
def query(self, ns, selector='*'):
    
    q, r = HicaLabelStore.PREFIX + '.' + ns, []
    for (key, value) in self.items:
      if not selector and key == q:
        r.append((key, value))
      if key.startswith(q) and key != q:
        sub = key[len(q):]
        m = re.match('.' + selector, sub)
        if m:
          r.append((key, value))
    return r
992921
def query(self, name, node):
        
        #log.debug('searching schema for (%s)', name)
        qref = qualify(name, node, node.namespace())
        query = BlindQuery(qref)
        result = query.execute(self.schema)
        return (result, [])
156932
def filter(self, query: str) -> Optional['CompatNodeIterator']:
        
        if not self._last_node:
            return None

        return filter(self._last_node, query)
363679
def search_queries(self, q):
        ''''''
        if self.text:
            searchengine = self.session.router.search_engine
            if searchengine:
                return searchengine.search_model(q, *self.text)
            else:
                raise QuerySetError('Search not available for %s' % self._meta)
        else:
            return q
208109
def search(cls, query, search_opts=None):
        

        if search_opts is None:
            search_opts = {}

        xmlrpc = XMLRPCConnection()
        try:
            search_result = xmlrpc.connection.search_vrf(
                {
                    'query': query,
                    'search_options': search_opts,
                    'auth': AuthOptions().options
                })
        except xmlrpclib.Fault as xml_fault:
            raise _fault_to_exception(xml_fault)
        result = dict()
        result['result'] = []
        result['search_options'] = search_result['search_options']
        for v in search_result['result']:
            result['result'].append(VRF.from_dict(v))

        return result
1291068
def query(self):
        """"""
        if self._query is None:
            query_string = self.environ.get('QUERY_STRING')
            self._query = QueryDict([
                (k.decode('utf-8'), v.decode('utf-8'))
                for k, v in urlparse.parse_qsl(
                    query_string, keep_blank_values=True)
            ])
        return self._query
837117
def query(self):
        
        ret = MultiDict(parse_qsl(self.raw_query_string, keep_blank_values=True))
        return MultiDictProxy(ret)
1305054
def searchNsByHref(self, node, href):
        
        if node is None: node__o = None
        else: node__o = node._o
        ret = libxml2mod.xmlSearchNsByHref(self._o, node__o, href)
        if ret is None:raise treeError('xmlSearchNsByHref() failed')
        __tmp = xmlNs(_obj=ret)
        return __tmp
155202
def _get_roots(self):
        
        region = self._get_session().region_name or r'[\w-]+'
        return (
                # S3 scheme
                # - s3://<bucket>/<key>
                's3://',

                # Virtual-hosted–style URL
                # - http://<bucket>.s3.amazonaws.com/<key>
                # - https://<bucket>.s3.amazonaws.com/<key>
                # - http://<bucket>.s3-<region>.amazonaws.com/<key>
                # - https://<bucket>.s3-<region>.amazonaws.com/<key>
                _re.compile(r'https?://[\w.-]+\.s3\.amazonaws\.com'),
                _re.compile(
                    r'https?://[\w.-]+\.s3-%s\.amazonaws\.com' % region),

                # Path-hosted–style URL
                # - http://s3.amazonaws.com/<bucket>/<key>
                # - https://s3.amazonaws.com/<bucket>/<key>
                # - http://s3-<region>.amazonaws.com/<bucket>/<key>
                # - https://s3-<region>.amazonaws.com/<bucket>/<key>
                _re.compile(r'https?://s3\.amazonaws\.com'),
                _re.compile(r'https?://s3-%s\.amazonaws\.com' % region),

                # Transfer acceleration URL
                # - http://<bucket>.s3-accelerate.amazonaws.com
                # - https://<bucket>.s3-accelerate.amazonaws.com
                # - http://<bucket>.s3-accelerate.dualstack.amazonaws.com
                # - https://<bucket>.s3-accelerate.dualstack.amazonaws.com
                _re.compile(
                    r'https?://[\w.-]+\.s3-accelerate\.amazonaws\.com'),
                _re.compile(
                    r'https?://[\w.-]+\.s3-accelerate\.dualstack'
                    r'\.amazonaws\.com'))
718597
def query(self, search, query):
        '''
        
        '''
        if not query:
            return search

        included, excluded = [], []
        for term in query.split(' '):
            if not term.strip():
                continue
            if term.startswith('-'):
                excluded.append(term[1:])
            else:
                included.append(term)
        if included:
            search = search.query(self.multi_match(included))
        for term in excluded:
            search = search.query(~self.multi_match([term]))
        return search
57796
def query(self):
        """"""

        if not hasattr(self, '_decoded_query'):
            self._decoded_query = list(urls._url_decode_impl(
                self.querystr.split('&'), 'utf-8', False, True, 'strict'))
        return self.query_cls(self._decoded_query)