(path: Path, nb: Any)
| 541 | |
| 542 | |
| 543 | def notebook_is_normalized(path: Path, nb: Any) -> bool: |
| 544 | original = path.read_text(encoding="utf-8") |
| 545 | # Normalize newline style so CRLF vs LF differences do not cause false mismatches |
| 546 | original_normalized = original.replace("\r\n", "\n").replace("\r", "\n") |
| 547 | normalized = nbformat.writes(nb, version=4, indent=2, ensure_ascii=False) + "\n" |
| 548 | return original_normalized == normalized |
| 549 | |
| 550 | |
| 551 | def write_ipynb_meta(path: Path, nb: Any) -> None: |
no outgoing calls
no test coverage detected