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

Function dump_md_frontmatter

tools/docs_and_notebooks_check.py:519–526  ·  view source on GitHub ↗
(frontmatter: dict, body: str)

Source from the content-addressed store, hash-verified

517
518
519def dump_md_frontmatter(frontmatter: dict, body: str) -> str:
520 if yaml is None:
521 raise RuntimeError("PyYAML is required to write Markdown frontmatter")
522 fm_text = yaml.safe_dump(frontmatter, sort_keys=False, allow_unicode=True)
523 body_to_write = body
524 if body_to_write.startswith("\n"):
525 body_to_write = body_to_write[1:]
526 return "---\n" + fm_text + "---\n" + body_to_write
527
528
529def read_ipynb_meta(path: Path) -> tuple[Any, dict, bool]:

Callers 1

update_filesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected