code: def test_runtools_options_to_rmarkdown(md, rmd):
      """Options set by the runtools extension are mapped to the corresponding R Markdown options
      https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/runtools/readme.html
      """
      md = (
          "```python "
          + md
          + """
  1 + 1
  ```
  """
      )
  
      rmd = (
          "```{python "
          + rmd
          + """}
  1 + 1
  ```
  """
      )
  
      nb_md = jupytext.reads(md, "md")
      nb_rmd = jupytext.reads(
          rmd, fmt={"extension": ".Rmd", "use_runtools": True}
      )
      compare_notebooks(nb_rmd, nb_md)
  
      md2 = jupytext.writes(nb_rmd, "md")
      compare(md2, md)
  
      rmd = rmd.replace('"hide"', "'hide'")
      rmd2 = jupytext.writes(nb_md, "Rmd")
      compare(rmd2, rmd)
  
imports: import pytest
  import jupytext
  from jupytext.compare import compare, compare_notebooks
label_desc: Use image node_id 2 for calling a global function with example usage: test_runtools_options_to_rmarkdown(md, rmd) without return types