code: def test_config_file_is_called_just_once(tmpdir, n=2):
      cm = jupytext.TextFileContentsManager()
      cm.root_dir = str(tmpdir)
      tmpdir.join("jupytext.toml").write("")
      nb_files = [
          str(tmpdir.join(f"notebook{i}.ipynb")) for i in range(n)
      ]
  
      for nb_file in nb_files:
          jupytext.write(SAMPLE_NOTEBOOK, nb_file)
  
      mock_config = mock.MagicMock(return_value=None)
  
      with mock.patch(
          "jupytext.contentsmanager.load_jupytext_configuration_file",
          mock_config,
      ):
          for i in range(n):
              cm.get(f"notebook{i}.ipynb", content=False)
  
      # Listing the contents should not call the config more than once
      assert mock_config.call_count == 1
  
imports: import logging
  import os
  import sys
  import unittest.mock
  import pytest
  from nbformat import read
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook
  from tornado.web import HTTPError
  import jupytext
  from jupytext import TextFileContentsManager
  from jupytext.compare import compare_cells, notebook_model
label_desc: Use image node_id 2 for calling a global function with example usage: test_config_file_is_called_just_once(tmpdir, n) without return types