<commit_before>#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# 创建user表:
# uid
# username
# password
# info
#
#
# 创建keycount表
# uid
# keycount
# date
#
import MySQLdb
import datetime
from flask import Flask, request, render_template, url_for
from flask.ext.restful import Resource, Api
from gevent.wsgi import WSGIServer


app = Flask(__name__)
api = Api(app)
app.jinja_env.variable_start_string = '{{ '
app.jinja_env.variable_end_string = ' }}'

DB_CONFIG = {
    "host": "localhost",
    "user": "root",
    "passwd": "<PASSWORD>",
    "db": "ws",
    "charset": "utf8"
}


def db_connection():
    global DB_CONFIG
    return MySQLdb.connect(
        host=DB_CONFIG['host'],
        user=DB_CONFIG['user'],
        passwd=DB_CONFIG['passwd'],
        db=DB_CONFIG['db'],
        charset=DB_CONFIG['charset'])


# API首页
@app.route('/')
def index():
    return render_template('index.html')

<commit_msg>modify db name<commit_after>#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# 创建user表:
# uid
# username
# password
# info
#
#
# 创建keycount表
# uid
# keycount
# date
#
import MySQLdb
import datetime
from flask import Flask, request, render_template, url_for
from flask.ext.restful import Resource, Api
from gevent.wsgi import WSGIServer


app = Flask(__name__)
api = Api(app)
app.jinja_env.variable_start_string = '{{ '
app.jinja_env.variable_end_string = ' }}'

DB_CONFIG = {
    "host": "localhost",
    "user": "root",
    "passwd": "<PASSWORD>",
    "db": "keycount",
    "charset": "utf8"
}


def db_connection():
    global DB_CONFIG
    return MySQLdb.connect(
        host=DB_CONFIG['host'],
        user=DB_CONFIG['user'],
        passwd=DB_CONFIG['passwd'],
        db=DB_CONFIG['db'],
        charset=DB_CONFIG['charset'])


# API首页
@app.route('/')
def index():
    return render_template('index.html')


{'fraction_non_alphanumeric': 0.1574023115024766, 'fraction_numerical': 0.002201430930104568, 'mean_word_length': 3.673521850899743, 'pattern_counts': {'":': 10, '<': 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': '2293965', 'n_tokens_mistral': 683, 'n_tokens_neox': 661, 'n_words': 136}