in migration/src/github_issues_util.py [0:0]
def get_user(token: str, username: str, logger: Logger) -> Optional[dict[str, Any]]:
url = GITHUB_API_BASE + f"/users/{username}"
headers = {"Authorization": f"token {token}", "Accept": "application/vnd.github.v3+json"}
res = requests.get(url, headers=headers)
time.sleep(INTERVAL_IN_SECONDS)
if res.status_code != 200:
logger.error(f"Failed to get user {username}; status_code={res.status_code}, message={res.text}")
return None
return res.json()