@classmethod<EOL><INDENT>def configure_engine(cls, url: Union[str, URL, Dict[str, Any]] = None,<EOL>bind: Union[Connection, Engine] = None, session: Dict[str, Any] = None,<EOL>ready_callback: Union[Callable[[Engine, sessionmaker], Any], str] = None,<EOL>poolclass: Union[str, Pool] = None, **engine_args):<DEDENT>
assert check_argument_types()<EOL>if bind is None:<EOL><INDENT>if isinstance(url, dict):<EOL><INDENT>url = URL(**url)<EOL><DEDENT>elif isinstance(url, str):<EOL><INDENT>url = make_url(url)<EOL><DEDENT>elif url is None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if isinstance(poolclass, str):<EOL><INDENT>poolclass = resolve_reference(poolclass)<EOL><DEDENT>if url.get_dialect().name == '<STR_LIT>':<EOL><INDENT>connect_args = engine_args.setdefault('<STR_LIT>', {})<EOL>connect_args.setdefault('<STR_LIT>', False)<EOL><DEDENT>bind = create_engine(url, poolclass=poolclass, **engine_args)<EOL><DEDENT>session = session or {}<EOL>session.setdefault('<STR_LIT>', False)<EOL>ready_callback = resolve_reference(ready_callback)<EOL>return bind, sessionmaker(bind, **session), ready_callback<EOL>
Create an engine and selectively apply certain hacks to make it Asphalt friendly.

:param url: the connection url passed to :func:`~sqlalchemy.create_engine`
    (can also be a dictionary of :class:`~sqlalchemy.engine.url.URL` keyword arguments)
:param bind: a connection or engine to use instead of creating a new engine
:param session: keyword arguments to :class:`~sqlalchemy.orm.session.sessionmaker`
:param ready_callback: callable (or a ``module:varname`` reference to one) called with two
    arguments: the Engine and the sessionmaker when the component is started but before the
    resources are added to the context
:param poolclass: the SQLAlchemy Pool class to use; passed to
    :func:`~sqlalchemy.create_engine`
:param engine_args: keyword arguments passed to :func:`~sqlalchemy.create_engine`