<commit_before>from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig

# So we can use the same config module for migrations as elsewhere,
# add ../ to the path. This is a horrid, horrid thing I do, and I
# blame both python and alembic.
import sys
import os
sys.path.append(
    os.path.abspath(
        os.path.join(os.path.dirname(__file__),
                     os.path.pardir)))

from app.db import db

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Override db connection with our global flask_app config's
config.set_main_option("sqlalchemy.url", os.environ['DATABASE_URL'])

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = db.metadata

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.


def run_migrations_offline():
    """Run migrations in 'offline' mode.

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation<commit_msg>Update env.py<commit_after>from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig

# So we can use the same config module for migrations as elsewhere,
# add ../ to the path. This is a horrid, horrid thing I do, and I
# blame both python and alembic.
import sys
import os
sys.path.append(
    os.path.abspath(
        os.path.join(os.path.dirname(__file__),
                     os.path.pardir)))

from ..app.db import db

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Override db connection with our global flask_app config's
config.set_main_option("sqlalchemy.url", os.environ['DATABASE_URL'])

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = db.metadata

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.


def run_migrations_offline():
    """Run migrations in 'offline' mode.

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation
{'fraction_non_alphanumeric': 0.0728952772073922, 'fraction_numerical': 0.0, 'mean_word_length': 4.030981067125645, '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': '5170787', 'n_tokens_mistral': 857, 'n_tokens_neox': 838, 'n_words': 340}