<commit_before># -*- coding: utf-8 -*-

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import UnicodeText, Date, create_engine, Column
from sqlalchemy import Integer, ForeignKey, Table
from sqlalchemy.orm import relationship

Base = declarative_base()

class University(Base):
    __tablename__ = 'university'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)
    location = Column(UnicodeText, nullable=True)

    def __init__(self, name):
        self.name = name

class Department(Base):
    __tablename__ = 'department'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)

    def __init__(self, name):
        self.name = name

class Person(Base):
    __tablename__ = 'person'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)
    first_name = Column(UnicodeText, nullable=True)
    first_surname = Column(UnicodeText, nullable=True)
    second_surname = Column(UnicodeText, nullable=True)
    gender = Column(UnicodeText, nullable=True)

    def __init__(self, name):
        self.name = name

class Descriptor(Base):
    __tablename__ = 'descriptor'

    id = Column(Integer, primary_key=True)
    text = Column(UnicodeText, nullable=False)
    code = Column(Integer, nullable=True)

    parent_code = Column(Integer, ForeignKey('descriptor.id'))
    parent = relationship('Descriptor', remote_side=[id], backref='children')

    def __init__(self, text):
        self.text = text

class Advisor(Base):
    __tablename__ = 'advisor'

    thesis_id = Column(Integer, ForeignKey('thesis.id', ondelete='cascade'), primary_key=True)
    thesis = relationship("Thesis")

    person_id = Column(Integer, ForeignKey('person.id', ondelete='cascade'), primary_key=True)
    person = relationship("Person")

    role = Column(UnicodeText, nullable=False)

    def __init__(self, person, role):
        self.person = person
        self.role = role<commit_msg>Updated constructors<commit_after># -*- coding: utf-8 -*-

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import UnicodeText, Date, create_engine, Column
from sqlalchemy import Integer, ForeignKey, Table
from sqlalchemy.orm import relationship

Base = declarative_base()

class University(Base):
    __tablename__ = 'university'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)
    location = Column(UnicodeText, nullable=True)

    def __init__(self, name, location=None):
        self.name = name
        self.location = location

class Department(Base):
    __tablename__ = 'department'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)

    def __init__(self, name):
        self.name = name

class Person(Base):
    __tablename__ = 'person'

    id = Column(Integer, primary_key=True)
    name = Column(UnicodeText, nullable=False)
    first_name = Column(UnicodeText, nullable=True)
    first_surname = Column(UnicodeText, nullable=True)
    second_surname = Column(UnicodeText, nullable=True)
    gender = Column(UnicodeText, nullable=True)

    def __init__(self, name, first_name=None, first_surname=None, second_surname=None, gender=None):
        self.name = name
        self.first_name = first_name
        self.first_surname = first_surname
        self.second_surname = second_surname
        self.gender = gender

class Descriptor(Base):
    __tablename__ = 'descriptor'

    id = Column(Integer, primary_key=True)
    text = Column(UnicodeText, nullable=False)
    code = Column(Integer, nullable=True)

    parent_code = Column(Integer, ForeignKey('descriptor.id'))
    parent = relationship('Descriptor', remote_side=[id], backref='children')

    def __init__(self, text, code=None):
        self.text = text
        self.code = code

class Advisor(Base):
    __tablename__ = 'advisor'

    thesis_id = Column(Integer, ForeignKey('thesis.id', ondelete='cascade'), primary_key=True)
    thesis = relationship("Thesis")

    person_id = Column(Integer, ForeignKey('person.id', ondelete='cascade'), primary_key=True)
    person = relationship("Person")

    role = Column(UnicodeText, nullable=False)

    def __init__(self, person, role):
        self.person = person
        self.role = role
{'fraction_non_alphanumeric': 0.1087962962962963, 'fraction_numerical': 0.000462962962962963, 'mean_word_length': 4.107565011820331, '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': '6233349', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1310, 'n_words': 298}