code: def test_read_remove_blank_lines(
      script="""# %%
  import pandas as pd
  
  # %% Display a data frame
  df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]},
                    index=pd.Index(['x0', 'x1'], name='x'))
  df
  
  # %% Pandas plot {"tags": ["parameters"]}
  df.plot(kind='bar')
  
  
  # %% sample class
  class MyClass:
      pass
  
  
  # %% a function
  def f(x):
      return 42 * x
  
  """,
  ):
      nb = jupytext.reads(script, "py")
      assert len(nb.cells) == 5
      for i in range(5):
          assert nb.cells[i].cell_type == "code"
          assert not nb.cells[i].source.startswith("\n")
          assert not nb.cells[i].source.endswith("\n")
  
      script2 = jupytext.writes(nb, "py:percent")
      compare(script2, script)
  
imports: import os
  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, notebook_model
label_desc: Use image node_id 4 for calling a global function with example usage: test_read_remove_blank_lines(script) without return types