def query_bugs(self, query):
        bugs = []
        def __api_call(offset=None):
            query_results = self.jira.jql(query, offset)
            if query_results:
                issues = query_results["issues"]
                for issue in issues:
                    bug = self.from_search_json(issue)
                    bugs.append(bug)
            try:
                starts_at = query_results.get("startAt")
                max_results = query_results.get("maxResults")
                total = query_results.get("total")
                ends_at = int(starts_at) + int(max_results)
                if ends_at < int(total):
                    __api_call(offset=ends_at)
            except __HOLE__:
                pass

        __api_call();
        return bugs
dataset/ETHPy150Open SalesforceEng/Providence/Empire/bugsystems/jira/__init__.py/JiraBugSystem.query_bugs