code: def filtered_notebook_metadata(notebook, ignore_display_name=False):
      """Notebook metadata, filtered for metadata added by Jupytext itself"""
      metadata = filter_metadata(
          notebook.metadata,
          notebook.metadata.get("jupytext", {}).get(
              "notebook_metadata_filter"
          ),
          _DEFAULT_NOTEBOOK_METADATA,
      )
  
      # The display name for the kernel might change (Quarto format on the CI)
      if ignore_display_name:
          metadata.get("kernelspec", {}).pop("display_name", None)
  
      if "jupytext" in metadata:
          del metadata["jupytext"]
      return metadata
  
imports: import difflib
  import json
  import os
  import re
  from jupytext.paired_paths import full_path
  from .cell_metadata import _IGNORE_CELL_METADATA
  from .combine import combine_inputs_with_outputs
  from .formats import check_auto_ext, long_form_one_format
  from .header import _DEFAULT_NOTEBOOK_METADATA
  from .jupytext import read, reads, write, writes
  from .metadata_filter import filter_metadata
label_desc: Use image node_id 4 for calling a global function with example usage: filtered_notebook_metadata(notebook, ignore_display_name) and returns: metadata