def _search(self, limit, format):
url = self.QUERY_URL.format(requests.utils.quote("<STR_LIT>".format(self.query)), min(<NUM_LIT:50>, limit), self.current_offset, format)<EOL>r = requests.get(url, auth=("<STR_LIT>", self.api_key))<EOL>try:<EOL><INDENT>json_results = r.json()<EOL><DEDENT>except ValueError as vE:<EOL><INDENT>if not self.safe:<EOL><INDENT>raise PyBingWebException("<STR_LIT>" % (r.status_code, r.text))<EOL><DEDENT>else:<EOL><INDENT>print ("<STR_LIT>" % (r.status_code, r.text))<EOL>time.sleep(<NUM_LIT:5>)<EOL><DEDENT><DEDENT>packaged_results = [WebResult(single_result_json) for single_result_json in json_results['<STR_LIT:d>']['<STR_LIT>']]<EOL>self.current_offset += min(<NUM_LIT:50>, limit, len(packaged_results))<EOL>return packaged_results<EOL>
Returns a list of result objects, with the url for the next page bing search url.