def requires_2fa(response):
    """Determine whether a response requires us to prompt the user for 2FA."""
    if (
        response.status_code == 401
        and "X-GitHub-OTP" in response.headers
        and "required" in response.headers["X-GitHub-OTP"]
    ):
        return True
    return False