<commit_before>from bottle import Bottle, request, response, template, redirect, error
from sqlalchemy import desc, and_, or_
from bottle.ext import sqlalchemy
from bukget.config import config
import bukget.db as db
import bukget.api as api
import datetime
import time
import json

app = Bottle()
app.install(sqlalchemy.Plugin(db.disk, db.Base.metadata, keyword='s'))

def jsonify(dataset):
    return json.dumps(dataset)


def getdict(plugin, version_name=None):
    if plugin is None:
        return {'error': 'Plugin %s does not exist' % name}

    out = {
        'name': plugin.name,
        'bukkitdev_link': 'http://dev.bukkit.org/server-mods/%s/' % plugin.plugname,
        'categories': [c.name for c in plugin.categories],
        'desc': plugin.description,
        'plugin_name': plugin.plugname,
        'status': plugin.stage,
        'versions': []
    }
    if version_name == 'latest':
        version_name = plugin.versions[0].name

    for version in plugin.versions:
        if version_name is not None and version.name == version_name or\
           not version_name:
            out['versions'].append({
                    'name': version.version,
                    'date': int(time.mktime(version.date.timetuple())),
                    'dl_link': version.link,
                    'filename': version.filename,
                    'game_builds': version.game_versions,
                    'hard_dependencies': version.hard_dependencies,
                    'soft_dependencies': version.soft_dependencies,
                    'status': version.status,
                    'type': version.type,<commit_msg>Version.name should be Version.version<commit_after>from bottle import Bottle, request, response, template, redirect, error
from sqlalchemy import desc, and_, or_
from bottle.ext import sqlalchemy
from bukget.config import config
import bukget.db as db
import bukget.api as api
import datetime
import time
import json

app = Bottle()
app.install(sqlalchemy.Plugin(db.disk, db.Base.metadata, keyword='s'))

def jsonify(dataset):
    return json.dumps(dataset)


def getdict(plugin, version_name=None):
    if plugin is None:
        return {'error': 'Plugin %s does not exist' % name}

    out = {
        'name': plugin.name,
        'bukkitdev_link': 'http://dev.bukkit.org/server-mods/%s/' % plugin.plugname,
        'categories': [c.name for c in plugin.categories],
        'desc': plugin.description,
        'plugin_name': plugin.plugname,
        'status': plugin.stage,
        'versions': []
    }
    if version_name == 'latest':
        version_name = plugin.versions[0].version

    for version in plugin.versions:
        if version_name is not None and version.version == version_name or\
           not version_name:
            out['versions'].append({
                    'name': version.version,
                    'date': int(time.mktime(version.date.timetuple())),
                    'dl_link': version.link,
                    'filename': version.filename,
                    'game_builds': version.game_versions,
                    'hard_dependencies': version.hard_dependencies,
                    'soft_dependencies': version.soft_dependencies,
                    'status': version.status,
                    'type': version.type,
{'fraction_non_alphanumeric': 0.11175220163984209, 'fraction_numerical': 0.0006073489219556636, 'mean_word_length': 2.388888888888889, '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': '5955998', 'n_tokens_mistral': 940, 'n_tokens_neox': 899, 'n_words': 240}