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

Function Graph_nbunch_iter

cpp_easygraph/classes/graph.cpp:208–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208py::object Graph_nbunch_iter(py::object self, py::object nbunch) {
209 py::object bunch = py::none();
210 if (nbunch.is_none()) {
211 bunch = self.attr("adj").attr("__iter__")();
212 } else if (self.contains(nbunch)) {
213 py::list nbunch_wrapper = py::list();
214 nbunch_wrapper.append(nbunch);
215 bunch = nbunch_wrapper.attr("__iter__")();
216 } else {
217 py::list nbunch_list = py::list(nbunch), nodes_list = py::list();
218 for (int i = 0; i < py::len(nbunch_list); i++) {
219 py::object n = nbunch_list[i];
220 if (self.contains(n)) {
221 nodes_list.append(n);
222 }
223 }
224 bunch = nbunch_list.attr("__iter__")();
225 }
226 return bunch;
227}
228
229void _add_one_edge(Graph& self, py::object u_of_edge, py::object v_of_edge, py::object edge_attr) {
230 node_t u, v;

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected