This is supporting code for two blog posts:
You can find basic code in application.py and run it in notebook.ipynb. Read the blog posts to get a sense for the motivation/design behind this.