def drop_metadata(nb: nbf.notebooknode.NotebookNode) -> None:
    """Replaces notebook and cells metadata with empty dicts."""
    nb["metadata"] = dict()
    for i in range(len(nb["cells"])):
        nb["cells"][i]["metadata"] = dict()
Replaces notebook and cells metadata with empty dicts.
utils/prepare/optimize_ipynb.py