def init_app(self, app):
        """Setup scoped sesssion creation and teardown for the passed ``app``.

        :param app: a :class:`~flask.Flask` application
        """
        app.scoped_session = self

        @app.teardown_appcontext
        def remove_scoped_session(*args, **kwargs):
            # pylint: disable=missing-docstring,unused-argument,unused-variable
            app.scoped_session.remove()
Setup scoped sesssion creation and teardown for the passed ``app``.

        :param app: a :class:`~flask.Flask` application