code: def test_cell_marker_has_same_indentation_as_code(
      text="""# %%
  if __name__ == '__main__':
      print(1)
  
      # %%
      # INDENTED COMMENT
      print(2)
  """,
      nb_expected=new_notebook(
          cells=[
              new_code_cell(
                  """if __name__ == '__main__':
      print(1)"""
              ),
              new_code_cell(
                  """    # INDENTED COMMENT
      print(2)"""
              ),
          ]
      ),
  ):
      """The cell marker should have the same indentation as the first code line. See issue #562"""
      nb_actual = jupytext.reads(text, fmt="py:percent")
      compare_notebooks(nb_actual, nb_expected)
      text_actual = jupytext.writes(nb_actual, fmt="py:percent")
      compare(text_actual, text)
  
imports: import os
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook, new_raw_cell
  import jupytext
  from jupytext.compare import compare, compare_notebooks, notebook_model
label_desc: Use image node_id 22 for calling a global function with example usage: test_cell_marker_has_same_indentation_as_code(text, nb_expected) without return types