code: def test_filter_nested_metadata():
      metadata = {"I": {"1": {"a": 1, "b": 2}}}
  
      assert filter_metadata(metadata, "I", "-all") == {
          "I": {"1": {"a": 1, "b": 2}}
      }
      assert filter_metadata(metadata, "-I") == {}
  
      assert filter_metadata(metadata, "I.1.a", "-all") == {
          "I": {"1": {"a": 1}}
      }
      assert filter_metadata(metadata, "-I.1.b") == {
          "I": {"1": {"a": 1}}
      }
  
      assert filter_metadata(metadata, "-I.1.b", "I") == {
          "I": {"1": {"a": 1}}
      }
  
imports: from copy import deepcopy
  import pytest
  from nbformat.v4.nbbase import new_code_cell, new_notebook
  from jupytext import reads, writes
  from jupytext.cli import jupytext
  from jupytext.compare import compare, compare_notebooks
  from jupytext.metadata_filter import filter_metadata, metadata_filter_as_dict
label_desc: Use image node_id 11 for calling a global function with example usage: test_filter_nested_metadata() without return types