MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / weight_to_string

Function weight_to_string

cpp_easygraph/common/utils.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13std::string weight_to_string(py::object weight) {
14 py::object warn = py::module_::import("warnings").attr("warn");
15 if (!py::isinstance<py::str>(weight)) {
16 if (!weight.is_none()) {
17 warn(py::str(weight) + py::str(" would be transformed into an instance of str."));
18 }
19 weight = py::str(weight);
20 }
21 std::string weight_key = weight.cast<std::string>();
22 return weight_key;
23}
24
25py::object py_sum(py::object o) {
26 py::object sum = py::module_::import("builtins").attr("sum");

Callers 15

_add_one_nodeFunction · 0.85
Graph_add_nodes_fromFunction · 0.85
_add_one_edgeFunction · 0.85
Graph_add_edges_fromFunction · 0.85
Graph_generate_linkgraphFunction · 0.85
DiGraph_add_one_nodeFunction · 0.85
DiGraph_add_nodes_fromFunction · 0.85
DiGraph_add_one_edgeFunction · 0.85
DiGraph_add_edges_fromFunction · 0.85
kruskal_mst_edgesFunction · 0.85
_dijkstra_multisourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected