code: def _notebook_run(path, timeout=default_timeout):
      """
      Execute a singular ipython notebook at path and returns the cells and outputs
  
      :returns (parsed nb object, execution errors)
      """
  
      dirname, _ = os.path.split(path)
      execproc_timeout = "--ExecutePreprocessor.timeout=%d" % timeout
  
      # Do not run notebook tests on Travis.  notebooks tests should only be
      # run in the local developer testing context and notebook tests often
      # cause time out failures on Travis builds see (github #409, #410)
      try:
          if os.environ["TRAVIS"]:
              return [], []
      except BaseException:
          pass
  
      # Ensure temporary files are not auto-deleted as processes have limited
      # permissions to re-use file handles under WinNT-based operating systems.
      fname = ""
      with tempfile.NamedTemporaryFile(
          mode="w+t", suffix=".ipynb", delete=False
      ) as fout:
          fname = fout.name
  
          args = [
              "jupyter",
              "nbconvert",
              "--to",
              "notebook",
              "--execute",
              execproc_timeout,
          ]
          args += ["--ExecutePreprocessor.kernel_name=python3"]
          args += ["--output", fout.name, path]
          subprocess.check_call(args)
  
          fout.seek(0)
          nb = nbformat.read(fout, nbformat.current_nbformat)
      os.remove(fname)
  
      errors = [
          output
          for cell in nb.cells
          if "outputs" in cell
          for output in cell["outputs"]
          if output.output_type == "error"
      ]
      return nb, errors
  
imports: import os
  import subprocess
  import tempfile
  from unittest import TestCase
  import nbformat
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: _notebook_run(path, timeout) and returns: nb,  errors, list,  list