code: def test_read_py_percent_from_stream():
      def stream():
          return StringIO(
              """# %%
  1 + 1
  """
          )
  
      nb = jupytext.read(stream())
      nb2 = jupytext.read(stream(), fmt="py:percent")
      compare_notebooks(nb2, nb)
  
file_path: jupytext/tests/functional/others/test_read_write_functions.py
imports: from io import StringIO
  from pathlib import Path
  import nbformat
  from nbformat.v4.nbbase import new_markdown_cell, new_notebook
  import jupytext
  from jupytext.compare import compare, compare_notebooks
label_desc: Use image node_id 5 for calling a global function with example usage: test_read_py_percent_from_stream() and returns: StringIO