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

"""
byceps.services.shop.sequence.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2016 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

from enum import Enum

from sqlalchemy.ext.hybrid import hybrid_property

from ....database import db
from ....util.instances import ReprBuilder


Purpose = Enum('Purpose', ['article', 'order'])


class PartySequence(db.Model):
    """A sequence for a party and a purpose."""
    __tablename__ = 'shop_party_sequences2'

    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'), primary_key=True)
    _purpose = db.Column('purpose', db.Unicode(20), primary_key=True)
    prefix = db.Column(db.Unicode(20), unique=True, nullable=False)
    value = db.Column(db.Integer, default=0, nullable=False)

    def __init__(self, party_id, purpose, prefix):
        self.party_id = party_id
        self.purpose = purpose
        self.prefix = prefix

    @hybrid_property
    def purpose(self):
        return Purpose[self._purpose]<commit_msg>Fix table name<commit_after># -*- coding: utf-8 -*-

"""
byceps.services.shop.sequence.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2016 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

from enum import Enum

from sqlalchemy.ext.hybrid import hybrid_property

from ....database import db
from ....util.instances import ReprBuilder


Purpose = Enum('Purpose', ['article', 'order'])


class PartySequence(db.Model):
    """A sequence for a party and a purpose."""
    __tablename__ = 'shop_party_sequences'

    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'), primary_key=True)
    _purpose = db.Column('purpose', db.Unicode(20), primary_key=True)
    prefix = db.Column(db.Unicode(20), unique=True, nullable=False)
    value = db.Column(db.Integer, default=0, nullable=False)

    def __init__(self, party_id, purpose, prefix):
        self.party_id = party_id
        self.purpose = purpose
        self.prefix = prefix

    @hybrid_property
    def purpose(self):
        return Purpose[self._purpose]
{'fraction_non_alphanumeric': 0.16396568160152525, 'fraction_numerical': 0.01572926596758818, 'mean_word_length': 3.985748218527316, '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': '6945934', 'n_tokens_mistral': 691, 'n_tokens_neox': 634, 'n_words': 157}