code: def test_custom_metadata(
      no_jupytext_version_number,
      nb=new_notebook(
          metadata={
              "author": "John Doe",
              "title": "Some serious math",
              "jupytext": {"notebook_metadata_filter": "title,author"},
              "kernelspec": {
                  "display_name": "Python 3",
                  "language": "python",
                  "name": "python3",
              },
          }
      ),
      md="""---
  jupyter:
    author: John Doe
    jupytext:
      notebook_metadata_filter: title,author
    kernelspec:
      display_name: Python 3
      language: python
      name: python3
    title: Some serious math
  ---
  """,
  ):
      """Here we test the addition of custom metadata, cf. https://github.com/mwouts/jupytext/issues/469"""
      md2 = jupytext.writes(nb, "md")
      compare(md2, md)
      nb2 = jupytext.reads(md, "md")
      compare_notebooks(nb2, nb)
  
imports: from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_notebook, new_raw_cell
  import jupytext
  from jupytext.combine import combine_inputs_with_outputs
  from jupytext.compare import compare, compare_cells, compare_notebooks
label_desc: Use image node_id 35 for calling a global function with example usage: test_custom_metadata(no_jupytext_version_number, nb, md) without return types