code: def test_strip_invalid_metadata():
      with TestsBase.fopen("v4_5_invalid_metadata.ipynb", "r") as f:
          nb = nbformat.from_dict(json.load(f))
      assert not isvalid(nb)
      with pytest.warns(DeprecationWarning):
          validate(nb, strip_invalid_metadata=True)
      assert isvalid(nb)
  
imports: from __future__ import annotations
  import json
  import os
  import re
  from copy import deepcopy
  import pytest
  from jsonschema import ValidationError
  import nbformat
  from nbformat import read
  from nbformat.json_compat import VALIDATORS
  from nbformat.validator import isvalid, iter_validate, validate
  from nbformat.warnings import DuplicateCellId, MissingIDFieldWarning
  from .base import TestsBase
label_desc: Use image node_id 34 for calling a global function with example usage: test_strip_invalid_metadata() without return types