MCPcopy
hub / github.com/pytest-dev/pytest / get_issues

Function get_issues

extra/get_issues.py:13–34  ·  extra/get_issues.py::get_issues
()

Source from the content-addressed store, hash-verified

11
12
13def get_issues():
14 issues = []
15 url = issues_url
16 while 1:
17 get_data = {class="st">"state": class="st">"all"}
18 r = requests.get(url, params=get_data)
19 data = r.json()
20 if r.status_code == 403:
21 class="cm"># API request limit exceeded
22 print(data[class="st">"message"])
23 sys.exit(1)
24 issues.extend(data)
25
26 class="cm"># Look for next page
27 links = requests.utils.parse_header_links(r.headers[class="st">"Link"])
28 another_page = False
29 for link in links:
30 if link[class="st">"rel"] == class="st">"next":
31 url = link[class="st">"url"]
32 another_page = True
33 if not another_page:
34 return issues
35
36
37def main(args):

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected