def save_demo(data: str | dict | list, file: Path, traj_path: Path) -> None:
    """Save demo data as a yaml file. Takes care of multi-line strings and adds a header."""
    content = _yaml_serialization_with_linebreaks(data)
    header = DEMO_COMMENT.format(traj_path=str(traj_path))
    with open(file, "w") as f:
        f.write(f"{header}\n{content}")
Save demo data as a yaml file. Takes care of multi-line strings and adds a header.
sweagent/run/run_traj_to_demo.py