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]

[((701, 768), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""', '[True, False]'], {}), "('raise_on_first_difference', [True, False])\n", (724, 768), False, 'import pytest\n'), ((1156, 1223), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""', '[True, False]'], {}), "('raise_on_first_difference', [True, False])\n", (1179, 1223), False, 'import pytest\n'), ((2521, 2588), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""', '[True, False]'], {}), "('raise_on_first_difference', [True, False])\n", (2544, 2588), False, 'import pytest\n'), ((4046, 4113), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_on_first_difference"""', '[True, False]'], {}), "('raise_on_first_difference', [True, False])\n", (4069, 4113), False, 'import pytest\n'), ((3271, 3311), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""py:light"""'], {}), "(ref, test, 'py:light')\n", (3288, 3311), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((4008, 4042), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {}), "(ref, test, 'md')\n", (4025, 4042), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((5097, 5163), 'jupytext.compare.test_round_trip_conversion', 'round_trip_conversion', (['notebook', "{'extension': '.py'}"], {'update': '(True)'}), "(notebook, {'extension': '.py'}, update=True)\n", (5118, 5163), True, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((620, 653), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (633, 653), False, 'import pytest\n'), ((663, 697), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {}), "(ref, test, 'md')\n", (680, 697), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((1022, 1055), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (1035, 1055), False, 'import pytest\n'), ((1065, 1157), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {'raise_on_first_difference': 'raise_on_first_difference'}), "(ref, test, 'md', raise_on_first_difference=\n    raise_on_first_difference)\n", (1082, 1157), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((1490, 1523), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (1503, 1523), False, 'import pytest\n'), ((1533, 1625), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {'raise_on_first_difference': 'raise_on_first_difference'}), "(ref, test, 'md', raise_on_first_difference=\n    raise_on_first_difference)\n", (1550, 1625), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((1820, 1853), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (1833, 1853), False, 'import pytest\n'), ((1863, 1897), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {}), "(ref, test, 'md')\n", (1880, 1897), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((2162, 2195), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (2175, 2195), False, 'import pytest\n'), ((2205, 2239), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {}), "(ref, test, 'md')\n", (2222, 2239), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((2434, 2467), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (2447, 2467), False, 'import pytest\n'), ((2477, 2517), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""py:light"""'], {}), "(ref, test, 'py:light')\n", (2494, 2517), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((2819, 2852), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (2832, 2852), False, 'import pytest\n'), ((2862, 2960), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""py:light"""'], {'raise_on_first_difference': 'raise_on_first_difference'}), "(ref, test, 'py:light', raise_on_first_difference=\n    raise_on_first_difference)\n", (2879, 2960), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((2966, 2999), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (2979, 2999), False, 'import pytest\n'), ((3009, 3107), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['test', 'ref', '"""py:light"""'], {'raise_on_first_difference': 'raise_on_first_difference'}), "(test, ref, 'py:light', raise_on_first_difference=\n    raise_on_first_difference)\n", (3026, 3107), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((3479, 3512), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (3492, 3512), False, 'import pytest\n'), ((3522, 3596), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""py:light"""'], {'allow_expected_differences': '(False)'}), "(ref, test, 'py:light', allow_expected_differences=False)\n", (3539, 3596), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((4548, 4581), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (4561, 4581), False, 'import pytest\n'), ((4591, 4704), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['ref', 'test', '"""md"""'], {'compare_outputs': '(True)', 'raise_on_first_difference': 'raise_on_first_difference'}), "(ref, test, 'md', compare_outputs=True,\n    raise_on_first_difference=raise_on_first_difference)\n", (4608, 4704), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((5414, 5447), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (5427, 5447), False, 'import pytest\n'), ((5475, 5535), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['nb1', 'nb2'], {'raise_on_first_difference': '(False)'}), '(nb1, nb2, raise_on_first_difference=False)\n', (5492, 5535), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((5920, 5953), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (5933, 5953), False, 'import pytest\n'), ((5981, 6041), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['nb1', 'nb2'], {'raise_on_first_difference': '(False)'}), '(nb1, nb2, raise_on_first_difference=False)\n', (5998, 6041), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((6487, 6520), 'pytest.raises', 'pytest.raises', (['NotebookDifference'], {}), '(NotebookDifference)\n', (6500, 6520), False, 'import pytest\n'), ((6548, 6608), 'jupytext.compare.compare_notebooks', 'compare_notebooks', (['nb1', 'nb2'], {'raise_on_first_difference': '(False)'}), '(nb1, nb2, raise_on_first_difference=False)\n', (6565, 6608), False, 'from jupytext.compare import compare_notebooks, NotebookDifference, test_round_trip_conversion as round_trip_conversion\n'), ((414, 443), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (431, 443), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((579, 608), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (596, 608), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((865, 894), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (882, 894), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((896, 921), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""Cell two"""'], {}), "('Cell two')\n", (909, 921), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((955, 984), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (972, 984), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((986, 1010), 'nbformat.v4.nbbase.new_raw_cell', 'new_raw_cell', (['"""Cell two"""'], {}), "('Cell two')\n", (998, 1010), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1323, 1352), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (1340, 1352), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1354, 1379), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""Cell two"""'], {}), "('Cell two')\n", (1367, 1379), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1413, 1442), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (1430, 1442), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1444, 1478), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""Modified cell two"""'], {}), "('Modified cell two')\n", (1457, 1478), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1699, 1746), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one\n\n\nsecond line"""'], {}), '("""Cell one\n\n\nsecond line""")\n', (1716, 1746), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1779, 1808), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (1796, 1808), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((1976, 2023), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one\n\n\nsecond line"""'], {}), '("""Cell one\n\n\nsecond line""")\n', (1993, 2023), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2056, 2085), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""Cell one"""'], {}), "('Cell one')\n", (2073, 2085), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2118, 2150), 'nbformat.v4.nbbase.new_markdown_cell', 'new_markdown_cell', (['"""second line"""'], {}), "('second line')\n", (2135, 2150), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2317, 2337), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (2330, 2337), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2371, 2422), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {'metadata': "{'metakey': 'value'}"}), "('1+1', metadata={'metakey': 'value'})\n", (2384, 2422), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2686, 2704), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (2699, 2704), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2738, 2756), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (2751, 2756), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((2789, 2807), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {}), "('2')\n", (2802, 2807), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3184, 3210), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1\n    """'], {}), "('1+1\\n    ')\n", (3197, 3210), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3244, 3264), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (3257, 3264), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3391, 3413), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1\n"""'], {}), "('1+1\\n')\n", (3404, 3413), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3447, 3467), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (3460, 3467), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3673, 3693), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (3686, 3693), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((3727, 3865), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {'outputs': "[{'data': {'text/plain': ['2']}, 'execution_count': 1, 'metadata': {},\n    'output_type': 'execute_result'}]"}), "('1+1', outputs=[{'data': {'text/plain': ['2']},\n    'execution_count': 1, 'metadata': {}, 'output_type': 'execute_result'}])\n", (3740, 3865), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((4208, 4228), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (4221, 4228), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((4262, 4400), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {'outputs': "[{'data': {'text/plain': ['2']}, 'execution_count': 1, 'metadata': {},\n    'output_type': 'execute_result'}]"}), "('1+1', outputs=[{'data': {'text/plain': ['2']},\n    'execution_count': 1, 'metadata': {}, 'output_type': 'execute_result'}])\n", (4275, 4400), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((4777, 4915), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {'outputs': "[{'data': {'text/plain': ['2']}, 'execution_count': 1, 'metadata': {},\n    'output_type': 'execute_result'}]"}), "('1+1', outputs=[{'data': {'text/plain': ['2']},\n    'execution_count': 1, 'metadata': {}, 'output_type': 'execute_result'}])\n", (4790, 4915), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5229, 5246), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['""""""'], {}), "('')\n", (5242, 5246), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5278, 5296), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {}), "('2')\n", (5291, 5296), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5329, 5349), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1+1"""'], {}), "('1+1')\n", (5342, 5349), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5381, 5402), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2\n2"""'], {}), "('2\\n2')\n", (5394, 5402), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5663, 5681), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (5676, 5681), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5713, 5769), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {'metadata': "{'additional': 'metadata1'}"}), "('2', metadata={'additional': 'metadata1'})\n", (5726, 5769), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5802, 5820), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (5815, 5820), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((5852, 5908), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {'metadata': "{'additional': 'metadata2'}"}), "('2', metadata={'additional': 'metadata2'})\n", (5865, 5908), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((6190, 6208), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (6203, 6208), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((6240, 6258), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {}), "('2')\n", (6253, 6258), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((6291, 6309), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""1"""'], {}), "('1')\n", (6304, 6309), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n'), ((6341, 6359), 'nbformat.v4.nbbase.new_code_cell', 'new_code_cell', (['"""2"""'], {}), "('2')\n", (6354, 6359), False, 'from nbformat.v4.nbbase import new_notebook, new_markdown_cell, new_code_cell, new_raw_cell\n')]