# Path: alembic/util/sqla_compat.py
# _CE = TypeVar("_CE", bound=Union["ColumnElement", "SchemaItem"])
# AUTOINCREMENT_DEFAULT = "auto"
# def _safe_int(value: str) -> Union[int, str]:
# def _ensure_scope_for_ddl(
#     connection: Optional["Connection"],
# ) -> Iterator[None]:
# def _safe_begin_connection_transaction(
#     connection: "Connection",
# ) -> "Transaction":
# def _get_connection_in_transaction(connection: Optional["Connection"]) -> bool:
# def _copy(schema_item: _CE, **kw) -> _CE:
# def _get_connection_transaction(
#     connection: "Connection",
# ) -> Optional["Transaction"]:
# def _create_url(*arg, **kw) -> url.URL:
# def _connectable_has_table(
#     connectable: "Connection", tablename: str, schemaname: Union[str, None]
# ) -> bool:
# def _exec_on_inspector(inspector, statement, **params):
# def _nullability_might_be_unset(metadata_column):
# def _server_default_is_computed(*server_default) -> bool:
# def _server_default_is_identity(*server_default) -> bool:
# def _table_for_constraint(constraint: "Constraint") -> "Table":
# def _columns_for_constraint(constraint):
# def _reflect_table(
#     inspector: "Inspector", table: "Table", include_cols: None
# ) -> None:
# def _fk_spec(constraint):
# def _fk_is_self_referential(constraint: "ForeignKeyConstraint") -> bool:
# def _is_type_bound(constraint: "Constraint") -> bool:
# def _find_columns(clause):
# def _remove_column_from_collection(
#     collection: "ColumnCollection", column: Union["Column", "ColumnClause"]
# ) -> None:
# def _textual_index_column(
#     table: "Table", text_: Union[str, "TextClause", "ColumnElement"]
# ) -> Union["ColumnElement", "Column"]:
# def _copy_expression(expression: _CE, target_table: "Table") -> _CE:
#     def replace(col):
#     def __init__(self, table: "Table", text: "TextClause") -> None:
#     def get_children(self):
# def _render_textual_index_column(
#     element: _textual_index_element, compiler: "SQLCompiler", **kw
# ) -> str:
# def _render_literal_bindparam(
#     element: _literal_bindparam, compiler: "SQLCompiler", **kw
# ) -> str:
# def _get_index_expressions(idx):
# def _get_index_column_names(idx):
# def _column_kwargs(col: "Column") -> Mapping:
# def _get_constraint_final_name(
#     constraint: Union["Index", "Constraint"], dialect: Optional["Dialect"]
# ) -> Optional[str]:
# def _constraint_is_named(
#     constraint: Union["Constraint", "Index"], dialect: Optional["Dialect"]
# ) -> bool:
# def _is_mariadb(mysql_dialect: "Dialect") -> bool:
# def _mariadb_normalized_version_info(mysql_dialect):
# def _insert_inline(table: Union["TableClause", "Table"]) -> "Insert":
#     def create_mock_engine(url, executor, **kw):  # type: ignore[misc]
#     def _select(*columns, **kw) -> "Select":
# class _textual_index_element(sql.ColumnElement):
# class _literal_bindparam(BindParameter):


import contextlib
import re
import sys
from typing import Any
from typing import Dict
from sqlalchemy import exc as sa_exc
from sqlalchemy import util
from sqlalchemy.engine import default
from sqlalchemy.testing.assertions import _expect_warnings
from sqlalchemy.testing.assertions import eq_  # noqa
from sqlalchemy.testing.assertions import is_  # noqa
from sqlalchemy.testing.assertions import is_false  # noqa
from sqlalchemy.testing.assertions import is_not_  # noqa
from sqlalchemy.testing.assertions import is_true  # noqa
from sqlalchemy.testing.assertions import ne_  # noqa
from sqlalchemy.util import decorator
from ..util import sqla_compat
    # assert outside the block so it works for AssertionError too !
    assert success, "Callable did not raise an exception"


def expect_raises(except_cls, check_context=True):
    return _expect_raises(except_cls, check_context=check_context)


def expect_raises_message(except_cls, msg, check_context=True):
    return _expect_raises(except_cls, msg=msg, check_context=check_context)


def eq_ignore_whitespace(a, b, msg=None):

    a = re.sub(r"^\s+?|\n", "", a)
    a = re.sub(r" {2,}", " ", a)
    b = re.sub(r"^\s+?|\n", "", b)
    b = re.sub(r" {2,}", " ", b)

    assert a == b, msg or "%r != %r" % (a, b)


_dialect_mods: Dict[Any, Any] = {}


def _get_dialect(name):
    if name is None or name == "default":
        return default.DefaultDialect()
    else:


# Path: alembic/util/sqla_compat.py
# _CE = TypeVar("_CE", bound=Union["ColumnElement", "SchemaItem"])
# AUTOINCREMENT_DEFAULT = "auto"
# def _safe_int(value: str) -> Union[int, str]:
# def _ensure_scope_for_ddl(
#     connection: Optional["Connection"],
# ) -> Iterator[None]:
# def _safe_begin_connection_transaction(
#     connection: "Connection",
# ) -> "Transaction":
# def _get_connection_in_transaction(connection: Optional["Connection"]) -> bool:
# def _copy(schema_item: _CE, **kw) -> _CE:
# def _get_connection_transaction(
#     connection: "Connection",
# ) -> Optional["Transaction"]:
# def _create_url(*arg, **kw) -> url.URL:
# def _connectable_has_table(
#     connectable: "Connection", tablename: str, schemaname: Union[str, None]
# ) -> bool:
# def _exec_on_inspector(inspector, statement, **params):
# def _nullability_might_be_unset(metadata_column):
# def _server_default_is_computed(*server_default) -> bool:
# def _server_default_is_identity(*server_default) -> bool:
# def _table_for_constraint(constraint: "Constraint") -> "Table":
# def _columns_for_constraint(constraint):
# def _reflect_table(
#     inspector: "Inspector", table: "Table", include_cols: None
# ) -> None:
# def _fk_spec(constraint):
# def _fk_is_self_referential(constraint: "ForeignKeyConstraint") -> bool:
# def _is_type_bound(constraint: "Constraint") -> bool:
# def _find_columns(clause):
# def _remove_column_from_collection(
#     collection: "ColumnCollection", column: Union["Column", "ColumnClause"]
# ) -> None:
# def _textual_index_column(
#     table: "Table", text_: Union[str, "TextClause", "ColumnElement"]
# ) -> Union["ColumnElement", "Column"]:
# def _copy_expression(expression: _CE, target_table: "Table") -> _CE:
#     def replace(col):
#     def __init__(self, table: "Table", text: "TextClause") -> None:
#     def get_children(self):
# def _render_textual_index_column(
#     element: _textual_index_element, compiler: "SQLCompiler", **kw
# ) -> str:
# def _render_literal_bindparam(
#     element: _literal_bindparam, compiler: "SQLCompiler", **kw
# ) -> str:
# def _get_index_expressions(idx):
# def _get_index_column_names(idx):
# def _column_kwargs(col: "Column") -> Mapping:
# def _get_constraint_final_name(
#     constraint: Union["Index", "Constraint"], dialect: Optional["Dialect"]
# ) -> Optional[str]:
# def _constraint_is_named(
#     constraint: Union["Constraint", "Index"], dialect: Optional["Dialect"]
# ) -> bool:
# def _is_mariadb(mysql_dialect: "Dialect") -> bool:
# def _mariadb_normalized_version_info(mysql_dialect):
# def _insert_inline(table: Union["TableClause", "Table"]) -> "Insert":
#     def create_mock_engine(url, executor, **kw):  # type: ignore[misc]
#     def _select(*columns, **kw) -> "Select":
# class _textual_index_element(sql.ColumnElement):
# class _literal_bindparam(BindParameter):


# Path: alembic/testing/assertions.py
import contextlib
import re
import sys
from typing import Any
from typing import Dict
from sqlalchemy import exc as sa_exc
from sqlalchemy import util
from sqlalchemy.engine import default
from sqlalchemy.testing.assertions import _expect_warnings
from sqlalchemy.testing.assertions import eq_  # noqa
from sqlalchemy.testing.assertions import is_  # noqa
from sqlalchemy.testing.assertions import is_false  # noqa
from sqlalchemy.testing.assertions import is_not_  # noqa
from sqlalchemy.testing.assertions import is_true  # noqa
from sqlalchemy.testing.assertions import ne_  # noqa
from sqlalchemy.util import decorator
from ..util import sqla_compat

    # assert outside the block so it works for AssertionError too !
    assert success, "Callable did not raise an exception"


def expect_raises(except_cls, check_context=True):
    return _expect_raises(except_cls, check_context=check_context)


def expect_raises_message(except_cls, msg, check_context=True):
    return _expect_raises(except_cls, msg=msg, check_context=check_context)


def eq_ignore_whitespace(a, b, msg=None):

    a = re.sub(r"^\s+?|\n", "", a)
    a = re.sub(r" {2,}", " ", a)
    b = re.sub(r"^\s+?|\n", "", b)
    b = re.sub(r" {2,}", " ", b)

    assert a == b, msg or "%r != %r" % (a, b)


_dialect_mods: Dict[Any, Any] = {}


def _get_dialect(name):
    if name is None or name == "default":
        return default.DefaultDialect()
    else:


        d = sqla_compat._create_url(name).get_dialect()()