code: def test_identity_source_write_read(ipynb_R_file, ext):
      """
      Test that writing the notebook with R, and read again,
      is the same as removing outputs
      """
  
      with open(ipynb_R_file) as fp:
          nb1 = nbformat.read(fp, as_version=4)
  
      R = jupytext.writes(nb1, ext)
      nb2 = jupytext.reads(R, ext)
  
      compare_notebooks(nb2, nb1)
  
imports: import nbformat
  import pytest
  import jupytext
  from jupytext.compare import compare_notebooks
label_desc: Use image node_id 1 for calling a global function with example usage: test_identity_source_write_read(ipynb_R_file, ext) without return types