<commit_before>
from email.Utils import make_msgid
import hmac

import generate as gen
import parse

class Needed(Exception):
    pass

class AuthFailure(Exception):
    pass

class AuthMethod:
    def __init__(self, link, auth_db):
        self.link = link
        self.auth_db = auth_db
        self.username = None

    def get_response(self):
        return self.link.read_str()

    def do_auth(self):
        while True:
            try:
                self.perform_auth()
                break
            except AuthFailure, fail:
                self.link.send_msg(gen.failure(*fail.args))
                return False

        self.link.send_msg(gen.success())<commit_msg>Add a DummyAuthDb class that shows the auth db interface<commit_after>
from email.Utils import make_msgid
import hmac

import generate as gen
import parse

class DummyAuthDb (object):
    def __init__(self, repos):
        self.repos = repos

    def get_realm(self):
        return self.repos.base_url

    def get_auth_list(self):
        return None

    def get_password(self, username):
        return ''

class Needed(Exception):
    pass

class AuthFailure(Exception):
    pass

class AuthMethod:
    def __init__(self, link, auth_db):
        self.link = link
        self.auth_db = auth_db
        self.username = None

    def get_response(self):
        return self.link.read_str()

    def do_auth(self):
        while True:
            try:
                self.perform_auth()
                break
            except AuthFailure, fail:
                self.link.send_msg(gen.failure(*fail.args))
                return False

        self.link.send_msg(gen.success())
{'fraction_non_alphanumeric': 0.07992788461538461, 'fraction_numerical': 0.0, 'mean_word_length': 2.0662983425414363, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5962027', 'n_tokens_mistral': 493, 'n_tokens_neox': 469, 'n_words': 126}