<commit_before>from flask.ext.script import Manager
from flask.ext.alembic import ManageMigrations
import os

from starter import app, db
from starter.users.models import user_datastore


manager = Manager(app)
manager.add_command("migrate", ManageMigrations())


@manager.command
def add_admin(email, password):
    user = user_datastore.create_user(email=email, password=password)

    admin_role = user_datastore.find_or_create_role("admin")
    user_datastore.add_role_to_user(user, admin_role)

    db.session.commit()
    print "Created admin user: %s" % (user, )


@manager.command
def init(name):
    print "Initializing flask-starter project with name '%s'" % (name, )

    module_name = "_".join(name.split()).lower()
    print "Python main module will be:", module_name

    module_files = ["manage.py", "dev.py", "shell.py"]

    for filename in module_files:
        print "Updating module name in '%s'" % (filename, )

        with open(filename) as f:
            lines = [l.replace("starter", module_name) for l in f.readlines()]

        with open(filename, 'w') as f:
            f.writelines(lines)

    print "Renaming 'starter' module to '%s'" % (module_name, )
    os.rename("starter", module_name)


if __name__ == "__main__":
    manager.run()<commit_msg>Update config file with updated project name<commit_after>from flask.ext.script import Manager
from flask.ext.alembic import ManageMigrations
import os

from starter import app, db
from starter.users.models import user_datastore


manager = Manager(app)
manager.add_command("migrate", ManageMigrations())


@manager.command
def add_admin(email, password):
    user = user_datastore.create_user(email=email, password=password)

    admin_role = user_datastore.find_or_create_role("admin")
    user_datastore.add_role_to_user(user, admin_role)

    db.session.commit()
    print "Created admin user: %s" % (user, )


@manager.command
def init(name):
    print "Initializing flask-starter project with name '%s'" % (name, )

    module_name = "_".join(name.split()).lower()
    print "Python main module will be:", module_name

    module_files = ["manage.py", "dev.py", "shell.py", "starter/config.py"]

    for filename in module_files:
        print "Updating module name in '%s'" % (filename, )

        with open(filename) as f:
            lines = [l.replace("starter", module_name) for l in f.readlines()]

        with open(filename, 'w') as f:
            f.writelines(lines)

    print "Renaming 'starter' module to '%s'" % (module_name, )
    os.rename("starter", module_name)


if __name__ == "__main__":
    manager.run()
{'fraction_non_alphanumeric': 0.12452107279693486, 'fraction_numerical': 0.0, 'mean_word_length': 3.871268656716418, 'pattern_counts': {'":': 2, '<': 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': '3450872', 'n_tokens_mistral': 859, 'n_tokens_neox': 817, 'n_words': 218}