MCPcopy Create free account
hub / github.com/dmlc/xgboost / paginate_request

Function paginate_request

dev/query_contributors.py:23–29  ·  view source on GitHub ↗
(url, callback)

Source from the content-addressed store, hash-verified

21reviewers = set()
22
23def paginate_request(url, callback):
24 r = requests.get(url, auth=(username, password))
25 assert r.status_code == requests.codes.ok, f'Code: {r.status_code}, Text: {r.text}'
26 callback(json.loads(r.text))
27 while 'next' in r.links:
28 r = requests.get(r.links['next']['url'], auth=(username, password))
29 callback(json.loads(r.text))
30
31for line in git.log(f'{from_commit}..{to_commit}', '--pretty=format:%s', '--reverse', '--first-parent'):
32 m = re.search('\(#([0-9]+)\)$', line.rstrip())

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected