code: def run_notebook(
      input_nb, output_nb="executed_openai_notebook.ipynb", save=False
  ):
      import nbformat
      from nbconvert.preprocessors import ExecutePreprocessor
      from nbconvert.preprocessors import CellExecutionError
  
      try:
          nb_loc = os.path.join(here, os.pardir, "notebook")
          file_path = os.path.join(nb_loc, input_nb)
          with open(file_path) as nb_file:
              nb = nbformat.read(nb_file, as_version=4)
          preprocessor = ExecutePreprocessor(
              timeout=4800, kernel_name="python3"
          )
          preprocessor.preprocess(nb, {"metadata": {"path": nb_loc}})
  
          output_file_name = "executed_openai_notebook_output.txt"
          output_file = os.path.join(here, output_file_name)
          with open(output_file, "a") as nb_output_file:
              for cell in nb.cells:
                  if cell.cell_type == "code" and "outputs" in cell:
                      for output in cell.outputs:
                          if "text" in output:
                              nb_output_file.write(
                                  output["text"].strip() + "\n"
                              )
                          elif (
                              "data" in output
                              and "text/plain" in output["data"]
                          ):
                              nb_output_file.write(
                                  output["data"]["text/plain"].strip()
                                  + "\n"
                              )
      except CellExecutionError:
          raise
      finally:
          if save:
              with open(
                  os.path.join(here, output_nb), "w", encoding="utf-8"
              ) as nb_executed_file:
                  nbformat.write(nb, nb_executed_file)
  
file_path: autogen/test/test_notebook.py
imports: import sys
  import os
  import pytest
  from conftest import skip_openai
label_desc: Use image node_id 1 for calling a global function with example usage: run_notebook(input_nb, output_nb, save) without return types