<commit_before>from uber.common import *


@entry_point
def print_config():
    """
    print all config values to stdout, used for debugging / status checking
    useful if you want to verify that Ubersystem has pulled in the INI values you think it has.
    """
    from uber.config import _config
    pprint(_config.dict())


@entry_point
def insert_admin():
    with Session() as session:
        attendee = Attendee(
            placeholder=True,
            first_name='Test',
            last_name='Developer',
            email='<EMAIL>',
            badge_type=c.ATTENDEE_BADGE,
        )
        session.add(attendee)
        session.add(AdminAccount(
            attendee=attendee,
            access=','.join(str(level) for level, name in c.ACCESS_OPTS),
            hashed=bcrypt.hashpw('magfest', bcrypt.gensalt())
        ))


@entry_point
def reset_uber_db():
    assert c.DEV_BOX, 'reset_uber_db is only available on development boxes'
    Session.initialize_db(drop=True)
    insert_admin()<commit_msg>add modify_tables=True to sep reset_uber_db<commit_after>from uber.common import *


@entry_point
def print_config():
    """
    print all config values to stdout, used for debugging / status checking
    useful if you want to verify that Ubersystem has pulled in the INI values you think it has.
    """
    from uber.config import _config
    pprint(_config.dict())


@entry_point
def insert_admin():
    with Session() as session:
        attendee = Attendee(
            placeholder=True,
            first_name='Test',
            last_name='Developer',
            email='<EMAIL>',
            badge_type=c.ATTENDEE_BADGE,
        )
        session.add(attendee)
        session.add(AdminAccount(
            attendee=attendee,
            access=','.join(str(level) for level, name in c.ACCESS_OPTS),
            hashed=bcrypt.hashpw('magfest', bcrypt.gensalt())
        ))


@entry_point
def reset_uber_db():
    assert c.DEV_BOX, 'reset_uber_db is only available on development boxes'
    Session.initialize_db(drop=True, modify_tables=True)
    insert_admin()
{'fraction_non_alphanumeric': 0.09617224880382776, 'fraction_numerical': 0.0, 'mean_word_length': 2.681338028169014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3353788', 'n_tokens_mistral': 633, 'n_tokens_neox': 628, 'n_words': 162}