<commit_before>"""
jobber.models
~~~~~~~~~~~~~

Model declarations.

"""
from pprint import pformat
from jobber.extensions import db


class BaseModel(db.Model):
    __abstract__ = True

    SKIP_ON_SET = frozenset(['id'])

    def __init__(self, *args, **kwargs):
        self.set_all(**kwargs)

    def __repr__(self):
        name = self.__class__.__name__.capitalize()
        attrs = dict()
        for column in self.__table__.columns:
            attrs[column.name] = getattr(self, column.name)
        return "<{} {}>".format(name, pformat(attrs))

    def set_all(self, **kwargs):
        """Sets all property values of this instance from `kwargs`."""
        for key, value in kwargs.iteritems():
            if key in self.SKIP_ON_SET:
                continue
            if hasattr(self, key):
                setattr(self, key, value)


class Company(BaseModel):
    __tablename__ = 'companies'

    #: Company id.
    id = db.Column(db.Integer, primary_key=True)
<commit_msg>Remove code that already exists in sqlalchemy<commit_after>"""
jobber.models
~~~~~~~~~~~~~

Model declarations.

"""
from pprint import pformat
from jobber.extensions import db


class BaseModel(db.Model):
    __abstract__ = True

    def __repr__(self):
        name = self.__class__.__name__.capitalize()
        attrs = dict()
        for column in self.__table__.columns:
            attrs[column.name] = getattr(self, column.name)
        return "<{} {}>".format(name, pformat(attrs))


class Company(BaseModel):
    __tablename__ = 'companies'

    #: Company id.
    id = db.Column(db.Integer, primary_key=True)

{'fraction_non_alphanumeric': 0.13424487259167184, 'fraction_numerical': 0.0, 'mean_word_length': 2.851674641148325, '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': '7343580', 'n_tokens_mistral': 502, 'n_tokens_neox': 481, 'n_words': 123}