How to use the voila.execute.executenb function in voila

To help you get started, we’ve selected a few voila examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github voila-dashboards / voila / voila / handler.py View on Github external
def _jinja_notebook_execute(self, nb, kernel_id):
        km = self.kernel_manager.get_kernel(kernel_id)
        result = executenb(nb, km=km, cwd=self.cwd, config=self.traitlet_config)
        # we modify the notebook in place, since the nb variable cannot be reassigned it seems in jinja2
        # e.g. if we do {% with nb = notebook_execute(nb, kernel_id) %}, the base template/blocks will not
        # see the updated variable (it seems to be local to our block)
        nb.cells = result.cells