| 4452 | } |
| 4453 | |
| 4454 | static PyObject * |
| 4455 | normalize_axis_index(PyObject *NPY_UNUSED(self), |
| 4456 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 4457 | { |
| 4458 | int axis; |
| 4459 | int ndim; |
| 4460 | PyObject *msg_prefix = Py_None; |
| 4461 | NPY_PREPARE_ARGPARSER; |
| 4462 | |
| 4463 | if (npy_parse_arguments("normalize_axis_index", args, len_args, kwnames, |
| 4464 | "axis", &PyArray_PythonPyIntFromInt, &axis, |
| 4465 | "ndim", &PyArray_PythonPyIntFromInt, &ndim, |
| 4466 | "|msg_prefix", NULL, &msg_prefix, |
| 4467 | NULL, NULL, NULL) < 0) { |
| 4468 | return NULL; |
| 4469 | } |
| 4470 | if (check_and_adjust_axis_msg(&axis, ndim, msg_prefix) < 0) { |
| 4471 | return NULL; |
| 4472 | } |
| 4473 | |
| 4474 | return PyLong_FromLong(axis); |
| 4475 | } |
| 4476 | |
| 4477 | |
| 4478 | static PyObject * |
no test coverage detected