<commit_before>from functools import wraps
import os

from flask import request, flash, redirect, render_template, abort, url_for
from flask.ext.login import current_user, login_user, logout_user, login_required

from foauth import OAuthDenied, OAuthError
import config
import forms
import models


@config.app.route('/')
def index():
    return render_template('index.html', login=forms.Login(), signup=forms.Signup())


@config.app.route('/about/')
def about():
    return render_template('about.html', login=forms.Login())


@config.app.route('/about/faq/')
def faq():
    return render_template('faq.html', login=forms.Login())


@config.app.route('/about/terms/')
def terms():
    return render_template('terms.html', login=forms.Login())


@config.app.route('/login/', methods=['POST'])
def login():
    form = forms.Login(request.form)
    if form.validate():
        user = models.User.query.filter_by(email=form.email.data).first()
        if user and user.check_password(form.password.data):
            login_user(user)
            return redirect(url_for('services'))
        else:
            flash('Incorrect login', 'error')
            return redirect(url_for('index'))
    else:
        return render_template('index.html', login=form, signup=forms.Signup())


@config.app.route('/logout/', methods=['GET'])
def logout():
    logout_user()
    return redirect(url_for('index'))
<commit_msg>Restrict some URLs to GET only<commit_after>from functools import wraps
import os

from flask import request, flash, redirect, render_template, abort, url_for
from flask.ext.login import current_user, login_user, logout_user, login_required

from foauth import OAuthDenied, OAuthError
import config
import forms
import models


@config.app.route('/', methods=['GET'])
def index():
    return render_template('index.html', login=forms.Login(), signup=forms.Signup())


@config.app.route('/about/', methods=['GET'])
def about():
    return render_template('about.html', login=forms.Login())


@config.app.route('/about/faq/', methods=['GET'])
def faq():
    return render_template('faq.html', login=forms.Login())


@config.app.route('/about/terms/', methods=['GET'])
def terms():
    return render_template('terms.html', login=forms.Login())


@config.app.route('/login/', methods=['POST'])
def login():
    form = forms.Login(request.form)
    if form.validate():
        user = models.User.query.filter_by(email=form.email.data).first()
        if user and user.check_password(form.password.data):
            login_user(user)
            return redirect(url_for('services'))
        else:
            flash('Incorrect login', 'error')
            return redirect(url_for('index'))
    else:
        return render_template('index.html', login=form, signup=forms.Signup())


@config.app.route('/logout/', methods=['GET'])
def logout():
    logout_user()
    return redirect(url_for('index'))

{'fraction_non_alphanumeric': 0.1559158330458779, 'fraction_numerical': 0.0, 'mean_word_length': 4.178571428571429, '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': '25186', 'n_tokens_mistral': 898, 'n_tokens_neox': 874, 'n_words': 195}