MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / consumed_graph_rows

Function consumed_graph_rows

graphify/paths.py:743–749  ·  view source on GitHub ↗

``data`` for networkx to build a graph from once, stamped as ``restore_arc_direction`` stamps it.

(data: dict)

Source from the content-addressed store, hash-verified

741
742
743def consumed_graph_rows(data: dict) -> dict:
744 """``data`` for networkx to build a graph from once, stamped as ``restore_arc_direction`` stamps it."""
745 for link in data["links"]:
746 if isinstance(link, dict):
747 link["_src"] = link.get("_src", link.get("source"))
748 link["_tgt"] = link.get("_tgt", link.get("target"))
749 return dict(data, nodes=consumed(data["nodes"]), links=consumed(data["links"]))
750
751
752def restore_arc_direction(data: dict) -> dict:

Callers 2

dispatch_commandFunction · 0.90
load_node_link_graphFunction · 0.85

Calls 2

consumedFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected