MCPcopy Create free account
hub / github.com/alibaba/graph-learn / get_node_labels

Function get_node_labels

graphlearn/python/c/py_wrapper.h:191–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191PyObject* get_node_labels(LookupNodesResponse* res) {
192 npy_intp shape[1];
193 shape[0] = res->Size();
194 PyArray_Descr* descr = PyArray_DescrFromType(NPY_INT32);
195 PyObject* obj = PyArray_Zeros(1, shape, descr, 0);
196 PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj);
197 memcpy(PyArray_DATA(np_array), res->Labels(),
198 res->Size() * INT32_BYTES);
199 return obj;
200}
201
202PyObject* get_int_attributes(LookupResponse* res) {
203 int32_t attr_num = res->IntAttrNum();

Callers 1

init_client_moduleFunction · 0.85

Calls 2

LabelsMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected