@contextmanager<EOL>def temp_alembic_ini(alembic_dir_location, sqlalchemy_url):
with TemporaryDirectory() as tempdir:<EOL><INDENT>alembic_ini_filename = join(tempdir, '<STR_LIT>')<EOL>with open(alembic_ini_filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(<EOL>ALEMBIC_INI_TEMPLATE.format(<EOL>alembic_dir_location=alembic_dir_location,<EOL>sqlalchemy_url=sqlalchemy_url,<EOL>)<EOL>)<EOL><DEDENT>yield alembic_ini_filename<EOL><DEDENT>
Temporarily write an alembic.ini file for use with alembic migration
scripts.