docs: def configure_engine(cls, url: Union[str, URL, Dict[str, Any]] = None,
                           bind: Union[Connection, Engine] = None, session: Dict[str, Any] = None,
                           ready_callback: Union[Callable[[Engine, sessionmaker], Any], str] = None,
                           poolclass: Union[str, Pool] = None, **engine_args):
          """
          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`
  
          """
          assert check_argument_types()
          if bind is None:
              if isinstance(url, dict):
                  url = URL(**url)
              elif isinstance(url, str):
                  url = make_url(url)
              elif url is None:
                  raise TypeError('both "url" and "bind" cannot be None')
  
              if isinstance(poolclass, str):
                  poolclass = resolve_reference(poolclass)
  
              # This is a hack to get SQLite to play nice with asphalt-sqlalchemy's juggling of
              # connections between multiple threads. The same connection should, however, never be
              # used in multiple threads at once.
              if url.get_dialect().name == 'sqlite':
                  connect_args = engine_args.setdefault('connect_args', {})
                  connect_args.setdefault('check_same_thread', False)
  
              bind = create_engine(url, poolclass=poolclass, **engine_args)
  
          session = session or {}
          session.setdefault('expire_on_commit', False)
          ready_callback = resolve_reference(ready_callback)
          return bind, sessionmaker(bind, **session), ready_callback