| 149 | } |
| 150 | |
| 151 | PyObject* get_node_ids(GetNodesResponse* res) { |
| 152 | npy_intp shape[1]; |
| 153 | shape[0] = res->Size(); |
| 154 | PyArray_Descr* descr = PyArray_DescrFromType(NPY_INT64); |
| 155 | PyObject* obj = PyArray_Zeros(1, shape, descr, 0); |
| 156 | PyArrayObject* np_array = reinterpret_cast<PyArrayObject*>(obj); |
| 157 | memcpy(PyArray_DATA(np_array), res->NodeIds(), |
| 158 | res->Size() * INT64_BYTES); |
| 159 | return obj; |
| 160 | } |
| 161 | |
| 162 | LookupNodesRequest* new_lookup_nodes_request( |
| 163 | const std::string& node_type) { |
no test coverage detected