<commit_before>from flask.ext import login
from aggrerate import util

class User(login.UserMixin):
    @classmethod
    def get(cls, userid):
        data = util.get_userdata(username = userid)
        

        return User(data, userid=="matt")

    def __init__(self, data, admin):
        self.data = data
        self.admin = admin

    def get_username(self):
        return self.data["username"]

    def is_admin(self):
        return self.admin

    def get_id(self):
        return self.data["username"]
<commit_msg>I am really bad at this<commit_after>from flask.ext import login
from aggrerate import util

class User(login.UserMixin):
    @classmethod
    def get(cls, userid):
        data = util.get_userdata(username = userid)
        if data:
            data = data[0]
        else:
            return None        

        return User(data, userid=="matt")

    def __init__(self, data, admin):
        self.data = data
        self.admin = admin

    def get_username(self):
        return self.data["username"]

    def is_admin(self):
        return self.admin

    def get_id(self):
        return self.data["username"]

{'fraction_non_alphanumeric': 0.09886264216972879, 'fraction_numerical': 0.0008748906386701663, 'mean_word_length': 2.2968299711815563, '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': '2462615', 'n_tokens_mistral': 354, 'n_tokens_neox': 339, 'n_words': 92}