import pytest
from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell
from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion


def test_raise_on_different_metadata():
    ref = new_notebook(metadata={'kernelspec': {'language': 'python', 'name': 'python', 'display_name': 'Python'}},
                       cells=[new_markdown_cell('Cell one')])
    test = new_notebook(metadata={'kernelspec': {'language': 'R', 'name': 'R', 'display_name': 'R'}},
                        cells=[new_markdown_cell('Cell one')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md')


@pytest.mark.parametrize('raise_on_first_difference', [True, False])
def test_raise_on_different_cell_type(raise_on_first_difference):
    ref = new_notebook(cells=[new_markdown_cell('Cell one'), new_code_cell('Cell two')])
    test = new_notebook(cells=[new_markdown_cell('Cell one'), new_raw_cell('Cell two')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md', raise_on_first_difference=raise_on_first_difference)


@pytest.mark.parametrize('raise_on_first_difference', [True, False])
def test_raise_on_different_cell_content(raise_on_first_difference):
    ref = new_notebook(cells=[new_markdown_cell('Cell one'), new_code_cell('Cell two')])
    test = new_notebook(cells=[new_markdown_cell('Cell one'), new_code_cell('Modified cell two')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md', raise_on_first_difference=raise_on_first_difference)


def test_raise_on_incomplete_markdown_cell():
    ref = new_notebook(cells=[new_markdown_cell('Cell one\n\n\nsecond line')])
    test = new_notebook(cells=[new_markdown_cell('Cell one')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md')


def test_does_raise_on_split_markdown_cell():
    ref = new_notebook(cells=[new_markdown_cell('Cell one\n\n\nsecond line')])
    test = new_notebook(cells=[new_markdown_cell('Cell one'),
                               new_markdown_cell('second line')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md')


def test_raise_on_different_cell_metadata():
    ref = new_notebook(cells=[new_code_cell('1+1')])
    test = new_notebook(cells=[new_code_cell('1+1', metadata={'metakey': 'value'})])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'py:light')


@pytest.mark.parametrize('raise_on_first_difference', [True, False])
def test_raise_on_different_cell_count(raise_on_first_difference):
    ref = new_notebook(cells=[new_code_cell('1')])
    test = new_notebook(cells=[new_code_cell('1'),
                               new_code_cell('2')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'py:light', raise_on_first_difference=raise_on_first_difference)

    with pytest.raises(NotebookDifference):
        compare_notebooks(test, ref, 'py:light', raise_on_first_difference=raise_on_first_difference)


def test_does_not_raise_on_blank_line_removed():
    ref = new_notebook(cells=[new_code_cell('1+1\n    ')])
    test = new_notebook(cells=[new_code_cell('1+1')])
    compare_notebooks(ref, test, 'py:light')


def test_strict_raise_on_blank_line_removed():
    ref = new_notebook(cells=[new_code_cell('1+1\n')])
    test = new_notebook(cells=[new_code_cell('1+1')])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'py:light', allow_expected_differences=False)


def test_dont_raise_on_different_outputs():
    ref = new_notebook(cells=[new_code_cell('1+1')])
    test = new_notebook(cells=[new_code_cell('1+1', outputs=[
        {
            "data": {
                "text/plain": [
                    "2"
                ]
            },
            "execution_count": 1,
            "metadata": {},
            "output_type": "execute_result"
        }
    ])])
    compare_notebooks(ref, test, 'md')


@pytest.mark.parametrize('raise_on_first_difference', [True, False])
def test_raise_on_different_outputs(raise_on_first_difference):
    ref = new_notebook(cells=[new_code_cell('1+1')])
    test = new_notebook(cells=[new_code_cell('1+1', outputs=[
        {
            "data": {
                "text/plain": [
                    "2"
                ]
            },
            "execution_count": 1,
            "metadata": {},
            "output_type": "execute_result"
        }
    ])])
    with pytest.raises(NotebookDifference):
        compare_notebooks(ref, test, 'md', compare_outputs=True, raise_on_first_difference=raise_on_first_difference)


def test_test_round_trip_conversion():
    notebook = new_notebook(cells=[new_code_cell('1+1', outputs=[
        {
            "data": {
                "text/plain": [
                    "2"
                ]
            },
            "execution_count": 1,
            "metadata": {},
            "output_type": "execute_result"
        }
    ])], metadata={'main_language': 'python'})

    round_trip_conversion(notebook, {'extension': '.py'}, update=True)


def test_mutiple_cells_differ():
    nb1 = new_notebook(cells=[new_code_cell(''),
                              new_code_cell('2')])
    nb2 = new_notebook(cells=[new_code_cell('1+1'),
                              new_code_cell('2\n2')])
    with pytest.raises(NotebookDifference) as exception_info:
        compare_notebooks(nb1, nb2, raise_on_first_difference=False)
    assert 'Cells 1,2 differ' in exception_info.value.args[0]


def test_cell_metadata_differ():
    nb1 = new_notebook(cells=[new_code_cell('1'),
                              new_code_cell('2', metadata={'additional': 'metadata1'})])
    nb2 = new_notebook(cells=[new_code_cell('1'),
                              new_code_cell('2', metadata={'additional': 'metadata2'})])
    with pytest.raises(NotebookDifference) as exception_info:
        compare_notebooks(nb1, nb2, raise_on_first_difference=False)
    assert "Cell metadata 'additional' differ" in exception_info.value.args[0]


def test_notebook_metadata_differ():
    nb1 = new_notebook(cells=[new_code_cell('1'),
                              new_code_cell('2')])
    nb2 = new_notebook(cells=[new_code_cell('1'),
                              new_code_cell('2')],
                       metadata={'kernelspec': {'language': 'python', 'name': 'python', 'display_name': 'Python'}})
    with pytest.raises(NotebookDifference) as exception_info:
        compare_notebooks(nb1, nb2, raise_on_first_difference=False, )
    assert "Notebook metadata differ" in exception_info.value.args[0]

[((15, 1, 15, 68), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(15, 25, 15, 52): '"""raise_on_first_difference"""', (15, 54, 15, 67): '[True, False]'}, {}), "('raise_on_first_difference', [True, False])", False, 'import pytest\n'), ((23, 1, 23, 68), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(23, 25, 23, 52): '"""raise_on_first_difference"""', (23, 54, 23, 67): '[True, False]'}, {}), "('raise_on_first_difference', [True, False])", False, 'import pytest\n'), ((53, 1, 53, 68), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(53, 25, 53, 52): '"""raise_on_first_difference"""', (53, 54, 53, 67): '[True, False]'}, {}), "('raise_on_first_difference', [True, False])", False, 'import pytest\n'), ((95, 1, 95, 68), 'pytest.mark.parametrize', 'pytest.mark.parametrize', ({(95, 25, 95, 52): '"""raise_on_first_difference"""', (95, 54, 95, 67): '[True, False]'}, {}), "('raise_on_first_difference', [True, False])", False, 'import pytest\n'), ((68, 4, 68, 44), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(68, 22, 68, 25): 'ref', (68, 27, 68, 31): 'test', (68, 33, 68, 43): '"""py:light"""'}, {}), "(ref, test, 'py:light')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((92, 4, 92, 38), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(92, 22, 92, 25): 'ref', (92, 27, 92, 31): 'test', (92, 33, 92, 37): '"""md"""'}, {}), "(ref, test, 'md')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((128, 4, 128, 70), 'jupytext.compare.test_round_trip_conversion', 'round_trip_conversion', (), '', True, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((11, 9, 11, 42), 'pytest.raises', 'pytest.raises', ({(11, 23, 11, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((12, 8, 12, 42), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(12, 26, 12, 29): 'ref', (12, 31, 12, 35): 'test', (12, 37, 12, 41): '"""md"""'}, {}), "(ref, test, 'md')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((19, 9, 19, 42), 'pytest.raises', 'pytest.raises', ({(19, 23, 19, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((20, 8, 20, 95), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((27, 9, 27, 42), 'pytest.raises', 'pytest.raises', ({(27, 23, 27, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((28, 8, 28, 95), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((34, 9, 34, 42), 'pytest.raises', 'pytest.raises', ({(34, 23, 34, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((35, 8, 35, 42), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(35, 26, 35, 29): 'ref', (35, 31, 35, 35): 'test', (35, 37, 35, 41): '"""md"""'}, {}), "(ref, test, 'md')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((42, 9, 42, 42), 'pytest.raises', 'pytest.raises', ({(42, 23, 42, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((43, 8, 43, 42), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(43, 26, 43, 29): 'ref', (43, 31, 43, 35): 'test', (43, 37, 43, 41): '"""md"""'}, {}), "(ref, test, 'md')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((49, 9, 49, 42), 'pytest.raises', 'pytest.raises', ({(49, 23, 49, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((50, 8, 50, 48), 'jupytext.compare.compare_notebooks', 'compare_notebooks', ({(50, 26, 50, 29): 'ref', (50, 31, 50, 35): 'test', (50, 37, 50, 47): '"""py:light"""'}, {}), "(ref, test, 'py:light')", False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((58, 9, 58, 42), 'pytest.raises', 'pytest.raises', ({(58, 23, 58, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((59, 8, 59, 101), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((61, 9, 61, 42), 'pytest.raises', 'pytest.raises', ({(61, 23, 61, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((62, 8, 62, 101), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((74, 9, 74, 42), 'pytest.raises', 'pytest.raises', ({(74, 23, 74, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((75, 8, 75, 82), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((110, 9, 110, 42), 'pytest.raises', 'pytest.raises', ({(110, 23, 110, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((111, 8, 111, 117), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((136, 9, 136, 42), 'pytest.raises', 'pytest.raises', ({(136, 23, 136, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((137, 8, 137, 68), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((146, 9, 146, 42), 'pytest.raises', 'pytest.raises', ({(146, 23, 146, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((147, 8, 147, 68), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((157, 9, 157, 42), 'pytest.raises', 'pytest.raises', ({(157, 23, 157, 41): 'NotebookDifference'}, {}), '(NotebookDifference)', False, 'import pytest\n'), ((158, 8, 158, 70), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (), '', False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((8, 30, 8, 59), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(8, 48, 8, 58): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((10, 31, 10, 60), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(10, 49, 10, 59): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((17, 30, 17, 59), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(17, 48, 17, 58): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((17, 61, 17, 86), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(17, 75, 17, 85): '"""Cell two"""'}, {}), "('Cell two')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((18, 31, 18, 60), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(18, 49, 18, 59): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((18, 62, 18, 86), 'nbformat.v4.nbbase.new_raw_cell', 'new_raw_cell', ({(18, 75, 18, 85): '"""Cell two"""'}, {}), "('Cell two')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((25, 30, 25, 59), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(25, 48, 25, 58): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((25, 61, 25, 86), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(25, 75, 25, 85): '"""Cell two"""'}, {}), "('Cell two')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((26, 31, 26, 60), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(26, 49, 26, 59): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((26, 62, 26, 96), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(26, 76, 26, 95): '"""Modified cell two"""'}, {}), "('Modified cell two')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((32, 30, 32, 76), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(32, 48, 32, 75): '"""Cell one\n\n\nsecond line"""'}, {}), '("""Cell one\n\n\nsecond line""")', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((33, 31, 33, 60), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(33, 49, 33, 59): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((39, 30, 39, 76), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(39, 48, 39, 75): '"""Cell one\n\n\nsecond line"""'}, {}), '("""Cell one\n\n\nsecond line""")', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((40, 31, 40, 60), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(40, 49, 40, 59): '"""Cell one"""'}, {}), "('Cell one')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((41, 31, 41, 63), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', ({(41, 49, 41, 62): '"""second line"""'}, {}), "('second line')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((47, 30, 47, 50), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(47, 44, 47, 49): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((48, 31, 48, 82), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((55, 30, 55, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(55, 44, 55, 47): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((56, 31, 56, 49), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(56, 45, 56, 48): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((57, 31, 57, 49), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(57, 45, 57, 48): '"""2"""'}, {}), "('2')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((66, 30, 66, 56), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(66, 44, 66, 55): '"""1+1\n    """'}, {}), "('1+1\\n    ')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((67, 31, 67, 51), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(67, 45, 67, 50): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((72, 30, 72, 52), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(72, 44, 72, 51): '"""1+1\n"""'}, {}), "('1+1\\n')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((73, 31, 73, 51), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(73, 45, 73, 50): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((79, 30, 79, 50), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(79, 44, 79, 49): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((80, 31, 91, 6), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((97, 30, 97, 50), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(97, 44, 97, 49): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((98, 31, 109, 6), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((115, 35, 126, 6), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((132, 30, 132, 47), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(132, 44, 132, 46): '""""""'}, {}), "('')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((133, 30, 133, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(133, 44, 133, 47): '"""2"""'}, {}), "('2')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((134, 30, 134, 50), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(134, 44, 134, 49): '"""1+1"""'}, {}), "('1+1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((135, 30, 135, 51), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(135, 44, 135, 50): '"""2\n2"""'}, {}), "('2\\n2')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((142, 30, 142, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(142, 44, 142, 47): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((143, 30, 143, 86), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((144, 30, 144, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(144, 44, 144, 47): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((145, 30, 145, 86), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (), '', False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((152, 30, 152, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(152, 44, 152, 47): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((153, 30, 153, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(153, 44, 153, 47): '"""2"""'}, {}), "('2')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((154, 30, 154, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(154, 44, 154, 47): '"""1"""'}, {}), "('1')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((155, 30, 155, 48), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', ({(155, 44, 155, 47): '"""2"""'}, {}), "('2')", False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n')]