code: def test_read_complex_cells(
      pynb="""import pandas as pd
  
  # +
  def data():
      return pd.DataFrame({'A': [0, 1]})
  
  
  data()
  
  # +
  def data2():
      return pd.DataFrame({'B': [0, 1]})
  
  
  data2()
  
  # +
  # Finally we have a cell with only comments
  # This cell should remain a code cell and not get converted
  # to markdown
  
  # + {"endofcell": "--"}
  # This cell has an enumeration in it that should not
  # match the endofcell marker!
  # - item 1
  # - item 2
  # -
  # --
  """,
  ):
      nb = jupytext.reads(pynb, "py")
      assert len(nb.cells) == 5
      assert nb.cells[0].cell_type == "code"
      assert nb.cells[1].cell_type == "code"
      assert nb.cells[2].cell_type == "code"
      assert nb.cells[3].cell_type == "code"
      assert nb.cells[4].cell_type == "code"
      assert (
          nb.cells[3].source
          == """# Finally we have a cell with only comments
  # This cell should remain a code cell and not get converted
  # to markdown"""
      )
      assert (
          nb.cells[4].source
          == """# This cell has an enumeration in it that should not
  # match the endofcell marker!
  # - item 1
  # - item 2
  # -"""
      )
  
      pynb2 = jupytext.writes(nb, "py")
      compare(pynb2, pynb)
  
imports: import pytest
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook, new_raw_cell
  import jupytext
  from jupytext.compare import compare, compare_notebooks
label_desc: Use image node_id 8 for calling a global function with example usage: test_read_complex_cells(pynb) without return types