code: def test_metadata_filter_from_config_has_precedence_over_notebook_metadata(
      tmpdir, cwd_tmpdir, python_notebook
  ):
      python_notebook.metadata["jupytext"] = {
          "notebook_metadata_filter": "-all"
      }
      tmpdir.join("jupytext.toml").write(
          'notebook_metadata_filter = "all"'
      )
  
      cm = jupytext.TextFileContentsManager()
      cm.root_dir = str(tmpdir)
  
      cm.save(notebook_model(python_notebook), "test.py")
  
      py = tmpdir.join("test.py").read()
      assert "notebook_metadata_filter: all" in py
  
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 7 for calling a global function with example usage: test_metadata_filter_from_config_has_precedence_over_notebook_metadata(tmpdir, cwd_tmpdir, python_notebook) without return types