code: def test_save_using_preferred_and_default_format(config, tmpdir):
      tmpdir.join(".jupytext.yml").write(config)
      tmp_ipynb = tmpdir.join("notebook.ipynb")
      tmp_py = tmpdir.join("python").join("notebook.py")
  
      nb = new_notebook(cells=[new_code_cell("1 + 1")])
  
      write(nb, str(tmp_ipynb))
      jupytext([str(tmp_ipynb), "--sync"])
  
      # read py file
      nb_py = read(str(tmp_py))
      assert (
          nb_py.metadata["jupytext"]["text_representation"][
              "format_name"
          ]
          == "percent"
      )
  
file_path: jupytext/tests/functional/cli/test_cli_config.py
imports: import nbformat
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_notebook
  from jupytext.cli import jupytext
  from jupytext.compare import compare
  from jupytext.header import header_to_metadata_and_cell
  from jupytext.jupytext import read, write
label_desc: Use image node_id 6 for calling a global function with example usage: test_save_using_preferred_and_default_format(config, tmpdir) without return types