original_docstring: Execute a notebook via nbconvert and collect output.
      :returns (parsed nb object, execution errors)
      
docstring: Execute a notebook via nbconvert and collect output.
  :returns (parsed nb object, execution errors)
docstring_tokens: Execute a notebook via nbconvert and collect output . : returns ( parsed nb object execution errors )
code: def _notebook_run(path, kernel=None, timeout=60, capsys=None):
      """Execute a notebook via nbconvert and collect output.
      :returns (parsed nb object, execution errors)
      """
      major_version = sys.version_info[0]
      dirname, __ = os.path.split(path)
      os.chdir(dirname)
      fname = os.path.join(here, "test.ipynb")
      args = [
          "jupyter",
          "nbconvert",
          "--to",
          "notebook",
          "--execute",
          "--ExecutePreprocessor.timeout={}".format(timeout),
          "--output",
          fname,
          path,
      ]
      subprocess.check_call(args)
  
      nb = nbformat.read(io.open(fname, encoding="utf-8"), nbformat.current_nbformat)
  
      errors = [
          output
          for cell in nb.cells
          if "outputs" in cell
          for output in cell["outputs"]
          if output.output_type == "error"
      ]
  
      # removing files fails on CI (GitHub Actions) on Windows & py3.8
      try:
          os.remove(fname)
      except PermissionError:
          pass
  
      return nb, errors
code_tokens: def _notebook_run ( path , kernel = None , timeout = 60 , capsys = None ) : major_version = sys . version_info [ 0 ] dirname , __ = os . path . split ( path ) os . chdir ( dirname ) fname = os . path . join ( here , "test.ipynb" ) args = [ "jupyter" , "nbconvert" , "--to" , "notebook" , "--execute" , "--ExecutePreprocessor.timeout={}" . format ( timeout ) , "--output" , fname , path , ] subprocess . check_call ( args ) nb = nbformat . read ( io . open ( fname , encoding = "utf-8" ) , nbformat . current_nbformat ) errors = [ output for cell in nb . cells if "outputs" in cell for output in cell [ "outputs" ] if output . output_type == "error" ] try : os . remove ( fname ) except PermissionError : pass return nb , errors
short_docstring: Execute a notebook via nbconvert and collect output.
short_docstring_tokens: Execute a notebook via nbconvert and collect output .
comment: """Execute a notebook via nbconvert and collect output.
      :returns (parsed nb object, execution errors)
      """$SEP$# removing files fails on CI (GitHub Actions) on Windows & py3.8