def METHOD_NAME(
    nb_name: str,
    kernel_name: str = "wandb_python",
    notebook_type: PythonType = "jupyter",
    save_code: bool = True,
    **kwargs: Any,
):
    nb_path = assets_path(pathlib.Path("notebooks") / nb_name)
    shutil.copy(nb_path, os.path.join(os.getcwd(), os.path.basename(nb_path)))
    with open(nb_path) as f:
        nb = nbformat.read(f, as_version=4)
    # set up extra env vars and do monkey-patching.
    # in particular, we import and patch wandb.
    # this goes in the first cell of the notebook.
    setup_cell = io.StringIO()
    # env vars, particularly to point the sdk at the live test server (local_testcontainer):
    if not save_code:
        wandb_env["WANDB_SAVE_CODE"] = "false"
        wandb_env["WANDB_NOTEBOOK_NAME"] = ""
    else:
        wandb_env["WANDB_SAVE_CODE"] = "true"
        wandb_env["WANDB_NOTEBOOK_NAME"] = nb_name
    setup_cell.write("import os\n")
    for k, v in wandb_env.items():
        setup_cell.write(f"os.environ['{k}'] = '{v}'\n")
    # make wandb think we're in a specific type of notebook:
    setup_cell.write(
        "import pytest\n"
        "mp = pytest.MonkeyPatch()\n"
        "import wandb\n"
        f"mp.setattr(wandb.sdk.wandb_settings, '_get_python_type', lambda: '{notebook_type}')"
    )
    # inject:
    nb.cells.insert(0, nbformat.v4.new_code_cell(setup_cell.getvalue()))
    client = WandbNotebookClient(nb, kernel_name=kernel_name)
    try:
        with client.setup_kernel(**kwargs):
            yield client
    finally:
        pass
        # with open(os.path.join(os.getcwd(), "notebook.log"), "w") as f:
        #     f.write(client.all_output_text())
        # wandb.termlog("Find debug logs at: %s" % os.getcwd())
        # wandb.termlog(client.all_output_text())