<commit_before>import os, json, urllib2
from flask import Flask, render_template, request, make_response
from functools import wraps

from openarticlegauge.view.contact import blueprint as contact
from openarticlegauge.view.query import blueprint as query
from openarticlegauge.view.issue import blueprint as issue
from openarticlegauge.view.lookup import blueprint as lookup

from openarticlegauge.core import app

app.register_blueprint(contact, url_prefix='/contact')
app.register_blueprint(query, url_prefix='/query')
app.register_blueprint(issue, url_prefix='/issue')
app.register_blueprint(lookup, url_prefix='/lookup')


# static front page
@app.route('/')
def hello():
    return render_template('index.html')


# about page with a bit more info
@app.route('/about')
def about():
    return render_template('about.html')
<commit_msg>allow POST-ing to /lookup without trailing slash<commit_after>import os, json, urllib2
from flask import Flask, render_template, request, make_response
from functools import wraps

from openarticlegauge.view.contact import blueprint as contact
from openarticlegauge.view.query import blueprint as query
from openarticlegauge.view.issue import blueprint as issue
from openarticlegauge.view.lookup import blueprint as lookup

# breaks the blueprint abstraction but needed to allow /lookup route
# without trailing slash
from openarticlegauge.view.lookup import api_lookup

from openarticlegauge.core import app

app.register_blueprint(contact, url_prefix='/contact')
app.register_blueprint(query, url_prefix='/query')
app.register_blueprint(issue, url_prefix='/issue')

# allow POST-ing to /lookup without the trailing slash
# this definition has to come before the lookup blueprint is registered
@app.route('/lookup', methods=['POST'])
def lookup_without_trailing_slash():
    return api_lookup()

app.register_blueprint(lookup, url_prefix='/lookup')

# static front page
@app.route('/')
def hello():
    return render_template('index.html')


# about page with a bit more info
@app.route('/about')
def about():
    return render_template('about.html')

{'fraction_non_alphanumeric': 0.09125656951743909, 'fraction_numerical': 0.0009555661729574773, 'mean_word_length': 6.220689655172414, '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': '5275973', 'n_tokens_mistral': 617, 'n_tokens_neox': 589, 'n_words': 190}