def METHOD_NAME(jp_root_dir):
    # Build sub directory.
    subdir = jp_root_dir / "foo"
    if not jp_root_dir.joinpath("foo").is_dir():
        subdir.mkdir()
    # Build a notebook programmatically.
    nb = new_notebook()
    nb.cells.append(new_markdown_cell("Created by test ³"))
    cc1 = new_code_cell(source="print(2*6)")
    cc1.outputs.append(new_output(output_type="stream", text="12"))
    cc1.outputs.append(
        new_output(
            output_type="execute_result",
            data={"image/png": png_green_pixel},
            execution_count=1,
        )
    )
    nb.cells.append(cc1)
    # Write file to tmp dir.
    nbfile = subdir / "testnb.ipynb"
    nbfile.write_text(writes(nb, version=4), encoding="utf-8")