<commit_before>from flask import Flask
from flask import render_template, abort, request, url_for, redirect, jsonify, make_response
from flask.ext.seasurf import SeaSurf
from flask.ext.assets import Environment, Bundle
from flask_debugtoolbar import DebugToolbarExtension
from markdown import markdown

from . import __version__
from config import CONFIG as cfg
import db
from models import Experiment
import utils

app = Flask(__name__)
csrf = SeaSurf(app)

js = Bundle('js/jquery.js', 'js/d3.js',
            'js/bootstrap.js', 'js/experiment.js', 'js/chart.js',
            'js/sixpack.js', 'js/underscore-min.js', 'js/spin.min.js',
            'js/waypoints.min.js', 'js/zeroclipboard.min.js',
            filters=['closure_js'],
            output="{0}/sixpack.js".format(cfg.get('asset_path', 'gen')))

css = Bundle('css/bootstrap.css',
             'css/bootstrap-responsive.css', 'css/sixpack.css',
             filters=['yui_css'],
             output="{0}/sixpack.css".format(cfg.get('asset_path', 'gen')))

assets = Environment(app)
assets.register('js_all', js)
assets.register('css_all', css)


@app.route('/_status')
@utils.service_unavailable_on_connection_error
def status():
    db.REDIS.ping()
    return utils.json_success({'version': __version__}, request)


# List of experiments
@app.route("/")
def hello():
    experiments = Experiment.all(db.REDIS)
    experiments = [exp.name for exp in experiments]
    return render_template('dashboard.html', experiments=experiments)<commit_msg>kill unnecessary comment<commit_after>from flask import Flask
from flask import render_template, abort, request, url_for, redirect, jsonify, make_response
from flask.ext.seasurf import SeaSurf
from flask.ext.assets import Environment, Bundle
from flask_debugtoolbar import DebugToolbarExtension
from markdown import markdown

from . import __version__
from config import CONFIG as cfg
import db
from models import Experiment
import utils

app = Flask(__name__)
csrf = SeaSurf(app)

js = Bundle('js/jquery.js', 'js/d3.js',
            'js/bootstrap.js', 'js/experiment.js', 'js/chart.js',
            'js/sixpack.js', 'js/underscore-min.js', 'js/spin.min.js',
            'js/waypoints.min.js', 'js/zeroclipboard.min.js',
            filters=['closure_js'],
            output="{0}/sixpack.js".format(cfg.get('asset_path', 'gen')))

css = Bundle('css/bootstrap.css',
             'css/bootstrap-responsive.css', 'css/sixpack.css',
             filters=['yui_css'],
             output="{0}/sixpack.css".format(cfg.get('asset_path', 'gen')))

assets = Environment(app)
assets.register('js_all', js)
assets.register('css_all', css)


@app.route('/_status')
@utils.service_unavailable_on_connection_error
def status():
    db.REDIS.ping()
    return utils.json_success({'version': __version__}, request)


@app.route("/")
def hello():
    experiments = Experiment.all(db.REDIS)
    experiments = [exp.name for exp in experiments]
    return render_template('dashboard.html', experiments=experiments)
{'fraction_non_alphanumeric': 0.1409530156614462, 'fraction_numerical': 0.001999333555481506, 'mean_word_length': 4.028475711892797, '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': '7507242', 'n_tokens_mistral': 964, 'n_tokens_neox': 938, 'n_words': 208}