<commit_before># -*- coding: utf-8 -*-
from flask import Flask
from flask import abort
from flask import request
from flask import render_template
from flask import Markup

import markdown
from htmldiff import htmldiff

app = Flask(__name__)


@app.route('/', methods=['GET'])
def home():
    with open('README.md', 'r') as f:
        content = f.read()

    return render_template('base.html', content=Markup(markdown.markdown(content)))


@app.route('/wtd', methods=['POST'])
def wtd():

    a = request.form.get('a').encode('utf-8').strip()
    b = request.form.get('b').encode('utf-8').strip()

    if a is None or b is None:
        abort(400)


    diff = htmldiff.htmldiff(a, b, accurate_mode=True, addStylesheet=True)
    return diff


if __name__ == '__main__':
    app.debug = True
    app.run()<commit_msg>turned accurate mode off and saved 10 seconds<commit_after># -*- coding: utf-8 -*-
from flask import Flask
from flask import abort
from flask import request
from flask import render_template
from flask import Markup

import markdown
from htmldiff import htmldiff

app = Flask(__name__)


@app.route('/', methods=['GET'])
def home():
    with open('README.md', 'r') as f:
        content = f.read()

    return render_template('base.html', content=Markup(markdown.markdown(content)))


@app.route('/wtd', methods=['POST'])
def wtd():

    a = request.form.get('a').encode('utf-8').strip()
    b = request.form.get('b').encode('utf-8').strip()

    if a is None or b is None:
        abort(400)


    diff = htmldiff.htmldiff(a, b, accurate_mode=False, addStylesheet=True)
    return diff


if __name__ == '__main__':
    app.debug = True
    app.run()
{'fraction_non_alphanumeric': 0.15116976604679064, 'fraction_numerical': 0.008398320335932814, 'mean_word_length': 3.6853932584269664, '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': '266928', 'n_tokens_mistral': 583, 'n_tokens_neox': 547, 'n_words': 156}