<commit_before>from gevent import monkey
monkey.patch_all()

import os
import redis

from cyoa import app, redis_db, socketio, db
from cyoa.models import Wizard
from flask.ext.script import Manager, Shell

manager = Manager(app)

def make_shell_context():
    return dict(app=app, redis_db=redis_db, db=db, Wizard=Wizard)

manager.add_command("shell", Shell(make_context=make_shell_context))

@manager.command
def syncdb():
    db.create_all()

@manager.command
def runserver():
    socketio.run(app, "0.0.0.0", port=5001)

@manager.command
def clear_redis():
    redis_cli = redis.StrictRedis(host='localhost', port='6379', db='0')
    redis_cli.delete('done')
    redis_cli.delete('more')
    redis_cli.delete('yes')
    redis_cli.delete('no')

if __name__ == '__main__':
    manager.run()
<commit_msg>adding shortcut command to add wizards<commit_after>from gevent import monkey
monkey.patch_all()

import os
import redis

from cyoa import app, redis_db, socketio, db
from cyoa.models import Wizard
from flask.ext.script import Manager, Shell

manager = Manager(app)

def make_shell_context():
    return dict(app=app, redis_db=redis_db, db=db, Wizard=Wizard)

manager.add_command("shell", Shell(make_context=make_shell_context))

@manager.command
def syncdb():
    db.create_all()

@manager.command
def runserver():
    socketio.run(app, "0.0.0.0", port=5001)

@manager.command
def create_wizard(name, password):
    db.session.add(Wizard(name, password))
    db.session.commit()

@manager.command
def clear_redis():
    redis_cli = redis.StrictRedis(host='localhost', port='6379', db='0')
    redis_cli.delete('done')
    redis_cli.delete('more')
    redis_cli.delete('yes')
    redis_cli.delete('no')

if __name__ == '__main__':
    manager.run()

{'fraction_non_alphanumeric': 0.13405590416428978, 'fraction_numerical': 0.014831717056474614, 'mean_word_length': 5.1978798586572434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3155428', 'n_tokens_mistral': 643, 'n_tokens_neox': 626, 'n_words': 134}