MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / read_ipynb_meta

Function read_ipynb_meta

tools/docs_and_notebooks_check.py:529–540  ·  view source on GitHub ↗

Read a notebook using nbformat. Returns (notebook_node, deeplabcut_meta_dict, has_dlc_namespace).

(path: Path)

Source from the content-addressed store, hash-verified

527
528
529def 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
543def notebook_is_normalized(path: Path, nb: Any) -> bool:

Callers 3

scan_filesFunction · 0.85
update_filesFunction · 0.85
normalize_notebooksFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected