<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
import json
from datetime import datetime, timedelta, date

from pony.orm import *

import gcfg

#sql_debug(True)
db = Database()

class Repo(db.Entity):
    name = Required(unicode, unique=True)
    author = Optional(unicode)
    description = Optional(str)
    created = Optional(datetime)
    updated = Optional(datetime)
    view_count = Optional(int, default=0)
    down_count = Optional(int, default=0)
    builds = Set("Build")

class Build(db.Entity):
    repo = Optional(Repo)
    downloadable = Optional(bool, default=False)
    tag = Optional(unicode)
    sha = Optional(unicode)
    updated = Optional(datetime)
    down_count = Optional(int, default=0)
    files = Set("File")
    jobs = Set("Job")
    latest_job = Optional(int, default=0)
    osarchs = Optional(LongStr) # json data: [{"windows": ["amd64", "386"], ...]

    status = Optional(unicode) # ?
    time_used = Optional(int) # ?
    version = Optional(unicode) #?

    composite_key(repo, tag)

class Job(db.Entity):
    build = Required(Build)
    status = Optional(unicode, default='initing')
    created = Optional(datetime)
    updated = Optional(datetime)<commit_msg>add some class<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
import json
from datetime import datetime, timedelta, date

from pony.orm import *

import gcfg

#sql_debug(True)
db = Database()

class Repo(db.Entity):
    name = Required(unicode, unique=True)
    author = Optional(unicode)
    description = Optional(str)
    created = Optional(datetime)
    updated = Optional(datetime)
    view_count = Optional(int, default=0)
    down_count = Optional(int, default=0)
    builds = Set("Build")

class Category(db.Entity):
    name = Required(unicode, unique=True)

class Recommend(db.Entity):
    repo = Optional(Repo)
    name = Optional(unicode)
    created = Optional(datetime)
    updated = Optional(datetime)
    checked = Optional(bool, default=False)

class Build(db.Entity):
    repo = Optional(Repo)
    downloadable = Optional(bool, default=False)
    tag = Optional(unicode)
    sha = Optional(unicode)
    updated = Optional(datetime)
    down_count = Optional(int, default=0)
    files = Set("File")
    jobs = Set("Job")
    latest_job = Optional(int, default=0)
    osarchs = Optional(LongStr) # json data: [{"windows": ["amd64", "386"], ...]

    status = Optional(unicode) # ?
    time_used = Optional(int) # ?
    version = Optional(unicode) #?

    composite_key(repo, tag)

class Job(db.Entity):
    build = Required(Build)
    status = Optional(unicode, default='initing')
    created = Optional(datetime)
    updated = Optional(datetime)
{'fraction_non_alphanumeric': 0.13215208564045774, 'fraction_numerical': 0.007382798080472499, 'mean_word_length': 3.7795414462081127, 'pattern_counts': {'":': 2, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5580372', 'n_tokens_mistral': 857, 'n_tokens_neox': 828, 'n_words': 203}