<commit_before>from flask import Flask
from flask import render_template
from flask import request
from flask import json


APP = Flask(__name__)


@APP.route('/')
def index():
    return render_template('index.html')


@APP.route('/diseases', methods=['GET', 'POST'])
def diseases():
    if request.method == 'POST':
        return return_diseases()
    else:
        print "inside else"
        return show_diseases()


def return_diseases():
    with open('diseases.json', 'r') as json_file:
        text = json_file.read()
    pythoned = json.loads(text)
    return json.jsonify(pythoned)


def show_diseases():
    return render_template('show.html')


if __name__ == '__main__':
    APP.run(debug=True)
<commit_msg>Small code prettification<commit_after>from flask import Flask
from flask import render_template
from flask import request
from flask import json


APP = Flask(__name__)


@APP.route('/')
def index():
    return render_template('index.html')


@APP.route('/diseases', methods=['GET', 'POST'])
def diseases():
    if request.method == 'POST':
        response = get_diseases()
    else:
        response = show_diseases()
    return response


def get_diseases():
    with open('diseases.json', 'r') as json_file:
        text = json_file.read()
    pythoned = json.loads(text)
    return json.jsonify(pythoned)


def show_diseases():
    return render_template('show.html')


if __name__ == '__main__':
    APP.run(debug=True)

{'fraction_non_alphanumeric': 0.12845303867403315, 'fraction_numerical': 0.0, 'mean_word_length': 3.735294117647059, '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': '5458460', 'n_tokens_mistral': 481, 'n_tokens_neox': 459, 'n_words': 121}