<commit_before>from datetime import datetime
from har import db


class Log(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    subject_id = db.Column(db.Integer, db.ForeignKey('subject.device'))
    log_type = db.Column(db.String(40))
    activity = db.Column(db.String(40))
    sensor_placement = db.Column(db.String(40))
    number_of_sensor = db.Column(db.Integer)
    total_sensor_axis = db.Column(db.Integer)
    number_of_entry = db.Column(db.Integer)
    path = db.Column(db.String(250))
    timestamp = db.Column(db.DateTime)

    def __init__(self, subject_id, log_type, activity, sensor_placement, number_of_sensor,
                 total_sensor_axis, number_of_entry, path):
        self.subject_id = subject_id
        self.log_type = log_type
        self.activity = activity
        self.sensor_placement = sensor_placement
        self.number_of_sensor = number_of_sensor
        self.total_sensor_axis = total_sensor_axis
        self.number_of_entry = number_of_entry
        self.path = path
        self.timestamp = datetime.now()

    def __repr__(self):
        return '<%s log from subject %i>' % self.log_type, self.subject<commit_msg>Add status column to Log model<commit_after>from datetime import datetime
from har import db



class Log(db.Model):
    STATUS_PENDING = "pending"
    STATUS_PENDING = "trained"

    id = db.Column(db.Integer, primary_key=True)
    subject_id = db.Column(db.Integer, db.ForeignKey('subject.device'))
    log_type = db.Column(db.String(40))
    activity = db.Column(db.String(40))
    sensor_placement = db.Column(db.String(40))
    number_of_sensor = db.Column(db.Integer)
    total_sensor_axis = db.Column(db.Integer)
    number_of_entry = db.Column(db.Integer)
    path = db.Column(db.String(250))
    status = db.Column(db.String(40))
    timestamp = db.Column(db.DateTime)

    def __init__(self, subject_id, log_type, activity, sensor_placement, number_of_sensor,
                 total_sensor_axis, number_of_entry, path):
        self.subject_id = subject_id
        self.log_type = log_type
        self.activity = activity
        self.sensor_placement = sensor_placement
        self.number_of_sensor = number_of_sensor
        self.total_sensor_axis = total_sensor_axis
        self.number_of_entry = number_of_entry
        self.path = path
        self.status = Log.STATUS_PENDING
        self.timestamp = datetime.now()

    def __repr__(self):
        return '<%s log from subject %i>' % self.log_type, self.subject
{'fraction_non_alphanumeric': 0.10151878497202238, 'fraction_numerical': 0.007993605115907274, 'mean_word_length': 3.2423728813559323, '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': '571996', 'n_tokens_mistral': 801, 'n_tokens_neox': 782, 'n_words': 152}