code: def test_files(nb_file):
      pytest.importorskip("nbconvert")
      pytest.importorskip("nbformat")
      import nbconvert
      import nbformat
      from nbconvert.preprocessors import ExecutePreprocessor
  
      if not Path(nb_file).exists():
          return
      kernel_name = os.environ.get("NOTEBOOK_KERNEL", "python3")
      with open(nb_file) as f:
          nb = nbformat.read(f, as_version=4)
      proc = ExecutePreprocessor(timeout=600, kernel_name=kernel_name)
      proc.allow_errors = True
      proc.preprocess(nb, {"metadata": {"path": "/"}})
      cells_with_outputs = [c for c in nb.cells if "outputs" in c]
      for cell in cells_with_outputs:
          for output in cell["outputs"]:
              if output.output_type == "error":
                  for l in output.traceback:
                      print(l)
                  raise Exception(f"{output.ename}: {output.evalue}")
  
imports: import os
  from pathlib import Path
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_files(nb_file) without return types