def get_auth(credentials_prompt, refresh_token_cache, manual_login=False):
with requests.Session() as session:<EOL><INDENT>session.headers = {'<STR_LIT>': USER_AGENT}<EOL>try:<EOL><INDENT>logger.info('<STR_LIT>')<EOL>refresh_token = refresh_token_cache.get()<EOL>if refresh_token is None:<EOL><INDENT>raise GoogleAuthError("<STR_LIT>")<EOL><DEDENT>access_token = _auth_with_refresh_token(session, refresh_token)<EOL><DEDENT>except GoogleAuthError as e:<EOL><INDENT>logger.info('<STR_LIT>', e)<EOL>logger.info('<STR_LIT>')<EOL>if manual_login:<EOL><INDENT>authorization_code = (<EOL>credentials_prompt.get_authorization_code()<EOL>)<EOL><DEDENT>else:<EOL><INDENT>authorization_code = _get_authorization_code(<EOL>session, credentials_prompt<EOL>)<EOL><DEDENT>access_token, refresh_token = _auth_with_code(<EOL>session, authorization_code<EOL>)<EOL>refresh_token_cache.set(refresh_token)<EOL><DEDENT>logger.info('<STR_LIT>')<EOL>return _get_session_cookies(session, access_token)<EOL><DEDENT>
Authenticate with Google.

    Args:
        refresh_token_cache (RefreshTokenCache): Cache to use so subsequent
            logins may not require credentials.
        credentials_prompt (CredentialsPrompt): Prompt to use if credentials
            are required to log in.
        manual_login (bool): If true, prompt user to log in through a browser
            and enter authorization code manually. Defaults to false.

    Returns:
        dict: Google session cookies.

    Raises:
        GoogleAuthError: If authentication with Google fails.