<commit_before>import random
from faker import Faker
from .. import db
from sqlalchemy.orm import validates

class CompletedApplication(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    student_profile_id = db.Column(
        db.Integer, db.ForeignKey('student_profile.id'), nullable=False)
    # college name
    college = db.Column(db.String, index=True)
    # statuses include 'Pending Results', 'Accepted', 'Denied', 'Waitlisted',
    #    'Deferred'
    status = db.Column(db.String, index=True)

    @validates('status')
    def validate_status(self, key, status):
        assert status in ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
        return status

    @staticmethod
    def generate_fake(count=2):
        fake = Faker()
        names = random.sample([
            'Cornell',
            'Princeton',
            'University of Florida',
            'University of Richmond',
        ], count)
        statuses = ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
        comp_apps = []
        for i in range(count):
            comp_apps.append(
                CompletedApplication(
                    college=names[i],
                    status=random.choice(statuses)))
        return comp_apps

    def __repr__(self):
        return '<CompletedApplication {}, {}>'.format(
            self.name, self.status)<commit_msg>Fix __repr__ bug for CompletedApplication<commit_after>import random
from faker import Faker
from .. import db
from sqlalchemy.orm import validates

class CompletedApplication(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    student_profile_id = db.Column(
        db.Integer, db.ForeignKey('student_profile.id'), nullable=False)
    # college name
    college = db.Column(db.String, index=True)
    # statuses include 'Pending Results', 'Accepted', 'Denied', 'Waitlisted',
    #    'Deferred'
    status = db.Column(db.String, index=True)

    @validates('status')
    def validate_status(self, key, status):
        assert status in ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
        return status

    @staticmethod
    def generate_fake(count=2):
        fake = Faker()
        names = random.sample([
            'Cornell',
            'Princeton',
            'University of Florida',
            'University of Richmond',
        ], count)
        statuses = ['Pending Results', 'Accepted', 'Denied', 'Waitlisted', 'Deferred']
        comp_apps = []
        for i in range(count):
            comp_apps.append(
                CompletedApplication(
                    college=names[i],
                    status=random.choice(statuses)))
        return comp_apps

    def __repr__(self):
        return '<CompletedApplication {}, {}>'.format(
            self.college, self.status)

{'fraction_non_alphanumeric': 0.11943462897526502, 'fraction_numerical': 0.0007067137809187279, 'mean_word_length': 2.503712871287129, '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': '2869132', 'n_tokens_mistral': 802, 'n_tokens_neox': 788, 'n_words': 195}