code: def _notebook_run(path):
      """Execute a notebook via nbconvert and collect output.
      :returns (parsed nb object, execution errors)
      """
      kernel_name = "python%d" % sys.version_info[0]
      this_file_directory = os.path.dirname(__file__)
      errors = []
      with tempfile.NamedTemporaryFile(
          suffix=".ipynb", mode="wt"
      ) as fout:
          with smart_open(path, "rb") as f:
              nb = nbformat.read(f, as_version=4)
              nb.metadata.get("kernelspec", {})["name"] = kernel_name
              ep = ExecutePreprocessor(
                  kernel_name=kernel_name, timeout=10
              )
  
              try:
                  ep.preprocess(
                      nb, {"metadata": {"path": this_file_directory}}
                  )
              except CellExecutionError as e:
                  if "SKIP" in e.traceback:
                      print(str(e.traceback).split("\n")[-2])
                  else:
                      raise e
              except RuntimeError as e:
                  print(e)
  
              finally:
                  nbformat.write(nb, fout)
  
      return nb, errors
  
file_path: gensim/docs/notebooks/test_notebooks.py
imports: import os
  import sys
  import tempfile
  from glob import glob
  import nbformat
  from nbconvert.preprocessors import ExecutePreprocessor
  from nbconvert.preprocessors.execute import CellExecutionError
label_desc: Use image node_id 1 for calling a global function with example usage: _notebook_run(path) and returns: nb,  errors