<commit_before># # inside of a "create the database" script, first create
# # tables:
# my_metadata.create_all(engine)

# then, load the Alembic configuration and generate the
# version table, "stamping" it with the most recent rev:
import alembic.util
from alembic.config import Config
from alembic import command
from alembic.script import ScriptDirectory
import os

alembic_cfg = Config("%s/alembic.ini" % os.path.dirname(os.path.abspath(__file__)))
script = ScriptDirectory.from_config(alembic_cfg)


def run(connection_string):
    revision = "1eb29cd1981"
    alembic_cfg.set_main_option("sqlalchemy.url", connection_string)
    try:
        command.upgrade(alembic_cfg, revision)
    except alembic.util.CommandError:
        try:
            command.downgrade(alembic_cfg, revision)
        except alembic.util.CommandError:
            raise Exception("Could not upgrade to downgrade database to revision %s" % revision)<commit_msg>fix mistype in error text<commit_after># # inside of a "create the database" script, first create
# # tables:
# my_metadata.create_all(engine)

# then, load the Alembic configuration and generate the
# version table, "stamping" it with the most recent rev:
import alembic.util
from alembic.config import Config
from alembic import command
from alembic.script import ScriptDirectory
import os

alembic_cfg = Config("%s/alembic.ini" % os.path.dirname(os.path.abspath(__file__)))
script = ScriptDirectory.from_config(alembic_cfg)


def run(connection_string):
    revision = "1eb29cd1981"
    alembic_cfg.set_main_option("sqlalchemy.url", connection_string)
    try:
        command.upgrade(alembic_cfg, revision)
    except alembic.util.CommandError:
        try:
            command.downgrade(alembic_cfg, revision)
        except alembic.util.CommandError:
            raise Exception("Could not upgrade nor downgrade database to revision %s" % revision)
{'fraction_non_alphanumeric': 0.08548812664907651, 'fraction_numerical': 0.007387862796833773, 'mean_word_length': 4.371104815864022, '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': '4475660', 'n_tokens_mistral': 586, 'n_tokens_neox': 570, 'n_words': 157}