<commit_before>from datetime import datetime
from flask import flash, redirect, render_template, request, url_for, jsonify
from flask.ext.login import (current_user, login_required, login_user,
                             logout_user)
from flask.ext.rq import get_queue
import requests
import time
import os, json, boto3
from . import account
from .. import db
from ..email import send_email
from ..models import User
from .forms import (ChangeEmailForm, ChangePasswordForm, CreatePasswordForm,
                    LoginForm, RegistrationForm, RequestResetPasswordForm,
                    ResetPasswordForm)
from app import csrf

@account.route('/login', methods=['GET', 'POST'])
def login():
    """Log in an existing user."""
    form = LoginForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        if user is not None and user.password_hash is not None and \
                user.verify_password(form.password.data):
            login_user(user, form.remember_me.data)
            flash('You are now logged in. Welcome back!', 'success')
            return redirect(request.args.get('next') or url_for('main.index'))
        else:
            flash('Invalid email or password.', 'form-error')
    return render_template('account/login.html', form=form)

@account.route('/logout')<commit_msg>got rid of requests<commit_after>from datetime import datetime
from flask import flash, redirect, render_template, request, url_for, jsonify
from flask.ext.login import (current_user, login_required, login_user,
                             logout_user)
from flask.ext.rq import get_queue
import time
import os, json, boto3
from . import account
from .. import db
from ..email import send_email
from ..models import User
from .forms import (ChangeEmailForm, ChangePasswordForm, CreatePasswordForm,
                    LoginForm, RegistrationForm, RequestResetPasswordForm,
                    ResetPasswordForm)
from app import csrf

@account.route('/login', methods=['GET', 'POST'])
def login():
    """Log in an existing user."""
    form = LoginForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        if user is not None and user.password_hash is not None and \
                user.verify_password(form.password.data):
            login_user(user, form.remember_me.data)
            flash('You are now logged in. Welcome back!', 'success')
            return redirect(request.args.get('next') or url_for('main.index'))
        else:
            flash('Invalid email or password.', 'form-error')
    return render_template('account/login.html', form=form)

@account.route('/logout')
{'fraction_non_alphanumeric': 0.10296296296296296, 'fraction_numerical': 0.0007407407407407407, 'mean_word_length': 3.0924242424242423, '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': '5407121', 'n_tokens_mistral': 729, 'n_tokens_neox': 714, 'n_words': 224}