Read a notebook using nbformat. Returns (notebook_node, deeplabcut_meta_dict, has_dlc_namespace).
(path: Path)
| 527 | |
| 528 | |
| 529 | def read_ipynb_meta(path: Path) -> tuple[Any, dict, bool]: |
| 530 | """ |
| 531 | Read a notebook using nbformat. |
| 532 | Returns (notebook_node, deeplabcut_meta_dict, has_dlc_namespace). |
| 533 | """ |
| 534 | nb = nbformat.read(str(path), as_version=4) |
| 535 | |
| 536 | meta = getattr(nb, "metadata", {}) or {} |
| 537 | has_dlc = DLC_NAMESPACE in meta |
| 538 | |
| 539 | raw_dlc_meta = meta.get(DLC_NAMESPACE) |
| 540 | return nb, raw_dlc_meta, has_dlc |
| 541 | |
| 542 | |
| 543 | def notebook_is_normalized(path: Path, nb: Any) -> bool: |
no test coverage detected