MCPcopy Create free account
hub / github.com/numpy/numpy / array_contains

Function array_contains

numpy/core/src/multiarray/sequence.c:29–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27*/
28
29static int
30array_contains(PyArrayObject *self, PyObject *el)
31{
32 /* equivalent to (self == el).any() */
33
34 int ret;
35 PyObject *res, *any;
36
37 res = PyArray_EnsureAnyArray(PyObject_RichCompare((PyObject *)self,
38 el, Py_EQ));
39 if (res == NULL) {
40 return -1;
41 }
42
43 any = PyArray_Any((PyArrayObject *)res, NPY_MAXDIMS, NULL);
44 Py_DECREF(res);
45 if (any == NULL) {
46 return -1;
47 }
48
49 ret = PyObject_IsTrue(any);
50 Py_DECREF(any);
51 return ret;
52}
53
54static PyObject *
55array_concat(PyObject *self, PyObject *other)

Callers

nothing calls this directly

Calls 2

PyArray_EnsureAnyArrayFunction · 0.85
PyArray_AnyFunction · 0.85

Tested by

no test coverage detected