def _add_admin(self, app, **kwargs):
from flask_admin import Admin<EOL>from flask_admin.contrib.sqla import ModelView<EOL>admin = Admin(app, **kwargs)<EOL>for flask_admin_model in self.flask_admin_models:<EOL><INDENT>if isinstance(flask_admin_model, tuple):  <EOL><INDENT>if len(flask_admin_model) != <NUM_LIT:2>:<EOL><INDENT>raise TypeError<EOL><DEDENT>model, view = flask_admin_model<EOL>admin.add_view(view(model, self.session))<EOL><DEDENT>else:<EOL><INDENT>admin.add_view(ModelView(flask_admin_model, self.session))<EOL><DEDENT><DEDENT>return admin<EOL>
Add a Flask Admin interface to an application.

        :param flask.Flask app: A Flask application
        :param kwargs: Keyword arguments are passed through to :class:`flask_admin.Admin`
        :rtype: flask_admin.Admin