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

Function attr_to_dict

cpp_easygraph/common/utils.cpp:5–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "../classes/linkgraph.h"
4
5py::object attr_to_dict(const node_attr_dict_factory& attr) {
6 py::dict attr_dict = py::dict();
7 for (const auto& kv : attr) {
8 attr_dict[py::cast(kv.first)] = kv.second;
9 }
10 return attr_dict;
11}
12
13std::string weight_to_string(py::object weight) {
14 py::object warn = py::module_::import("warnings").attr("warn");

Callers 8

get_nodesMethod · 0.85
get_adjMethod · 0.85
get_edgesMethod · 0.85
DiGraph_predecessorsFunction · 0.85
get_predMethod · 0.85
get_edgesMethod · 0.85
kruskal_mst_edgesFunction · 0.85
prim_mst_edgesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected