<commit_before>from app import db
from app import utility
import sql

class Site(db.Model):
    #intended use is to disambiguate sites
    id = db.Column(db.Integer, primary_key=True)
    url = db.Column(db.Text, unique=True, index=True)
    creation_time = db.Column(db.DateTime, index=True)
    title = db.Column(db.Text)
    notes = db.relationship('Note', backref='site', lazy='dynamic')
    #TODO: Add another table that has a user-generated nickname for sites

    def update_title(self, title):
        self.title = title

    def __init__(self, url, title):
        self.url = url
        self.title = title
        self.creation_time = utility.get_time()

    def __repr__(self):
        return '%s' % self.title

def create_site(url, title):
    site = Site(url, title)
    sql.add(site)
    return site<commit_msg>adjusted all of the imports ... the _repr_ is way fucked up<commit_after>import app

class Site(app.db.Model):
    #intended use is to disambiguate sites
    id = app.db.Column(app.db.Integer, primary_key=True)
    url = app.db.Column(app.db.Text, unique=True, index=True)
    creation_time = app.db.Column(app.db.DateTime, index=True)
    title = app.db.Column(app.db.Text)
    notes = app.db.relationship('Note', backref='site', lazy='dynamic')
    #TODO: Add another table that has a user-generated nickname for sites

    def update_title(self, title):
        self.title = title

    def __init__(self, url, title):
        self.url = url
        self.title = title
        self.creation_time = app.utility.get_time()

def create_site(url, title):
    site = Site(url, title)
    app.models.sql.add(site)
    return site
{'fraction_non_alphanumeric': 0.11636363636363636, 'fraction_numerical': 0.0, 'mean_word_length': 3.148241206030151, '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': '2189851', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 144}