Yc@sdZdZddgZddlZddlmZeddd d d Zed dd dZdZ dZ dS(s  **** YAML **** Read and write NetworkX graphs in YAML format. "YAML is a data serialization format designed for human readability and interaction with scripting languages." See http://www.yaml.org for documentation. Format ------ http://pyyaml.org/wiki/PyYAML sAric Hagberg (hagberg@lanl.gov)t read_yamlt write_yamliN(t open_fileitmodetwsUTF-8cKsGyddl}Wntk r/tdnX|j|||dS(sTWrite graph G in YAML format to path. YAML is a data serialization format designed for human readability and interaction with scripting languages [1]_. Parameters ---------- G : graph A NetworkX graph path : file or string File or filename to write. Filenames ending in .gz or .bz2 will be compressed. encoding: string, optional Specify which encoding to use when writing file. Examples -------- >>> G=nx.path_graph(4) >>> nx.write_yaml(G,'test.yaml') References ---------- .. [1] http://www.yaml.org iNs0write_yaml() requires PyYAML: http://pyyaml.org/(tyamlt ImportErrortdump(tGtpathtencodingtkwdsR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/readwrite/nx_yaml.pyRs  itrcCsCyddl}Wntk r/tdnX|j|}|S(s-Read graph in YAML format from path. YAML is a data serialization format designed for human readability and interaction with scripting languages [1]_. Parameters ---------- path : file or string File or filename to read. Filenames ending in .gz or .bz2 will be uncompressed. Returns ------- G : NetworkX graph Examples -------- >>> G=nx.path_graph(4) >>> nx.write_yaml(G,'test.yaml') >>> G=nx.read_yaml('test.yaml') References ---------- .. [1] http://www.yaml.org iNs/read_yaml() requires PyYAML: http://pyyaml.org/(RRtload(R RR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/readwrite/nx_yaml.pyR=s  cCs:ddlm}yddl}Wn|dnXdS(Ni(tSkipTestsPyYAML not available(tnoseRR(tmoduleRR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/readwrite/nx_yaml.pyt setup_modulecs cCsddl}|jddS(Nis test.yaml(tostunlink(RR((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/readwrite/nx_yaml.pytteardown_moduleks ( t__doc__t __author__t__all__tnetworkxtnxtnetworkx.utilsRRRRR(((sp/private/var/folders/w6/vb91730s7bb1k90y_rnhql1dhvdd44/T/pip-build-w4MwvS/networkx/networkx/readwrite/nx_yaml.pyts  &