def execute_nb(src, dst, allow_errors=False, timeout=1000, kernel_name=''):
 import nbformat
 from nbconvert.preprocessors import ExecutePreprocessor
 with io.open(src, encoding='utf-8') as f:
  nb = nbformat.read(f, as_version=4)
 ep = ExecutePreprocessor(allow_errors=allow_errors, timeout=timeout, kernel_name=kernel_name)
 ep.preprocess(nb, resources={})
 with io.open(dst, 'wt', encoding='utf-8') as f:
  nbformat.write(nb, f)
 return dst

def execute_nb ( src , dst , allow_errors = False , timeout = 1000 , kernel_name = '' ) : import nbformat from nbconvert . preprocessors import ExecutePreprocessor with io . open ( src , encoding = 'utf-8' ) as f : nb = nbformat . read ( f , as_version = 4 ) ep = ExecutePreprocessor ( allow_errors = allow_errors , timeout = timeout , kernel_name = kernel_name ) ep . preprocess ( nb , resources = { } ) with io . open ( dst , 'wt' , encoding = 'utf-8' ) as f : nbformat . write ( nb , f ) return dst
execute notebook in src and write the output to dst parameters src .