MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / get_paged_request

Function get_paged_request

tools/gh_api.py:123–140  ·  view source on GitHub ↗

get a full list, handling APIv3's paging

(url, headers=None, **params)

Source from the content-addressed store, hash-verified

121rel_pat = re.compile(r'rel=[\'"](\w+)[\'"]')
122
123def get_paged_request(url, headers=None, **params):
124 """get a full list, handling APIv3's paging"""
125 results = []
126 params.setdefault("per_page", 100)
127 while True:
128 if '?' in url:
129 params = None
130 print(f"fetching {url}", file=sys.stderr)
131 else:
132 print(f"fetching {url} with {params}", file=sys.stderr)
133 response = requests.get(url, headers=headers, params=params)
134 response.raise_for_status()
135 results.extend(response.json())
136 if 'next' in response.links:
137 url = response.links['next']['url']
138 else:
139 break
140 return results
141
142def get_pulls_list(project, auth=False, **params):
143 """get pull request list"""

Callers 5

issues_closed_sinceFunction · 0.90
get_pull_request_filesFunction · 0.85
get_pulls_listFunction · 0.85
get_issues_listFunction · 0.85
get_milestonesFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…