<commit_before>from application import app, cache
from flask import render_template
from application.models import Healthcare
from application.forms import Search, SERVICES

healthcare = Healthcare()


@app.route('/', methods=["GET", "POST"])
def index():
    form = Search()
    if form.validate_on_submit():
        service = dict(SERVICES).get(form.service.data)
        data = {}
        query = ''
        if form.city.data:
            query = form.city.data.strip().title()
            data = healthcare.find_by_city(form.service.data, query)
        elif form.name.data:
            query = form.name.data.strip()
            data = healthcare.find_by_name(form.service.data, query)
        elif form.postcode.data:
            query = form.postcode.data.strip().upper()
            data = healthcare.find_by_postcode(form.service.data, query)
        elif form.county.data:
            query = form.county.data.strip().title()
            data = healthcare.find_by_county(form.service.data, query)

        return render_template(
            'index.html',
            data=data,
            service=service,
            query=query,
            form=form
        )
    return render_template(
        'index.html',
        form=form
    )


@app.route('/about', methods=["GET"])
@cache.cached(timeout=3600)<commit_msg>formatting<commit_after>from application import app, cache
from flask import render_template
from application.models import Healthcare
from application.forms import Search, SERVICES

healthcare = Healthcare()


@app.route('/', methods=["GET", "POST"])
def index():
    form = Search()
    if form.validate_on_submit():
        service = dict(SERVICES).get(form.service.data)
        data = {}
        query = ''
        if form.city.data:
            query = form.city.data.strip().title()
            data = healthcare.find_by_city(form.service.data, query)
        elif form.name.data:
            query = form.name.data.strip()
            data = healthcare.find_by_name(form.service.data, query)
        elif form.postcode.data:
            query = form.postcode.data.strip().upper()
            data = healthcare.find_by_postcode(form.service.data, query)
        elif form.county.data:
            query = form.county.data.strip().title()
            data = healthcare.find_by_county(form.service.data, query)

        return render_template(
            'index.html',
            data=data,
            service=service,
            query=query,
            form=form
        )

    return render_template(
        'index.html',
        form=form
    )


@app.route('/about', methods=["GET"])
@cache.cached(timeout=3600)
{'fraction_non_alphanumeric': 0.12132629992464206, 'fraction_numerical': 0.003014318010550113, 'mean_word_length': 2.269704433497537, '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': '616813', 'n_tokens_mistral': 767, 'n_tokens_neox': 742, 'n_words': 149}