def _clear_notebook(self, node): # pragma: no cover if NotebookExporter is not None: exporter = NotebookExporter() exporter.register_preprocessor(ClearOutputPreprocessor(enabled=True)) cleared,_ = exporter.from_notebook_node(node) else: stripped_node = v3_strip_output(node) cleared = current.writes(stripped_node, 'ipynb') return cleared