<commit_before>from cassandra.auth import AuthProvider, Authenticator

try:
    from puresasl.client import SASLClient
except ImportError:
    SASLClient = None


class DSEPlainTextAuthProvider(AuthProvider):
    def __init__(self, username=None, password=<PASSWORD>):
        self.username = username
        self.password = password

    def new_authenticator(self, host):
        return PlainTextAuthenticator(self.username, self.password)


class DSEGSSAPIAuthProvider(AuthProvider):
    def __init__(self, service=None, qops=None):
        if SASLClient is None:
            raise ImportError('The puresasl library has not been installed')<commit_msg>Check for kerberos library before attempting GSSAPI<commit_after>from cassandra.auth import AuthProvider, Authenticator

try:
    import kerberos
    _have_kerberos = True
except ImportError:
    _have_kerberos = False

try:
    from puresasl.client import SASLClient
    _have_puresasl = True
except ImportError:
    _have_puresasl = False


class DSEPlainTextAuthProvider(AuthProvider):
    def __init__(self, username=None, password=<PASSWORD>):
        self.username = username
        self.password = password

    def new_authenticator(self, host):
        return PlainTextAuthenticator(self.username, self.password)


class DSEGSSAPIAuthProvider(AuthProvider):
    def __init__(self, service=None, qops=None):
        if not _have_puresasl:
            raise ImportError('The puresasl library has not been installed')
        if not _have_kerberos:
            raise ImportError('The kerberos library has not been installed')
{'fraction_non_alphanumeric': 0.06801007556675064, 'fraction_numerical': 0.0, 'mean_word_length': 3.965625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3651072', 'n_tokens_mistral': 471, 'n_tokens_neox': 457, 'n_words': 122}