<commit_before>from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
from sqlalchemy.orm import relationship

from .. import db


class Application(db.Model):
    __tablename__ = 'application'
    id = Column(Integer, primary_key=True)
    name = Column(String(120), unique=True)
    description = Column(String, unique=False)
    is_release = Column(Boolean)
    group_id = Column(Integer, ForeignKey('group.id'))
    group = relationship('Group', foreign_keys=[group_id])
    # Version info
    version_0 = Column(Integer)
    version_1 = Column(Integer)
    version_2 = Column(Integer)

    def __init__(self, name, version, description='', is_release=False, uuids=None):
        self.name = name
        self.description = description
        self.version_0, self.version_1, self.version_2 = map(int, version.split('.'))
        self.is_release = is_release

        if uuids is not None:
            for uuid in uuids:<commit_msg>assume version argument in Application is already a tuple of integers<commit_after>from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
from sqlalchemy.orm import relationship

from .. import db


class Application(db.Model):
    __tablename__ = 'application'
    id = Column(Integer, primary_key=True)
    name = Column(String(120), unique=True)
    description = Column(String, unique=False)
    is_release = Column(Boolean)
    group_id = Column(Integer, ForeignKey('group.id'))
    group = relationship('Group', foreign_keys=[group_id])
    # Version info
    version_0 = Column(Integer)
    version_1 = Column(Integer)
    version_2 = Column(Integer)

    def __init__(self, name, version, description='', is_release=False, uuids=None):
        self.name = name
        self.description = description
        self.version_0, self.version_1, self.version_2 = map(int, version)
        self.is_release = is_release

        if uuids is not None:
            for uuid in uuids:
{'fraction_non_alphanumeric': 0.10087493566649511, 'fraction_numerical': 0.009264024704065878, 'mean_word_length': 3.661870503597122, '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': '5614731', 'n_tokens_mistral': 577, 'n_tokens_neox': 563, 'n_words': 151}