| 134 | |
| 135 | |
| 136 | def fetch_github_user(login: str, session: requests.Session, headers: dict[str, str]) -> dict[str, Any] | None: |
| 137 | try: |
| 138 | response = session.get(f"https://api.github.com/users/{login}", headers=headers, timeout=20) |
| 139 | if response.status_code == 200: |
| 140 | return response.json() |
| 141 | print(f"GitHub API miss: {login} status={response.status_code}") |
| 142 | except requests.RequestException as exc: |
| 143 | print(f"GitHub API error: {login} {exc}") |
| 144 | return None |
| 145 | |
| 146 | |
| 147 | def profile_value(profile: dict[str, Any], candidates: list[str]) -> Any: |