def from_bytes(bytes_graph, check_version=True):
"""Reads a graph from bytes (the result of pickling the graph).
:param bytes bytes_graph: File or filename to write
:param bool check_version: Checks if the graph was produced by this version of PyBEL
:return: A BEL graph
:rtype: BELGraph
"""
graph = loads(bytes_graph)
raise_for_not_bel(graph)
if check_version:
raise_for_old_graph(graph)
return graph
评论列表
文章目录