<commit_before><commit_msg>adds in test db file<commit_after>import logging
from tinydb import TinyDB, Query
from havocbot.user import User

logger = logging.getLogger(__name__)


class StasherTinyDB(object):
    def __init__(self):
        self.db = TinyDB('stasher/havocbot.json', default_table='users', sort_keys=True, indent=2)

    def add_user(self, user):
        pass

    def del_user(self, user):
        pass

    def find_user_by_id(self, search_user_id):
        user = None

        result = self.db.get(eid=search_user_id)

        if result is not None:
            user = self.build_user(result)

        logger.info("Returning with '%s'" % (result))

        return user

    def find_users_by_username(self, search_username):
        pass

    def find_users_by_name(self, search_name):
        pass

    def find_users_by_alias(self, search_alias):
        pass

    def build_user(self, result_data):
        user = User(result_data.eid)

        user.name = result_data['name']
        user.usernames = result_data['usernames']
        user.points = result_data['points']
        user.permissions = result_data['permissions']
        user.aliases = result_data['aliases']

        return user

{'fraction_non_alphanumeric': 0.09794238683127572, 'fraction_numerical': 0.0008230452674897119, 'mean_word_length': 2.8603174603174604, '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': '1759625', 'n_tokens_mistral': 393, 'n_tokens_neox': 376, 'n_words': 83}