Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
out_nb = nbconvert.exporters.MarkdownExporter().from_notebook_node(*exec_nb)
if filename is None:
assert self.filename.endswith('.ipynb')
filename = self.filename[:-6] + exporter.file_extension
open(filename, 'w').write(out_nb[0].encode('utf-8'))
class TestNotebooks(object):
_filepath = rootpath.rstrip('/')+'/../examples/'
_nblist = [x for x in os.listdir(_filepath) if x.endswith('.ipynb')]
for fn in TestNotebooks._nblist:
setattr(
TestNotebooks,
'test_'+branca.utilities._camelify(fn[:-6]),
NotebookTester(TestNotebooks._filepath+fn).__call__
)
exec_nb = nbconvert.preprocessors.ExecutePreprocessor(timeout=600).preprocess(*raw_nb)
if exporter is not None:
out_nb = nbconvert.exporters.MarkdownExporter().from_notebook_node(*exec_nb)
if filename is None:
assert self.filename.endswith('.ipynb')
filename = self.filename[:-6] + exporter.file_extension
open(filename, 'w').write(out_nb[0].encode('utf-8'))
class TestNotebooks(object):
_filepath = rootpath.rstrip('/') + '/../../examples/'
_nblist = [x for x in os.listdir(_filepath) if x.endswith('.ipynb')]
for fn in TestNotebooks._nblist:
setattr(TestNotebooks,
'test_'+branca.utilities._camelify(fn[:-6]),
NotebookTester(TestNotebooks._filepath+fn).__call__
)
def get_name(self):
"""Returns a string representation of the object.
This string has to be unique and to be a python and
javascript-compatible
variable name.
"""
return _camelify(self._name) + '_' + self._id