# Path: metatlas/tools/notebook.py
# def configure_environment(log_level: str) -> None:
# def configure_pandas_display(max_rows: int = 5000, max_columns: int = 500, max_colwidth: int = 100) -> None:
# def configure_notebook_display() -> None:
# def setup(log_level: str, source_code_version_id: Optional[str] = None) -> None:
# def activate_sql_logging(console_level="INFO", console_format=None, file_level="DEBUG", filename=None):
# def cells_matching_tags(data: dict, tags: List[str]) -> List[int]:
# def has_intersection(one: List, two: List) -> bool:
# def get_metadata_tags(cell: dict):
# def create_notebook(source: str, dest: str, parameters: dict) -> None:
# def replace_parameters(source: List[str], parameters: dict) -> List[str]:
# def assignment_string(lhs, rhs):


import json
from metatlas.tools import notebook
            },
        ]
    }
    with open("test.json", "w", encoding="utf8") as out_fh:
        json.dump(orig_data, out_fh)
    notebook.create_notebook("test.json", "out.json", {})
    with open("out.json", encoding="utf8") as in_fh:
        data = json.load(in_fh)
    assert data["cells"][0]["source"][1] == "param1 = 0\n"
    assert data["cells"][0]["source"][3] == "param2 = []\n"
    assert data["cells"][0]["source"][4] == 'param3 = "REPLACE ME"\n'


def test_create_notebook_with_parameters03():
    orig_data = {
        "cells": [
            {
                "metadata": {"tags": ["parameters"]},
                "source": [
                    "# this is a comment\n",
                    "param1 = 0\n",
                    "\n",
                    "param2 = []\n",
                    'param3 = "REPLACE ME"\n',
                ],
            },
        ]
    }
    with open("test.json", "w", encoding="utf8") as out_fh:
        json.dump(orig_data, out_fh)

# Path: metatlas/tools/notebook.py
# def configure_environment(log_level: str) -> None:
# def configure_pandas_display(max_rows: int = 5000, max_columns: int = 500, max_colwidth: int = 100) -> None:
# def configure_notebook_display() -> None:
# def setup(log_level: str, source_code_version_id: Optional[str] = None) -> None:
# def activate_sql_logging(console_level="INFO", console_format=None, file_level="DEBUG", filename=None):
# def cells_matching_tags(data: dict, tags: List[str]) -> List[int]:
# def has_intersection(one: List, two: List) -> bool:
# def get_metadata_tags(cell: dict):
# def create_notebook(source: str, dest: str, parameters: dict) -> None:
# def replace_parameters(source: List[str], parameters: dict) -> List[str]:
# def assignment_string(lhs, rhs):


# Path: tests/unit/test_notebook.py
import json
from metatlas.tools import notebook

            },
        ]
    }
    with open("test.json", "w", encoding="utf8") as out_fh:
        json.dump(orig_data, out_fh)
    notebook.create_notebook("test.json", "out.json", {})
    with open("out.json", encoding="utf8") as in_fh:
        data = json.load(in_fh)
    assert data["cells"][0]["source"][1] == "param1 = 0\n"
    assert data["cells"][0]["source"][3] == "param2 = []\n"
    assert data["cells"][0]["source"][4] == 'param3 = "REPLACE ME"\n'


def test_create_notebook_with_parameters03():
    orig_data = {
        "cells": [
            {
                "metadata": {"tags": ["parameters"]},
                "source": [
                    "# this is a comment\n",
                    "param1 = 0\n",
                    "\n",
                    "param2 = []\n",
                    'param3 = "REPLACE ME"\n',
                ],
            },
        ]
    }
    with open("test.json", "w", encoding="utf8") as out_fh:
        json.dump(orig_data, out_fh)

    notebook.create_notebook("test.json", "out.json", {"param1": None, "param2": True})