<commit_before># TODO perhaps move this to normal auth module...
import getpass

AUTH_TYPES = {'gmail': 'oauth', 'yahoo': 'password', 'eas': 'password'}

# Certain password auths flows (like EAS) provide their own message
default_message = 'Password for {0} (hidden): '


class AuthError(Exception):
    pass


class ConnectionError(AuthError):
    pass


class ValidationError(AuthError):
    pass


def password_auth(email_address, message=default_message):
    pw = getpass.getpass(message.format(email_address))

    if len(pw) <= 0:
        raise AuthError('Password required.')<commit_msg>[auth] Add the NotSupportedError exception.<commit_after># TODO perhaps move this to normal auth module...
import getpass

AUTH_TYPES = {'gmail': 'oauth', 'yahoo': 'password', 'eas': 'password'}

# Certain password auths flows (like EAS) provide their own message
default_message = 'Password for {0} (hidden): '


class AuthError(Exception):
    pass


class ConnectionError(AuthError):
    pass


class ValidationError(AuthError):
    pass


class NotSupportedError(AuthError):
    pass


def password_auth(email_address, message=default_message):
    pw = getpass.getpass(message.format(email_address))

    if len(pw) <= 0:
        raise AuthError('Password required.')
{'fraction_non_alphanumeric': 0.11365430149960537, 'fraction_numerical': 0.0031570639305445935, 'mean_word_length': 4.737556561085973, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3696966', 'n_tokens_mistral': 383, 'n_tokens_neox': 361, 'n_words': 112}