code: def execute_notebook(npth, dpth, timeout=1200, kernel='python3'):
      
  
      ep = ExecutePreprocessor(timeout=timeout, kernel_name=kernel)
      nb = nbformat.read(npth, as_version=4)
      t0 = timer()
      ep.preprocess(nb, {'metadata': {'path': dpth}})
      t1 = timer()
      with open(npth, 'wt') as f:
          nbformat.write(nb, f)
      return t1 - t0
docs: Execute the notebook at `npth` using `dpth` as the execution
      directory.  The execution timeout and kernel are `timeout` and
      `kernel` respectively.