<commit_before>import datetime

import bcrypt
from flask import Flask, render_template, request, jsonify, flash, session, redirect, url_for
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from flask_heroku import Heroku
from flask_sqlalchemy import SQLAlchemy



app = Flask(__name__)
heroku = Heroku(app)
heroku.init_app(app)
db = SQLAlchemy(app)
from app import models
db.create_all([None])
username = "";



@app.route('/')
def index():
    if 'username' in session:
        features = models.Feature.query.filter(models.Feature.assigned == session['username']).order_by(
            models.Feature.clientPriority.asc())
        return render_template('home.html', name=session['username'], features=features)
    return render_template('index.html')


@app.route('/login', methods=['POST'])
def login():
    login_user = models.User.query.filter(models.User.name == request.form['username'])
    salt = bcrypt.gensalt()
    if login_user.count() == 1:
        for r in login_user:
            hashed = bcrypt.hashpw(request.form['pass'].encode('utf-8'), r.password)
            if hashed == r.password and request.form['username'] == r.name:
                session['username'] = request.form['username']
                session['userrole'] = r.role
                session['userid'] = r.id
                return redirect(url_for('index'))
    session.pop('_flashes', None)
    flash('User name or password does not match', 'error')
    return render_template('index.html')


@app.route('/register', methods=['POST', 'GET'])
def register():
    if request.method == 'POST':
        existing_user = models.User.query.filter(models.User.name == request.form['username']).count()
        if existing_user == 0:
            hashpass = bcrypt.hashpw(request.form['pass'].encode('utf-8'), bcrypt.gensalt())
            f = models.User(name=request.form['username'], password=<PASSWORD>, active=1)<commit_msg>deployed db<commit_after>import datetime

import bcrypt
from flask import Flask, render_template, request, jsonify, flash, session, redirect, url_for
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from flask_heroku import Heroku
from flask_sqlalchemy import SQLAlchemy



app = Flask(__name__)
heroku = Heroku(app)
heroku.init_app(app)
db = SQLAlchemy(app)
from app import models
db.create_all([None])
username = "";



@app.route('/')
def index():
    if 'username' in session:
        features = models.Feature.query.filter(models.Feature.assigned == session['username']).order_by(
            models.Feature.clientPriority.asc())
        return render_template('home.html', name=session['username'], features=features)
    return render_template('index.html')


@app.route('/login', methods=['POST'])
def login():
    login_user = models.User.query.filter(models.User.name == request.form['username'])
    salt = bcrypt.gensalt()
    if login_user.count() == 1:
        for r in login_user:
            hashed = bcrypt.hashpw(request.form['pass'].encode('utf-8'), r.password)
            if hashed == r.password and request.form['username'] == r.name:
                session['username'] = request.form['username']
                session['userrole'] = r.role
                session['userid'] = r.id
                return redirect(url_for('index'))
    session.pop('_flashes', None)
    flash('User name or password does not match', 'error')
    return render_template('index.html')


@app.route('/register', methods=['POST', 'GET'])
def register():
    if request.method == 'POST':
        existing_user = models.User.query.filter(models.User.name == request.form['username']).count()
        if existing_user == 0:
            hashpass = bcrypt.hashpw(request.form['pass'].encode('utf-8'), bcrypt.gensalt())
            f = models.User(name=request.form['username'], password=hashpass, active=True)
{'fraction_non_alphanumeric': 0.1462154482045983, 'fraction_numerical': 0.002324980625161457, 'mean_word_length': 3.6315789473684212, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '57215', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1116, 'n_words': 254}