code: def code_cell(code, output=None):
      """Create a code cell with `code` and optionally, `output`."""
      if output is None or len(output) == 0:
          outputs = []
      else:
          outputs = [
              nbformat.notebooknode.NotebookNode(
                  {
                      "data": {"text/plain": output},
                      "execution_count": None,
                      "metadata": {},
                      "output_type": "execute_result",
                  }
              )
          ]
      return nbformat.notebooknode.NotebookNode(
          {
              "cell_type": "code",
              "execution_count": None,
              "source": code,
              "metadata": {},
              "outputs": outputs,
          }
      )
  
imports: import nbformat
  import os
  import re
  import shutil
label_desc: Use image node_id 14 for calling a global function with example usage: code_cell(code, output) and returns: nbformat