code: def assay_one_notebook(notebook_path, notebook_name, test_values):
      """Test a single notebook.
  
      This uses nbformat to append `nteract-scrapbook` commands to the
      specified notebook. The content of the commands and their expected
      values are stored in the `test_values` dictionary. The keys of this
      dictionary are strings to be used as scrapbook keys. They corresponding
      value is a `ScrapSpec` tuple. The `code` member of this tuple is
      the code (as a string) to be run to generate the scrapbook value. The
      `expected` member is a Python object which is checked for equality with
      the scrapbook value
  
      Makes certain assumptions about directory layout.
      """
      processed_dir_name = "./notebooks/processed/" + notebook_path
  
      if not os.path.exists(processed_dir_name):
          os.makedirs(processed_dir_name)
  
      input_notebook = (
          "notebooks/" + notebook_path + notebook_name + ".ipynb"
      )
      processed_notebook = (
          f"{processed_dir_name}{notebook_name}.processed.ipynb"
      )
      output_notebook = (
          f"{processed_dir_name}{notebook_name}.output.ipynb"
      )
  
      append_scrapbook_commands(
          input_notebook, processed_notebook, test_values
      )
      pm.execute_notebook(processed_notebook, output_notebook)
      nb = sb.read_notebook(output_notebook)
  
      for k, v in test_values.items():
          assert nb.scraps[k].data == v.expected
  
imports: import os
  import nbformat
  import papermill
  import pytest
  import scrapbook
label_desc: Use image node_id 2 for calling a global function with example usage: assay_one_notebook(notebook_path, notebook_name, test_values) without return types