openhands.resolver.utils
identify_token
def identify_token(token: str, repo: str | None = None) -> Platform
Identifies whether a token belongs to GitHub or GitLab.
Arguments:
token
str - The personal access token to check.repo
str - Repository in format "owner/repo" for GitHub Actions token validation.
Returns:
Platform
- "GitHub" if the token is valid for GitHub, "GitLab" if the token is valid for GitLab, "Invalid" if the token is not recognized by either.
reset_logger_for_multiprocessing
def reset_logger_for_multiprocessing(logger: logging.Logger, instance_id: str,
log_dir: str) -> None
Reset the logger for multiprocessing.
Save logs to a separate file for each process, instead of trying to write to the same file/console from multiple processes.