code: def test_read_mostly_py_rmd_file(
      rmd="""---
  title: Simple file
  ---
  
  ```{python, echo=TRUE}
  import numpy as np
  x = np.arange(0, 2*math.pi, eps)
  ```
  
  ```{python, echo=TRUE}
  x = np.arange(0,1,eps)
  y = np.abs(x)-.5
  ```
  
  ```{r}
  ls()
  ```
  
  ```{r, results="asis", magic_args="-i x"}
  cat(stringi::stri_rand_lipsum(3), sep='\n\n')
  ```
  """,
  ):
      nb = jupytext.reads(rmd, "Rmd")
      compare_cells(
          nb.cells,
          [
              new_raw_cell("---\ntitle: Simple file\n---"),
              new_code_cell(
                  "import numpy as np\n"
                  "x = np.arange(0, 2*math.pi, eps)",
                  metadata={"echo": True},
              ),
              new_code_cell(
                  "x = np.arange(0,1,eps)\ny = np.abs(x)-.5",
                  metadata={"echo": True},
              ),
              new_code_cell("%%R\nls()"),
              new_code_cell(
                  "%%R -i x\ncat(stringi::"
                  "stri_rand_lipsum(3), sep='\n\n')",
                  metadata={"results": "asis"},
              ),
          ],
          compare_ids=False,
      )
  
      rmd2 = jupytext.writes(nb, "Rmd")
      rmd2 = re.sub(r"```{r ", "```{r, ", rmd2)
      rmd2 = re.sub(r"```{python ", "```{python, ", rmd2)
      compare(rmd2, rmd)
  
imports: import re
  from time import sleep
  import nbformat
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook, new_raw_cell
  import jupytext
  from jupytext.cli import jupytext
  from jupytext.compare import compare, compare_cells, compare_notebooks
label_desc: Use image node_id 1 for calling a global function with example usage: test_read_mostly_py_rmd_file(rmd) without return types