<commit_before># -*- coding: utf-8 -*-

from gevent import monkey; monkey.patch_all()

from haven.contrib.ws_haven import WSHaven
from kola_box import KolaBox

app = WSHaven('/echo', None, KolaBox)


@app.route(1)
def index(request):
    print repr(request)
    request.write(dict(
        ret=1,
        body='ok haha'
    ))

if __name__ == '__main__':
    app.run('127.0.0.1', 8000)
<commit_msg>增加个flask_app，兼容http<commit_after># -*- coding: utf-8 -*-

from gevent import monkey; monkey.patch_all()

from haven.contrib.ws_haven import WSHaven
from kola_box import KolaBox
from flask import Flask

flask_app = Flask(__name__)


@flask_app.route('/http')
def http():
    return u'http ok'

app = WSHaven('/echo', flask_app, KolaBox)


@app.route(1)
def index(request):
    print repr(request)
    request.write(dict(
        ret=1,
        body='ok haha'
    ))

if __name__ == '__main__':
    app.run('127.0.0.1', 8000)

{'fraction_non_alphanumeric': 0.14533622559652928, 'fraction_numerical': 0.028199566160520606, 'mean_word_length': 3.4589371980676327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6856504', 'n_tokens_mistral': 372, 'n_tokens_neox': 348, 'n_words': 80}