code: def test_markdown_jupytext_nbconvert_is_identity(md_file):
      """Test that a Markdown file, converted to a notebook, then
      exported back to Markdown with nbconvert, yields the original file
      """
      if "jupytext" in md_file:
          pytest.skip()
  
      with open(md_file) as fp:
          md_org = fp.read()
  
      nb = jupytext.reads(md_org, "md")
      import nbconvert
  
      md_nbconvert, _ = nbconvert.export(nbconvert.MarkdownExporter, nb)
  
      # Our expectations
      md_expected = md_org.splitlines()
      # #region and #endregion comments are removed
      md_expected = [
          line
          for line in md_expected
          if line not in ["<!-- #region -->", "<!-- #endregion -->"]
      ]
      # language is not inserted by nbconvert
      md_expected = [
          "```" if line.startswith("```") else line
          for line in md_expected
      ]
      # nbconvert inserts no empty line after the YAML header (which is in a Raw cell)
      md_expected = (
          "\n".join(md_expected).replace("---\n\n", "---\n") + "\n"
      )
  
      # an extra blank line is inserted before code cells
      md_nbconvert = md_nbconvert.replace("\n\n```", "\n```")
  
      jupytext.compare.compare(md_nbconvert, md_expected)
  
imports: import pytest
  import jupytext
  from jupytext.header import header_to_metadata_and_cell
label_desc: Use image node_id 1 for calling a global function with example usage: test_markdown_jupytext_nbconvert_is_identity(md_file) without return types