Returns a PyQuery object of the response's content
197552
def doc(self):
        """"""
        if hasattr(self, '_doc'):
            return self._doc
        elements = self.etree
        doc = self._doc = PyQuery(elements)
        doc.make_links_absolute(utils.text(self.url))
        return doc
229473
def get_payload(self):
        
        temp = self.get_uri_as_list()
        query_string = temp[4]
        if query_string == "":
            return None  # Bad request error code
        query_string_as_list = str.split(query_string, "=")
        return query_string_as_list[1]
554601
def _load_response(response):
    '''
    
    '''

    try:
        data = salt.utils.json.loads(response.text)
    except ValueError:
        data = response.text

    ret = {'code': response.status_code, 'content': data}

    return ret
699889
def query(self):
        """"""
        self._query = query = ""

        query_kwargs = self.query_kwargs
        if query_kwargs: query = urlencode(query_kwargs, doseq=True)
        return query
1284695
def raw_query(self, query, format=None, pretty=False):
        '''
        '''
        if format:
            format = format
        else:
            format = self.format

        payload = self._payload_builder(query, format=format)
        response = self.execute_query(payload)
        if pretty:
            response = self.response_builder(response)

        return response
220985
def query(input, representation, resolvers=None, **kwargs):
    
    apiurl = API_BASE+'/%s/%s/xml' % (urlquote(input), representation)
    if resolvers:
        kwargs['resolver'] = ",".join(resolvers)
    if kwargs:
        apiurl+= '?%s' % urlencode(kwargs)
    result = []
    try:
        tree = ET.parse(urlopen(apiurl))
        for data in tree.findall(".//data"):
            datadict = {'resolver':data.attrib['resolver'],
                        'notation':data.attrib['notation'],
                        'value':[]}
            for item in data.findall("item"):
                datadict['value'].append(item.text)
            if len(datadict['value']) == 1:
                datadict['value'] = datadict['value'][0]
            result.append(datadict)
    except HTTPError:
        # TODO: Proper handling of 404, for now just returns None
        pass
    return result if result else None
505105
def get_query(self, q, request):
        
        return Group.objects.filter(
            Q(name__icontains=q)
            | Q(description__icontains=q)
        )
1244909
def query(query_str)
      # puts "conent #{content}"
      res = conn.post '/query/', {query: query_str, time: Time.now.to_i}.to_json do |req|
        req.headers['Content-Type'] = 'application/json'
        req.headers['X-Requested-With'] = 'XMLHttpRequest'
        req['Cookie'] = "csrftoken=#{csrf_token}"
        req.headers['X-CSRFToken'] = csrf_token
      end
      JSON.parse(res.body)
   end
800928
def get_formatted_content(self, pyobj):
        '''
        '''
        u = urlencode(pyobj, self.reserved)
        return String.get_formatted_content(self, 
            u)
421686
async def _query_json(
        self, path, method="GET", *, params=None, data=None, headers=None, timeout=None
    ):
        
        if headers is None:
            headers = {}
        headers["content-type"] = "application/json"
        if not isinstance(data, (str, bytes)):
            data = json.dumps(data)
        response = await self._query(
            path, method, params=params, data=data, headers=headers, timeout=timeout
        )
        data = await parse_result(response)
        return data
837117
def query(self):
        
        ret = MultiDict(parse_qsl(self.raw_query_string, keep_blank_values=True))
        return MultiDictProxy(ret)
1041571
def get(self, query_name):
        

        url = "{0}/{1}".format(self.saved_query_url, query_name)
        response = self._get_json(HTTPMethods.GET, url, self._get_master_key())

        return response
421033
def document
      json = Net::HTTP.get_response URI.parse(query_string(@query))
      json.body
    end
523195
def _query(self, text):
        
        params = (
            ('v', self.api_version),
            ('query', text),
            ('lang', self.language),
            ('sessionId', self.session_id),
            ('timezone', self.timezone),
        )
        # store query_response if required
        if self.query_response:
            self.previous_query_response = self.query_response

        self.query_response = result = self.session.get(url=self.query_url, params=params).json()

        return result
641009
def content(self, request, id):
        
        gist = self.send(request, id).json()

        def convert(data):
            return base64.b64decode(data).decode('utf-8')

        content = {}
        for name, data in gist['files'].items():
            content[name] = convert(data['content'])

        return content
60547
def pq(self) -> PyQuery:
        
        if self._pq is None:
            self._pq = PyQuery(self.lxml)

        return self._pq
278979
def from_response(response, url):
    
    # noinspection PyBroadException
    try:
        data = response.json()
        if not isinstance(data, dict):
            return from_status(
                response.status_code, response.text,
                extra=dict(url=url, response=response.text)
            )

        code = data.get('code', response.status_code)
        if code in HTTP_STATUS_CODES:
            return HTTP_STATUS_CODES[code](**ErrorSchema().load(data))
        else:
            return Error(**ErrorSchema().load(data))
    except Exception:
        return from_status(
            response.status_code, response.text,
            extra=dict(url=url, response=response.text)
        )