| 418 | } |
| 419 | |
| 420 | PyObject* get_sampling_node_ids(SamplingResponse* res) { |
| 421 | int32_t size = res->TotalNeighborCount(); |
| 422 | npy_intp shape[1]; |
| 423 | shape[0] = size; |
| 424 | PyArray_Descr* descr = PyArray_DescrFromType(NPY_INT64); |
| 425 | PyObject* obj = PyArray_Zeros(1, shape, descr, 0); |
| 426 | PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj); |
| 427 | memcpy(reinterpret_cast<int64_t*>(PyArray_DATA(np_array)), |
| 428 | res->GetNeighborIds(), size * INT64_BYTES); |
| 429 | return obj; |
| 430 | } |
| 431 | |
| 432 | PyObject* get_sampling_edge_ids(SamplingResponse* res) { |
| 433 | int32_t size = res->TotalNeighborCount(); |
no test coverage detected