From 4feb4d19eaee6b8d0475d38215c1ee9a6afc4374 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:27:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py index 409ce578e..0f9d6aa4d 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/generate.py @@ -216,8 +216,8 @@ def create_notebook(outline): # Post process notebook for hanging cells: merge hanging cell with the previous cell nb_cells = list() for cell in nb["cells"]: - if (cell["cell_type"] == 'code') and (cell["source"][0] == ' '): - nb_cells[-1]["source"] = nb_cells[-1]["source"] + '\n\n' + cell["source"] + if (cell["cell_type"] == "code") and (cell["source"][0] == " "): + nb_cells[-1]["source"] = nb_cells[-1]["source"] + "\n\n" + cell["source"] else: nb_cells.append(cell) nb["cells"] = nb_cells