| 1307 | } |
| 1308 | |
| 1309 | static PyObject * |
| 1310 | array_choose(PyArrayObject *self, PyObject *args, PyObject *kwds) |
| 1311 | { |
| 1312 | static char *keywords[] = {"out", "mode", NULL}; |
| 1313 | PyObject *choices; |
| 1314 | PyArrayObject *out = NULL; |
| 1315 | NPY_CLIPMODE clipmode = NPY_RAISE; |
| 1316 | Py_ssize_t n = PyTuple_Size(args); |
| 1317 | |
| 1318 | if (n <= 1) { |
| 1319 | if (!PyArg_ParseTuple(args, "O:choose", &choices)) { |
| 1320 | return NULL; |
| 1321 | } |
| 1322 | } |
| 1323 | else { |
| 1324 | choices = args; |
| 1325 | } |
| 1326 | |
| 1327 | if (!NpyArg_ParseKeywords(kwds, "|O&O&", keywords, |
| 1328 | PyArray_OutputConverter, &out, |
| 1329 | PyArray_ClipmodeConverter, &clipmode)) { |
| 1330 | return NULL; |
| 1331 | } |
| 1332 | |
| 1333 | PyObject *ret = PyArray_Choose(self, choices, out, clipmode); |
| 1334 | |
| 1335 | /* this matches the unpacking behavior of ufuncs */ |
| 1336 | if (out == NULL) { |
| 1337 | return PyArray_Return((PyArrayObject *)ret); |
| 1338 | } |
| 1339 | else { |
| 1340 | return ret; |
| 1341 | } |
| 1342 | } |
| 1343 | |
| 1344 | static PyObject * |
| 1345 | array_sort(PyArrayObject *self, |
nothing calls this directly
no test coverage detected