MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / auxiliaries

Function auxiliaries

deps/pybind11-2.13.1/tests/test_numpy_array.cpp:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141template <typename T, typename T2>
142py::handle auxiliaries(T &&r, T2 &&r2) {
143 if (r.ndim() != 2) {
144 throw std::domain_error("error: ndim != 2");
145 }
146 py::list l;
147 l.append(*r.data(0, 0));
148 l.append(*r2.mutable_data(0, 0));
149 l.append(r.data(0, 1) == r2.mutable_data(0, 1));
150 l.append(r.ndim());
151 l.append(r.itemsize());
152 l.append(r.shape(0));
153 l.append(r.shape(1));
154 l.append(r.size());
155 l.append(r.nbytes());
156 return l.release();
157}
158
159// note: declaration at local scope would create a dangling reference!
160static int data_i = 42;

Callers 1

TEST_SUBMODULEFunction · 0.85

Calls 9

releaseMethod · 0.80
ndimMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45
mutable_dataMethod · 0.45
itemsizeMethod · 0.45
shapeMethod · 0.45
sizeMethod · 0.45
nbytesMethod · 0.45

Tested by

no test coverage detected