1 /* Generated by Cython 0.29.24 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [],
7         "language": "c++",
8         "name": "openTSNE._matrix_mul.matrix_mul",
9         "sources": [
10             "openTSNE/_matrix_mul/matrix_mul_numpy.pyx"
11         ]
12     },
13     "module_name": "openTSNE._matrix_mul.matrix_mul"
14 }
15 END: Cython Metadata */
16 
17 #ifndef PY_SSIZE_T_CLEAN
18 #define PY_SSIZE_T_CLEAN
19 #endif /* PY_SSIZE_T_CLEAN */
20 #include "Python.h"
21 #ifndef Py_PYTHON_H
22     #error Python headers needed to compile C extensions, please install development version of Python.
23 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
24     #error Cython requires Python 2.6+ or Python 3.3+.
25 #else
26 #define CYTHON_ABI "0_29_24"
27 #define CYTHON_HEX_VERSION 0x001D18F0
28 #define CYTHON_FUTURE_DIVISION 1
29 #include <stddef.h>
30 #ifndef offsetof
31   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
32 #endif
33 #if !defined(WIN32) && !defined(MS_WINDOWS)
34   #ifndef __stdcall
35     #define __stdcall
36   #endif
37   #ifndef __cdecl
38     #define __cdecl
39   #endif
40   #ifndef __fastcall
41     #define __fastcall
42   #endif
43 #endif
44 #ifndef DL_IMPORT
45   #define DL_IMPORT(t) t
46 #endif
47 #ifndef DL_EXPORT
48   #define DL_EXPORT(t) t
49 #endif
50 #define __PYX_COMMA ,
51 #ifndef HAVE_LONG_LONG
52   #if PY_VERSION_HEX >= 0x02070000
53     #define HAVE_LONG_LONG
54   #endif
55 #endif
56 #ifndef PY_LONG_LONG
57   #define PY_LONG_LONG LONG_LONG
58 #endif
59 #ifndef Py_HUGE_VAL
60   #define Py_HUGE_VAL HUGE_VAL
61 #endif
62 #ifdef PYPY_VERSION
63   #define CYTHON_COMPILING_IN_PYPY 1
64   #define CYTHON_COMPILING_IN_PYSTON 0
65   #define CYTHON_COMPILING_IN_CPYTHON 0
66   #undef CYTHON_USE_TYPE_SLOTS
67   #define CYTHON_USE_TYPE_SLOTS 0
68   #undef CYTHON_USE_PYTYPE_LOOKUP
69   #define CYTHON_USE_PYTYPE_LOOKUP 0
70   #if PY_VERSION_HEX < 0x03050000
71     #undef CYTHON_USE_ASYNC_SLOTS
72     #define CYTHON_USE_ASYNC_SLOTS 0
73   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
74     #define CYTHON_USE_ASYNC_SLOTS 1
75   #endif
76   #undef CYTHON_USE_PYLIST_INTERNALS
77   #define CYTHON_USE_PYLIST_INTERNALS 0
78   #undef CYTHON_USE_UNICODE_INTERNALS
79   #define CYTHON_USE_UNICODE_INTERNALS 0
80   #undef CYTHON_USE_UNICODE_WRITER
81   #define CYTHON_USE_UNICODE_WRITER 0
82   #undef CYTHON_USE_PYLONG_INTERNALS
83   #define CYTHON_USE_PYLONG_INTERNALS 0
84   #undef CYTHON_AVOID_BORROWED_REFS
85   #define CYTHON_AVOID_BORROWED_REFS 1
86   #undef CYTHON_ASSUME_SAFE_MACROS
87   #define CYTHON_ASSUME_SAFE_MACROS 0
88   #undef CYTHON_UNPACK_METHODS
89   #define CYTHON_UNPACK_METHODS 0
90   #undef CYTHON_FAST_THREAD_STATE
91   #define CYTHON_FAST_THREAD_STATE 0
92   #undef CYTHON_FAST_PYCALL
93   #define CYTHON_FAST_PYCALL 0
94   #undef CYTHON_PEP489_MULTI_PHASE_INIT
95   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
96   #undef CYTHON_USE_TP_FINALIZE
97   #define CYTHON_USE_TP_FINALIZE 0
98   #undef CYTHON_USE_DICT_VERSIONS
99   #define CYTHON_USE_DICT_VERSIONS 0
100   #undef CYTHON_USE_EXC_INFO_STACK
101   #define CYTHON_USE_EXC_INFO_STACK 0
102 #elif defined(PYSTON_VERSION)
103   #define CYTHON_COMPILING_IN_PYPY 0
104   #define CYTHON_COMPILING_IN_PYSTON 1
105   #define CYTHON_COMPILING_IN_CPYTHON 0
106   #ifndef CYTHON_USE_TYPE_SLOTS
107     #define CYTHON_USE_TYPE_SLOTS 1
108   #endif
109   #undef CYTHON_USE_PYTYPE_LOOKUP
110   #define CYTHON_USE_PYTYPE_LOOKUP 0
111   #undef CYTHON_USE_ASYNC_SLOTS
112   #define CYTHON_USE_ASYNC_SLOTS 0
113   #undef CYTHON_USE_PYLIST_INTERNALS
114   #define CYTHON_USE_PYLIST_INTERNALS 0
115   #ifndef CYTHON_USE_UNICODE_INTERNALS
116     #define CYTHON_USE_UNICODE_INTERNALS 1
117   #endif
118   #undef CYTHON_USE_UNICODE_WRITER
119   #define CYTHON_USE_UNICODE_WRITER 0
120   #undef CYTHON_USE_PYLONG_INTERNALS
121   #define CYTHON_USE_PYLONG_INTERNALS 0
122   #ifndef CYTHON_AVOID_BORROWED_REFS
123     #define CYTHON_AVOID_BORROWED_REFS 0
124   #endif
125   #ifndef CYTHON_ASSUME_SAFE_MACROS
126     #define CYTHON_ASSUME_SAFE_MACROS 1
127   #endif
128   #ifndef CYTHON_UNPACK_METHODS
129     #define CYTHON_UNPACK_METHODS 1
130   #endif
131   #undef CYTHON_FAST_THREAD_STATE
132   #define CYTHON_FAST_THREAD_STATE 0
133   #undef CYTHON_FAST_PYCALL
134   #define CYTHON_FAST_PYCALL 0
135   #undef CYTHON_PEP489_MULTI_PHASE_INIT
136   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
137   #undef CYTHON_USE_TP_FINALIZE
138   #define CYTHON_USE_TP_FINALIZE 0
139   #undef CYTHON_USE_DICT_VERSIONS
140   #define CYTHON_USE_DICT_VERSIONS 0
141   #undef CYTHON_USE_EXC_INFO_STACK
142   #define CYTHON_USE_EXC_INFO_STACK 0
143 #else
144   #define CYTHON_COMPILING_IN_PYPY 0
145   #define CYTHON_COMPILING_IN_PYSTON 0
146   #define CYTHON_COMPILING_IN_CPYTHON 1
147   #ifndef CYTHON_USE_TYPE_SLOTS
148     #define CYTHON_USE_TYPE_SLOTS 1
149   #endif
150   #if PY_VERSION_HEX < 0x02070000
151     #undef CYTHON_USE_PYTYPE_LOOKUP
152     #define CYTHON_USE_PYTYPE_LOOKUP 0
153   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
154     #define CYTHON_USE_PYTYPE_LOOKUP 1
155   #endif
156   #if PY_MAJOR_VERSION < 3
157     #undef CYTHON_USE_ASYNC_SLOTS
158     #define CYTHON_USE_ASYNC_SLOTS 0
159   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
160     #define CYTHON_USE_ASYNC_SLOTS 1
161   #endif
162   #if PY_VERSION_HEX < 0x02070000
163     #undef CYTHON_USE_PYLONG_INTERNALS
164     #define CYTHON_USE_PYLONG_INTERNALS 0
165   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
166     #define CYTHON_USE_PYLONG_INTERNALS 1
167   #endif
168   #ifndef CYTHON_USE_PYLIST_INTERNALS
169     #define CYTHON_USE_PYLIST_INTERNALS 1
170   #endif
171   #ifndef CYTHON_USE_UNICODE_INTERNALS
172     #define CYTHON_USE_UNICODE_INTERNALS 1
173   #endif
174   #if PY_VERSION_HEX < 0x030300F0
175     #undef CYTHON_USE_UNICODE_WRITER
176     #define CYTHON_USE_UNICODE_WRITER 0
177   #elif !defined(CYTHON_USE_UNICODE_WRITER)
178     #define CYTHON_USE_UNICODE_WRITER 1
179   #endif
180   #ifndef CYTHON_AVOID_BORROWED_REFS
181     #define CYTHON_AVOID_BORROWED_REFS 0
182   #endif
183   #ifndef CYTHON_ASSUME_SAFE_MACROS
184     #define CYTHON_ASSUME_SAFE_MACROS 1
185   #endif
186   #ifndef CYTHON_UNPACK_METHODS
187     #define CYTHON_UNPACK_METHODS 1
188   #endif
189   #ifndef CYTHON_FAST_THREAD_STATE
190     #define CYTHON_FAST_THREAD_STATE 1
191   #endif
192   #ifndef CYTHON_FAST_PYCALL
193     #define CYTHON_FAST_PYCALL 1
194   #endif
195   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
196     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
197   #endif
198   #ifndef CYTHON_USE_TP_FINALIZE
199     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
200   #endif
201   #ifndef CYTHON_USE_DICT_VERSIONS
202     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
203   #endif
204   #ifndef CYTHON_USE_EXC_INFO_STACK
205     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
206   #endif
207 #endif
208 #if !defined(CYTHON_FAST_PYCCALL)
209 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
210 #endif
211 #if CYTHON_USE_PYLONG_INTERNALS
212   #include "longintrepr.h"
213   #undef SHIFT
214   #undef BASE
215   #undef MASK
216   #ifdef SIZEOF_VOID_P
217     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
218   #endif
219 #endif
220 #ifndef __has_attribute
221   #define __has_attribute(x) 0
222 #endif
223 #ifndef __has_cpp_attribute
224   #define __has_cpp_attribute(x) 0
225 #endif
226 #ifndef CYTHON_RESTRICT
227   #if defined(__GNUC__)
228     #define CYTHON_RESTRICT __restrict__
229   #elif defined(_MSC_VER) && _MSC_VER >= 1400
230     #define CYTHON_RESTRICT __restrict
231   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
232     #define CYTHON_RESTRICT restrict
233   #else
234     #define CYTHON_RESTRICT
235   #endif
236 #endif
237 #ifndef CYTHON_UNUSED
238 # if defined(__GNUC__)
239 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
240 #     define CYTHON_UNUSED __attribute__ ((__unused__))
241 #   else
242 #     define CYTHON_UNUSED
243 #   endif
244 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
245 #   define CYTHON_UNUSED __attribute__ ((__unused__))
246 # else
247 #   define CYTHON_UNUSED
248 # endif
249 #endif
250 #ifndef CYTHON_MAYBE_UNUSED_VAR
251 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)252      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
253 #  else
254 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
255 #  endif
256 #endif
257 #ifndef CYTHON_NCP_UNUSED
258 # if CYTHON_COMPILING_IN_CPYTHON
259 #  define CYTHON_NCP_UNUSED
260 # else
261 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
262 # endif
263 #endif
264 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
265 #ifdef _MSC_VER
266     #ifndef _MSC_STDINT_H_
267         #if _MSC_VER < 1300
268            typedef unsigned char     uint8_t;
269            typedef unsigned int      uint32_t;
270         #else
271            typedef unsigned __int8   uint8_t;
272            typedef unsigned __int32  uint32_t;
273         #endif
274     #endif
275 #else
276    #include <stdint.h>
277 #endif
278 #ifndef CYTHON_FALLTHROUGH
279   #if defined(__cplusplus) && __cplusplus >= 201103L
280     #if __has_cpp_attribute(fallthrough)
281       #define CYTHON_FALLTHROUGH [[fallthrough]]
282     #elif __has_cpp_attribute(clang::fallthrough)
283       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
284     #elif __has_cpp_attribute(gnu::fallthrough)
285       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
286     #endif
287   #endif
288   #ifndef CYTHON_FALLTHROUGH
289     #if __has_attribute(fallthrough)
290       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
291     #else
292       #define CYTHON_FALLTHROUGH
293     #endif
294   #endif
295   #if defined(__clang__ ) && defined(__apple_build_version__)
296     #if __apple_build_version__ < 7000000
297       #undef  CYTHON_FALLTHROUGH
298       #define CYTHON_FALLTHROUGH
299     #endif
300   #endif
301 #endif
302 
303 #ifndef __cplusplus
304   #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
305 #endif
306 #ifndef CYTHON_INLINE
307   #if defined(__clang__)
308     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309   #else
310     #define CYTHON_INLINE inline
311   #endif
312 #endif
313 template<typename T>
__Pyx_call_destructor(T & x)314 void __Pyx_call_destructor(T& x) {
315     x.~T();
316 }
317 template<typename T>
318 class __Pyx_FakeReference {
319   public:
__Pyx_FakeReference()320     __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)321     __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()322     T *operator->() { return ptr; }
operator &()323     T *operator&() { return ptr; }
operator T&()324     operator T&() { return *ptr; }
operator ==(U other)325     template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)326     template<typename U> bool operator !=(U other) { return *ptr != other; }
327   private:
328     T *ptr;
329 };
330 
331 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
332   #define Py_OptimizeFlag 0
333 #endif
334 #define __PYX_BUILD_PY_SSIZE_T "n"
335 #define CYTHON_FORMAT_SSIZE_T "z"
336 #if PY_MAJOR_VERSION < 3
337   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
338   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
339           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
340   #define __Pyx_DefaultClassType PyClass_Type
341 #else
342   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
343 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
344   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
345           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
346 #else
347   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
348           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
349 #endif
350   #define __Pyx_DefaultClassType PyType_Type
351 #endif
352 #ifndef Py_TPFLAGS_CHECKTYPES
353   #define Py_TPFLAGS_CHECKTYPES 0
354 #endif
355 #ifndef Py_TPFLAGS_HAVE_INDEX
356   #define Py_TPFLAGS_HAVE_INDEX 0
357 #endif
358 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
359   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
360 #endif
361 #ifndef Py_TPFLAGS_HAVE_FINALIZE
362   #define Py_TPFLAGS_HAVE_FINALIZE 0
363 #endif
364 #ifndef METH_STACKLESS
365   #define METH_STACKLESS 0
366 #endif
367 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
368   #ifndef METH_FASTCALL
369      #define METH_FASTCALL 0x80
370   #endif
371   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
372   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
373                                                           Py_ssize_t nargs, PyObject *kwnames);
374 #else
375   #define __Pyx_PyCFunctionFast _PyCFunctionFast
376   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
377 #endif
378 #if CYTHON_FAST_PYCCALL
379 #define __Pyx_PyFastCFunction_Check(func)\
380     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
381 #else
382 #define __Pyx_PyFastCFunction_Check(func) 0
383 #endif
384 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
385   #define PyObject_Malloc(s)   PyMem_Malloc(s)
386   #define PyObject_Free(p)     PyMem_Free(p)
387   #define PyObject_Realloc(p)  PyMem_Realloc(p)
388 #endif
389 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
390   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
391   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
392   #define PyMem_RawFree(p)             PyMem_Free(p)
393 #endif
394 #if CYTHON_COMPILING_IN_PYSTON
395   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
396   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
397 #else
398   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
399   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
400 #endif
401 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
402   #define __Pyx_PyThreadState_Current PyThreadState_GET()
403 #elif PY_VERSION_HEX >= 0x03060000
404   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
405 #elif PY_VERSION_HEX >= 0x03000000
406   #define __Pyx_PyThreadState_Current PyThreadState_GET()
407 #else
408   #define __Pyx_PyThreadState_Current _PyThreadState_Current
409 #endif
410 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
411 #include "pythread.h"
412 #define Py_tss_NEEDS_INIT 0
413 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)414 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
415   *key = PyThread_create_key();
416   return 0;
417 }
PyThread_tss_alloc(void)418 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
419   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
420   *key = Py_tss_NEEDS_INIT;
421   return key;
422 }
PyThread_tss_free(Py_tss_t * key)423 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
424   PyObject_Free(key);
425 }
PyThread_tss_is_created(Py_tss_t * key)426 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
427   return *key != Py_tss_NEEDS_INIT;
428 }
PyThread_tss_delete(Py_tss_t * key)429 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
430   PyThread_delete_key(*key);
431   *key = Py_tss_NEEDS_INIT;
432 }
PyThread_tss_set(Py_tss_t * key,void * value)433 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
434   return PyThread_set_key_value(*key, value);
435 }
PyThread_tss_get(Py_tss_t * key)436 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
437   return PyThread_get_key_value(*key);
438 }
439 #endif
440 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
441 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
442 #else
443 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
444 #endif
445 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
446   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
447   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
448 #else
449   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
450   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
451 #endif
452 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
453 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
454 #else
455 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
456 #endif
457 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
458   #define CYTHON_PEP393_ENABLED 1
459   #if defined(PyUnicode_IS_READY)
460   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
461                                               0 : _PyUnicode_Ready((PyObject *)(op)))
462   #else
463   #define __Pyx_PyUnicode_READY(op)       (0)
464   #endif
465   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
466   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
467   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
468   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
469   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
470   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
471   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
472   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
473   #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
475   #else
476   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
477   #endif
478   #else
479   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
480   #endif
481 #else
482   #define CYTHON_PEP393_ENABLED 0
483   #define PyUnicode_1BYTE_KIND  1
484   #define PyUnicode_2BYTE_KIND  2
485   #define PyUnicode_4BYTE_KIND  4
486   #define __Pyx_PyUnicode_READY(op)       (0)
487   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
488   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
489   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
490   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
491   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
492   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
493   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
494   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
495 #endif
496 #if CYTHON_COMPILING_IN_PYPY
497   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
498   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
499 #else
500   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
501   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
502       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
503 #endif
504 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
505   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
506 #endif
507 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
508   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
509 #endif
510 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
511   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
512 #endif
513 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
514 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
515 #if PY_MAJOR_VERSION >= 3
516   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
517 #else
518   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
519 #endif
520 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
521   #define PyObject_ASCII(o)            PyObject_Repr(o)
522 #endif
523 #if PY_MAJOR_VERSION >= 3
524   #define PyBaseString_Type            PyUnicode_Type
525   #define PyStringObject               PyUnicodeObject
526   #define PyString_Type                PyUnicode_Type
527   #define PyString_Check               PyUnicode_Check
528   #define PyString_CheckExact          PyUnicode_CheckExact
529 #ifndef PyObject_Unicode
530   #define PyObject_Unicode             PyObject_Str
531 #endif
532 #endif
533 #if PY_MAJOR_VERSION >= 3
534   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
535   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
536 #else
537   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
538   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
539 #endif
540 #ifndef PySet_CheckExact
541   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
542 #endif
543 #if PY_VERSION_HEX >= 0x030900A4
544   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
545   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
546 #else
547   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
548   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
549 #endif
550 #if CYTHON_ASSUME_SAFE_MACROS
551   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
552 #else
553   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
554 #endif
555 #if PY_MAJOR_VERSION >= 3
556   #define PyIntObject                  PyLongObject
557   #define PyInt_Type                   PyLong_Type
558   #define PyInt_Check(op)              PyLong_Check(op)
559   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
560   #define PyInt_FromString             PyLong_FromString
561   #define PyInt_FromUnicode            PyLong_FromUnicode
562   #define PyInt_FromLong               PyLong_FromLong
563   #define PyInt_FromSize_t             PyLong_FromSize_t
564   #define PyInt_FromSsize_t            PyLong_FromSsize_t
565   #define PyInt_AsLong                 PyLong_AsLong
566   #define PyInt_AS_LONG                PyLong_AS_LONG
567   #define PyInt_AsSsize_t              PyLong_AsSsize_t
568   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
569   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
570   #define PyNumber_Int                 PyNumber_Long
571 #endif
572 #if PY_MAJOR_VERSION >= 3
573   #define PyBoolObject                 PyLongObject
574 #endif
575 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
576   #ifndef PyUnicode_InternFromString
577     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
578   #endif
579 #endif
580 #if PY_VERSION_HEX < 0x030200A4
581   typedef long Py_hash_t;
582   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
583   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
584 #else
585   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
586   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
587 #endif
588 #if PY_MAJOR_VERSION >= 3
589   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
590 #else
591   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
592 #endif
593 #if CYTHON_USE_ASYNC_SLOTS
594   #if PY_VERSION_HEX >= 0x030500B1
595     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
596     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
597   #else
598     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
599   #endif
600 #else
601   #define __Pyx_PyType_AsAsync(obj) NULL
602 #endif
603 #ifndef __Pyx_PyAsyncMethodsStruct
604     typedef struct {
605         unaryfunc am_await;
606         unaryfunc am_aiter;
607         unaryfunc am_anext;
608     } __Pyx_PyAsyncMethodsStruct;
609 #endif
610 
611 #if defined(WIN32) || defined(MS_WINDOWS)
612   #define _USE_MATH_DEFINES
613 #endif
614 #include <math.h>
615 #ifdef NAN
616 #define __PYX_NAN() ((float) NAN)
617 #else
__PYX_NAN()618 static CYTHON_INLINE float __PYX_NAN() {
619   float value;
620   memset(&value, 0xFF, sizeof(value));
621   return value;
622 }
623 #endif
624 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
625 #define __Pyx_truncl trunc
626 #else
627 #define __Pyx_truncl truncl
628 #endif
629 
630 #define __PYX_MARK_ERR_POS(f_index, lineno) \
631     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
632 #define __PYX_ERR(f_index, lineno, Ln_error) \
633     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
634 
635 #ifndef __PYX_EXTERN_C
636   #ifdef __cplusplus
637     #define __PYX_EXTERN_C extern "C"
638   #else
639     #define __PYX_EXTERN_C extern
640   #endif
641 #endif
642 
643 #define __PYX_HAVE__openTSNE___matrix_mul__matrix_mul
644 #define __PYX_HAVE_API__openTSNE___matrix_mul__matrix_mul
645 /* Early includes */
646 #include <string.h>
647 #include <stdio.h>
648 #include "numpy/arrayobject.h"
649 #include "numpy/ufuncobject.h"
650 #include "pythread.h"
651 #include <stdlib.h>
652 #include "pystate.h"
653 #ifdef _OPENMP
654 #include <omp.h>
655 #endif /* _OPENMP */
656 
657 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
658 #define CYTHON_WITHOUT_ASSERTIONS
659 #endif
660 
661 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
662                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
663 
664 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
665 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
666 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
667 #define __PYX_DEFAULT_STRING_ENCODING ""
668 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
669 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
670 #define __Pyx_uchar_cast(c) ((unsigned char)c)
671 #define __Pyx_long_cast(x) ((long)x)
672 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
673     (sizeof(type) < sizeof(Py_ssize_t))  ||\
674     (sizeof(type) > sizeof(Py_ssize_t) &&\
675           likely(v < (type)PY_SSIZE_T_MAX ||\
676                  v == (type)PY_SSIZE_T_MAX)  &&\
677           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
678                                 v == (type)PY_SSIZE_T_MIN)))  ||\
679     (sizeof(type) == sizeof(Py_ssize_t) &&\
680           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
681                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)682 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
683     return (size_t) i < (size_t) limit;
684 }
685 #if defined (__cplusplus) && __cplusplus >= 201103L
686     #include <cstdlib>
687     #define __Pyx_sst_abs(value) std::abs(value)
688 #elif SIZEOF_INT >= SIZEOF_SIZE_T
689     #define __Pyx_sst_abs(value) abs(value)
690 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
691     #define __Pyx_sst_abs(value) labs(value)
692 #elif defined (_MSC_VER)
693     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
694 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
695     #define __Pyx_sst_abs(value) llabs(value)
696 #elif defined (__GNUC__)
697     #define __Pyx_sst_abs(value) __builtin_llabs(value)
698 #else
699     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
700 #endif
701 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
702 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
703 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
704 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
705 #define __Pyx_PyBytes_FromString        PyBytes_FromString
706 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
707 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
708 #if PY_MAJOR_VERSION < 3
709     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
710     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
711 #else
712     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
713     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
714 #endif
715 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
716 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
717 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
718 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
719 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
720 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
721 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
722 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
723 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
724 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
725 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
726 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
727 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
728 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
729 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
730 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)731 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
732     const Py_UNICODE *u_end = u;
733     while (*u_end++) ;
734     return (size_t)(u_end - u - 1);
735 }
736 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
737 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
738 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
739 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
740 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
741 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
742 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
743 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
744 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
745 #define __Pyx_PySequence_Tuple(obj)\
746     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
747 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
748 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
749 #if CYTHON_ASSUME_SAFE_MACROS
750 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
751 #else
752 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
753 #endif
754 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
755 #if PY_MAJOR_VERSION >= 3
756 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
757 #else
758 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
759 #endif
760 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
761 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
762 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)763 static int __Pyx_init_sys_getdefaultencoding_params(void) {
764     PyObject* sys;
765     PyObject* default_encoding = NULL;
766     PyObject* ascii_chars_u = NULL;
767     PyObject* ascii_chars_b = NULL;
768     const char* default_encoding_c;
769     sys = PyImport_ImportModule("sys");
770     if (!sys) goto bad;
771     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
772     Py_DECREF(sys);
773     if (!default_encoding) goto bad;
774     default_encoding_c = PyBytes_AsString(default_encoding);
775     if (!default_encoding_c) goto bad;
776     if (strcmp(default_encoding_c, "ascii") == 0) {
777         __Pyx_sys_getdefaultencoding_not_ascii = 0;
778     } else {
779         char ascii_chars[128];
780         int c;
781         for (c = 0; c < 128; c++) {
782             ascii_chars[c] = c;
783         }
784         __Pyx_sys_getdefaultencoding_not_ascii = 1;
785         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
786         if (!ascii_chars_u) goto bad;
787         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
788         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
789             PyErr_Format(
790                 PyExc_ValueError,
791                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
792                 default_encoding_c);
793             goto bad;
794         }
795         Py_DECREF(ascii_chars_u);
796         Py_DECREF(ascii_chars_b);
797     }
798     Py_DECREF(default_encoding);
799     return 0;
800 bad:
801     Py_XDECREF(default_encoding);
802     Py_XDECREF(ascii_chars_u);
803     Py_XDECREF(ascii_chars_b);
804     return -1;
805 }
806 #endif
807 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
808 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
809 #else
810 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
811 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
812 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)813 static int __Pyx_init_sys_getdefaultencoding_params(void) {
814     PyObject* sys;
815     PyObject* default_encoding = NULL;
816     char* default_encoding_c;
817     sys = PyImport_ImportModule("sys");
818     if (!sys) goto bad;
819     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
820     Py_DECREF(sys);
821     if (!default_encoding) goto bad;
822     default_encoding_c = PyBytes_AsString(default_encoding);
823     if (!default_encoding_c) goto bad;
824     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
825     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
826     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
827     Py_DECREF(default_encoding);
828     return 0;
829 bad:
830     Py_XDECREF(default_encoding);
831     return -1;
832 }
833 #endif
834 #endif
835 
836 
837 /* Test for GCC > 2.95 */
838 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
839   #define likely(x)   __builtin_expect(!!(x), 1)
840   #define unlikely(x) __builtin_expect(!!(x), 0)
841 #else /* !__GNUC__ or GCC < 2.95 */
842   #define likely(x)   (x)
843   #define unlikely(x) (x)
844 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)845 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
846 
847 static PyObject *__pyx_m = NULL;
848 static PyObject *__pyx_d;
849 static PyObject *__pyx_b;
850 static PyObject *__pyx_cython_runtime = NULL;
851 static PyObject *__pyx_empty_tuple;
852 static PyObject *__pyx_empty_bytes;
853 static PyObject *__pyx_empty_unicode;
854 static int __pyx_lineno;
855 static int __pyx_clineno = 0;
856 static const char * __pyx_cfilenm= __FILE__;
857 static const char *__pyx_filename;
858 
859 /* Header.proto */
860 #if !defined(CYTHON_CCOMPLEX)
861   #if defined(__cplusplus)
862     #define CYTHON_CCOMPLEX 1
863   #elif defined(_Complex_I)
864     #define CYTHON_CCOMPLEX 1
865   #else
866     #define CYTHON_CCOMPLEX 0
867   #endif
868 #endif
869 #if CYTHON_CCOMPLEX
870   #ifdef __cplusplus
871     #include <complex>
872   #else
873     #include <complex.h>
874   #endif
875 #endif
876 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
877   #undef _Complex_I
878   #define _Complex_I 1.0fj
879 #endif
880 
881 
882 static const char *__pyx_f[] = {
883   "openTSNE/_matrix_mul/matrix_mul_numpy.pyx",
884   "__init__.pxd",
885   "stringsource",
886   "type.pxd",
887 };
888 /* MemviewSliceStruct.proto */
889 struct __pyx_memoryview_obj;
890 typedef struct {
891   struct __pyx_memoryview_obj *memview;
892   char *data;
893   Py_ssize_t shape[8];
894   Py_ssize_t strides[8];
895   Py_ssize_t suboffsets[8];
896 } __Pyx_memviewslice;
897 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
898 
899 /* Atomics.proto */
900 #include <pythread.h>
901 #ifndef CYTHON_ATOMICS
902     #define CYTHON_ATOMICS 1
903 #endif
904 #define __pyx_atomic_int_type int
905 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
906                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
907                     !defined(__i386__)
908     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
909     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
910     #ifdef __PYX_DEBUG_ATOMICS
911         #warning "Using GNU atomics"
912     #endif
913 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
914     #include <Windows.h>
915     #undef __pyx_atomic_int_type
916     #define __pyx_atomic_int_type LONG
917     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
918     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
919     #ifdef __PYX_DEBUG_ATOMICS
920         #pragma message ("Using MSVC atomics")
921     #endif
922 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
923     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
924     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
925     #ifdef __PYX_DEBUG_ATOMICS
926         #warning "Using Intel atomics"
927     #endif
928 #else
929     #undef CYTHON_ATOMICS
930     #define CYTHON_ATOMICS 0
931     #ifdef __PYX_DEBUG_ATOMICS
932         #warning "Not using atomics"
933     #endif
934 #endif
935 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
936 #if CYTHON_ATOMICS
937     #define __pyx_add_acquisition_count(memview)\
938              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
939     #define __pyx_sub_acquisition_count(memview)\
940             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
941 #else
942     #define __pyx_add_acquisition_count(memview)\
943             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
944     #define __pyx_sub_acquisition_count(memview)\
945             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
946 #endif
947 
948 /* ForceInitThreads.proto */
949 #ifndef __PYX_FORCE_INIT_THREADS
950   #define __PYX_FORCE_INIT_THREADS 0
951 #endif
952 
953 /* NoFastGil.proto */
954 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
955 #define __Pyx_PyGILState_Release PyGILState_Release
956 #define __Pyx_FastGIL_Remember()
957 #define __Pyx_FastGIL_Forget()
958 #define __Pyx_FastGilFuncInit()
959 
960 /* BufferFormatStructs.proto */
961 #define IS_UNSIGNED(type) (((type) -1) > 0)
962 struct __Pyx_StructField_;
963 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
964 typedef struct {
965   const char* name;
966   struct __Pyx_StructField_* fields;
967   size_t size;
968   size_t arraysize[8];
969   int ndim;
970   char typegroup;
971   char is_unsigned;
972   int flags;
973 } __Pyx_TypeInfo;
974 typedef struct __Pyx_StructField_ {
975   __Pyx_TypeInfo* type;
976   const char* name;
977   size_t offset;
978 } __Pyx_StructField;
979 typedef struct {
980   __Pyx_StructField* field;
981   size_t parent_offset;
982 } __Pyx_BufFmt_StackElem;
983 typedef struct {
984   __Pyx_StructField root;
985   __Pyx_BufFmt_StackElem* head;
986   size_t fmt_offset;
987   size_t new_count, enc_count;
988   size_t struct_alignment;
989   int is_complex;
990   char enc_type;
991   char new_packmode;
992   char enc_packmode;
993   char is_valid_array;
994 } __Pyx_BufFmt_Context;
995 
996 
997 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
998  * # in Cython to enable them only on the right systems.
999  *
1000  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1001  * ctypedef npy_int16      int16_t
1002  * ctypedef npy_int32      int32_t
1003  */
1004 typedef npy_int8 __pyx_t_5numpy_int8_t;
1005 
1006 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
1007  *
1008  * ctypedef npy_int8       int8_t
1009  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1010  * ctypedef npy_int32      int32_t
1011  * ctypedef npy_int64      int64_t
1012  */
1013 typedef npy_int16 __pyx_t_5numpy_int16_t;
1014 
1015 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
1016  * ctypedef npy_int8       int8_t
1017  * ctypedef npy_int16      int16_t
1018  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1019  * ctypedef npy_int64      int64_t
1020  * #ctypedef npy_int96      int96_t
1021  */
1022 typedef npy_int32 __pyx_t_5numpy_int32_t;
1023 
1024 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
1025  * ctypedef npy_int16      int16_t
1026  * ctypedef npy_int32      int32_t
1027  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1028  * #ctypedef npy_int96      int96_t
1029  * #ctypedef npy_int128     int128_t
1030  */
1031 typedef npy_int64 __pyx_t_5numpy_int64_t;
1032 
1033 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
1034  * #ctypedef npy_int128     int128_t
1035  *
1036  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1037  * ctypedef npy_uint16     uint16_t
1038  * ctypedef npy_uint32     uint32_t
1039  */
1040 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1041 
1042 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
1043  *
1044  * ctypedef npy_uint8      uint8_t
1045  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1046  * ctypedef npy_uint32     uint32_t
1047  * ctypedef npy_uint64     uint64_t
1048  */
1049 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1050 
1051 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
1052  * ctypedef npy_uint8      uint8_t
1053  * ctypedef npy_uint16     uint16_t
1054  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1055  * ctypedef npy_uint64     uint64_t
1056  * #ctypedef npy_uint96     uint96_t
1057  */
1058 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1059 
1060 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1061  * ctypedef npy_uint16     uint16_t
1062  * ctypedef npy_uint32     uint32_t
1063  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1064  * #ctypedef npy_uint96     uint96_t
1065  * #ctypedef npy_uint128    uint128_t
1066  */
1067 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1068 
1069 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":789
1070  * #ctypedef npy_uint128    uint128_t
1071  *
1072  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1073  * ctypedef npy_float64    float64_t
1074  * #ctypedef npy_float80    float80_t
1075  */
1076 typedef npy_float32 __pyx_t_5numpy_float32_t;
1077 
1078 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1079  *
1080  * ctypedef npy_float32    float32_t
1081  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1082  * #ctypedef npy_float80    float80_t
1083  * #ctypedef npy_float128   float128_t
1084  */
1085 typedef npy_float64 __pyx_t_5numpy_float64_t;
1086 
1087 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
1088  * # The int types are mapped a bit surprising --
1089  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1090  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1091  * ctypedef npy_longlong   long_t
1092  * ctypedef npy_longlong   longlong_t
1093  */
1094 typedef npy_long __pyx_t_5numpy_int_t;
1095 
1096 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1097  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1098  * ctypedef npy_long       int_t
1099  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1100  * ctypedef npy_longlong   longlong_t
1101  *
1102  */
1103 typedef npy_longlong __pyx_t_5numpy_long_t;
1104 
1105 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1106  * ctypedef npy_long       int_t
1107  * ctypedef npy_longlong   long_t
1108  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1109  *
1110  * ctypedef npy_ulong      uint_t
1111  */
1112 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1113 
1114 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
1115  * ctypedef npy_longlong   longlong_t
1116  *
1117  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1118  * ctypedef npy_ulonglong  ulong_t
1119  * ctypedef npy_ulonglong  ulonglong_t
1120  */
1121 typedef npy_ulong __pyx_t_5numpy_uint_t;
1122 
1123 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1124  *
1125  * ctypedef npy_ulong      uint_t
1126  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1127  * ctypedef npy_ulonglong  ulonglong_t
1128  *
1129  */
1130 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1131 
1132 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1133  * ctypedef npy_ulong      uint_t
1134  * ctypedef npy_ulonglong  ulong_t
1135  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1136  *
1137  * ctypedef npy_intp       intp_t
1138  */
1139 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1140 
1141 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":807
1142  * ctypedef npy_ulonglong  ulonglong_t
1143  *
1144  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1145  * ctypedef npy_uintp      uintp_t
1146  *
1147  */
1148 typedef npy_intp __pyx_t_5numpy_intp_t;
1149 
1150 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1151  *
1152  * ctypedef npy_intp       intp_t
1153  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1154  *
1155  * ctypedef npy_double     float_t
1156  */
1157 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1158 
1159 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
1160  * ctypedef npy_uintp      uintp_t
1161  *
1162  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1163  * ctypedef npy_double     double_t
1164  * ctypedef npy_longdouble longdouble_t
1165  */
1166 typedef npy_double __pyx_t_5numpy_float_t;
1167 
1168 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1169  *
1170  * ctypedef npy_double     float_t
1171  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1172  * ctypedef npy_longdouble longdouble_t
1173  *
1174  */
1175 typedef npy_double __pyx_t_5numpy_double_t;
1176 
1177 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1178  * ctypedef npy_double     float_t
1179  * ctypedef npy_double     double_t
1180  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_cfloat      cfloat_t
1183  */
1184 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1185 /* Declarations.proto */
1186 #if CYTHON_CCOMPLEX
1187   #ifdef __cplusplus
1188     typedef ::std::complex< double > __pyx_t_double_complex;
1189   #else
1190     typedef double _Complex __pyx_t_double_complex;
1191   #endif
1192 #else
1193     typedef struct { double real, imag; } __pyx_t_double_complex;
1194 #endif
1195 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1196 
1197 /* Declarations.proto */
1198 #if CYTHON_CCOMPLEX
1199   #ifdef __cplusplus
1200     typedef ::std::complex< float > __pyx_t_float_complex;
1201   #else
1202     typedef float _Complex __pyx_t_float_complex;
1203   #endif
1204 #else
1205     typedef struct { float real, imag; } __pyx_t_float_complex;
1206 #endif
1207 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1208 
1209 
1210 /*--- Type declarations ---*/
1211 struct __pyx_array_obj;
1212 struct __pyx_MemviewEnum_obj;
1213 struct __pyx_memoryview_obj;
1214 struct __pyx_memoryviewslice_obj;
1215 
1216 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
1217  * ctypedef npy_longdouble longdouble_t
1218  *
1219  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1220  * ctypedef npy_cdouble     cdouble_t
1221  * ctypedef npy_clongdouble clongdouble_t
1222  */
1223 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1224 
1225 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1226  *
1227  * ctypedef npy_cfloat      cfloat_t
1228  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1229  * ctypedef npy_clongdouble clongdouble_t
1230  *
1231  */
1232 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1233 
1234 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1235  * ctypedef npy_cfloat      cfloat_t
1236  * ctypedef npy_cdouble     cdouble_t
1237  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1238  *
1239  * ctypedef npy_cdouble     complex_t
1240  */
1241 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1242 
1243 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
1244  * ctypedef npy_clongdouble clongdouble_t
1245  *
1246  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1247  *
1248  * cdef inline object PyArray_MultiIterNew1(a):
1249  */
1250 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1251 
1252 /* "View.MemoryView":105
1253  *
1254  * @cname("__pyx_array")
1255  * cdef class array:             # <<<<<<<<<<<<<<
1256  *
1257  *     cdef:
1258  */
1259 struct __pyx_array_obj {
1260   PyObject_HEAD
1261   struct __pyx_vtabstruct_array *__pyx_vtab;
1262   char *data;
1263   Py_ssize_t len;
1264   char *format;
1265   int ndim;
1266   Py_ssize_t *_shape;
1267   Py_ssize_t *_strides;
1268   Py_ssize_t itemsize;
1269   PyObject *mode;
1270   PyObject *_format;
1271   void (*callback_free_data)(void *);
1272   int free_data;
1273   int dtype_is_object;
1274 };
1275 
1276 
1277 /* "View.MemoryView":279
1278  *
1279  * @cname('__pyx_MemviewEnum')
1280  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1281  *     cdef object name
1282  *     def __init__(self, name):
1283  */
1284 struct __pyx_MemviewEnum_obj {
1285   PyObject_HEAD
1286   PyObject *name;
1287 };
1288 
1289 
1290 /* "View.MemoryView":330
1291  *
1292  * @cname('__pyx_memoryview')
1293  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1294  *
1295  *     cdef object obj
1296  */
1297 struct __pyx_memoryview_obj {
1298   PyObject_HEAD
1299   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1300   PyObject *obj;
1301   PyObject *_size;
1302   PyObject *_array_interface;
1303   PyThread_type_lock lock;
1304   __pyx_atomic_int acquisition_count[2];
1305   __pyx_atomic_int *acquisition_count_aligned_p;
1306   Py_buffer view;
1307   int flags;
1308   int dtype_is_object;
1309   __Pyx_TypeInfo *typeinfo;
1310 };
1311 
1312 
1313 /* "View.MemoryView":965
1314  *
1315  * @cname('__pyx_memoryviewslice')
1316  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1317  *     "Internal class for passing memoryview slices to Python"
1318  *
1319  */
1320 struct __pyx_memoryviewslice_obj {
1321   struct __pyx_memoryview_obj __pyx_base;
1322   __Pyx_memviewslice from_slice;
1323   PyObject *from_object;
1324   PyObject *(*to_object_func)(char *);
1325   int (*to_dtype_func)(char *, PyObject *);
1326 };
1327 
1328 
1329 
1330 /* "View.MemoryView":105
1331  *
1332  * @cname("__pyx_array")
1333  * cdef class array:             # <<<<<<<<<<<<<<
1334  *
1335  *     cdef:
1336  */
1337 
1338 struct __pyx_vtabstruct_array {
1339   PyObject *(*get_memview)(struct __pyx_array_obj *);
1340 };
1341 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1342 
1343 
1344 /* "View.MemoryView":330
1345  *
1346  * @cname('__pyx_memoryview')
1347  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1348  *
1349  *     cdef object obj
1350  */
1351 
1352 struct __pyx_vtabstruct_memoryview {
1353   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1354   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1355   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1356   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1357   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1358   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1359   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1360 };
1361 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1362 
1363 
1364 /* "View.MemoryView":965
1365  *
1366  * @cname('__pyx_memoryviewslice')
1367  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1368  *     "Internal class for passing memoryview slices to Python"
1369  *
1370  */
1371 
1372 struct __pyx_vtabstruct__memoryviewslice {
1373   struct __pyx_vtabstruct_memoryview __pyx_base;
1374 };
1375 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1376 
1377 /* --- Runtime support code (head) --- */
1378 /* Refnanny.proto */
1379 #ifndef CYTHON_REFNANNY
1380   #define CYTHON_REFNANNY 0
1381 #endif
1382 #if CYTHON_REFNANNY
1383   typedef struct {
1384     void (*INCREF)(void*, PyObject*, int);
1385     void (*DECREF)(void*, PyObject*, int);
1386     void (*GOTREF)(void*, PyObject*, int);
1387     void (*GIVEREF)(void*, PyObject*, int);
1388     void* (*SetupContext)(const char*, int, const char*);
1389     void (*FinishContext)(void**);
1390   } __Pyx_RefNannyAPIStruct;
1391   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1392   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1393   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1394 #ifdef WITH_THREAD
1395   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1396           if (acquire_gil) {\
1397               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1398               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1399               PyGILState_Release(__pyx_gilstate_save);\
1400           } else {\
1401               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1402           }
1403 #else
1404   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1405           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1406 #endif
1407   #define __Pyx_RefNannyFinishContext()\
1408           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1409   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1410   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1411   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1412   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1413   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1414   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1415   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1416   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1417 #else
1418   #define __Pyx_RefNannyDeclarations
1419   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1420   #define __Pyx_RefNannyFinishContext()
1421   #define __Pyx_INCREF(r) Py_INCREF(r)
1422   #define __Pyx_DECREF(r) Py_DECREF(r)
1423   #define __Pyx_GOTREF(r)
1424   #define __Pyx_GIVEREF(r)
1425   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1426   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1427   #define __Pyx_XGOTREF(r)
1428   #define __Pyx_XGIVEREF(r)
1429 #endif
1430 #define __Pyx_XDECREF_SET(r, v) do {\
1431         PyObject *tmp = (PyObject *) r;\
1432         r = v; __Pyx_XDECREF(tmp);\
1433     } while (0)
1434 #define __Pyx_DECREF_SET(r, v) do {\
1435         PyObject *tmp = (PyObject *) r;\
1436         r = v; __Pyx_DECREF(tmp);\
1437     } while (0)
1438 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1439 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1440 
1441 /* PyObjectGetAttrStr.proto */
1442 #if CYTHON_USE_TYPE_SLOTS
1443 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1444 #else
1445 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1446 #endif
1447 
1448 /* GetBuiltinName.proto */
1449 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1450 
1451 /* PyDictVersioning.proto */
1452 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1453 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1454 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1455 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1456     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1457     (cache_var) = (value);
1458 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1459     static PY_UINT64_T __pyx_dict_version = 0;\
1460     static PyObject *__pyx_dict_cached_value = NULL;\
1461     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1462         (VAR) = __pyx_dict_cached_value;\
1463     } else {\
1464         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1465         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1466     }\
1467 }
1468 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1469 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1470 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1471 #else
1472 #define __PYX_GET_DICT_VERSION(dict)  (0)
1473 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1474 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1475 #endif
1476 
1477 /* GetModuleGlobalName.proto */
1478 #if CYTHON_USE_DICT_VERSIONS
1479 #define __Pyx_GetModuleGlobalName(var, name)  {\
1480     static PY_UINT64_T __pyx_dict_version = 0;\
1481     static PyObject *__pyx_dict_cached_value = NULL;\
1482     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1483         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1484         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1485 }
1486 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1487     PY_UINT64_T __pyx_dict_version;\
1488     PyObject *__pyx_dict_cached_value;\
1489     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1490 }
1491 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1492 #else
1493 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1494 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1495 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1496 #endif
1497 
1498 /* PyObjectCall.proto */
1499 #if CYTHON_COMPILING_IN_CPYTHON
1500 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1501 #else
1502 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1503 #endif
1504 
1505 /* PyCFunctionFastCall.proto */
1506 #if CYTHON_FAST_PYCCALL
1507 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1508 #else
1509 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1510 #endif
1511 
1512 /* PyFunctionFastCall.proto */
1513 #if CYTHON_FAST_PYCALL
1514 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1515     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1516 #if 1 || PY_VERSION_HEX < 0x030600B1
1517 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1518 #else
1519 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1520 #endif
1521 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1522     (sizeof(char [1 - 2*!(cond)]) - 1)
1523 #ifndef Py_MEMBER_SIZE
1524 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1525 #endif
1526   static size_t __pyx_pyframe_localsplus_offset = 0;
1527   #include "frameobject.h"
1528   #define __Pxy_PyFrame_Initialize_Offsets()\
1529     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1530      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1531   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1532     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1533 #endif
1534 
1535 /* PyObjectCall2Args.proto */
1536 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1537 
1538 /* PyObjectCallMethO.proto */
1539 #if CYTHON_COMPILING_IN_CPYTHON
1540 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1541 #endif
1542 
1543 /* PyObjectCallOneArg.proto */
1544 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1545 
1546 /* MemviewSliceInit.proto */
1547 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1548 #define __Pyx_MEMVIEW_DIRECT   1
1549 #define __Pyx_MEMVIEW_PTR      2
1550 #define __Pyx_MEMVIEW_FULL     4
1551 #define __Pyx_MEMVIEW_CONTIG   8
1552 #define __Pyx_MEMVIEW_STRIDED  16
1553 #define __Pyx_MEMVIEW_FOLLOW   32
1554 #define __Pyx_IS_C_CONTIG 1
1555 #define __Pyx_IS_F_CONTIG 2
1556 static int __Pyx_init_memviewslice(
1557                 struct __pyx_memoryview_obj *memview,
1558                 int ndim,
1559                 __Pyx_memviewslice *memviewslice,
1560                 int memview_is_new_reference);
1561 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1562     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1563 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1564     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1565 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1566 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1567 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1568 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1569 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1570 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1571 
1572 /* PyThreadStateGet.proto */
1573 #if CYTHON_FAST_THREAD_STATE
1574 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1575 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1576 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1577 #else
1578 #define __Pyx_PyThreadState_declare
1579 #define __Pyx_PyThreadState_assign
1580 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1581 #endif
1582 
1583 /* PyErrFetchRestore.proto */
1584 #if CYTHON_FAST_THREAD_STATE
1585 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1586 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1587 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1588 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1589 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1590 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1591 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1592 #if CYTHON_COMPILING_IN_CPYTHON
1593 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1594 #else
1595 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1596 #endif
1597 #else
1598 #define __Pyx_PyErr_Clear() PyErr_Clear()
1599 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1600 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1601 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1602 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1603 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1604 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1605 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1606 #endif
1607 
1608 /* WriteUnraisableException.proto */
1609 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1610                                   int lineno, const char *filename,
1611                                   int full_traceback, int nogil);
1612 
1613 /* RaiseException.proto */
1614 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1615 
1616 /* DictGetItem.proto */
1617 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1618 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1619 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1620     (likely(PyDict_CheckExact(obj)) ?\
1621      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1622 #else
1623 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1624 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1625 #endif
1626 
1627 /* RaiseTooManyValuesToUnpack.proto */
1628 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1629 
1630 /* RaiseNeedMoreValuesToUnpack.proto */
1631 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1632 
1633 /* RaiseNoneIterError.proto */
1634 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1635 
1636 /* ExtTypeTest.proto */
1637 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1638 
1639 /* GetTopmostException.proto */
1640 #if CYTHON_USE_EXC_INFO_STACK
1641 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1642 #endif
1643 
1644 /* SaveResetException.proto */
1645 #if CYTHON_FAST_THREAD_STATE
1646 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1647 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1648 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1649 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1650 #else
1651 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1652 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1653 #endif
1654 
1655 /* PyErrExceptionMatches.proto */
1656 #if CYTHON_FAST_THREAD_STATE
1657 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1658 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1659 #else
1660 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1661 #endif
1662 
1663 /* GetException.proto */
1664 #if CYTHON_FAST_THREAD_STATE
1665 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1666 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1667 #else
1668 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1669 #endif
1670 
1671 /* RaiseArgTupleInvalid.proto */
1672 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1673     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1674 
1675 /* RaiseDoubleKeywords.proto */
1676 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1677 
1678 /* ParseKeywords.proto */
1679 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1680     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1681     const char* function_name);
1682 
1683 /* ArgTypeTest.proto */
1684 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1685     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1686         __Pyx__ArgTypeTest(obj, type, name, exact))
1687 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1688 
1689 /* IncludeStringH.proto */
1690 #include <string.h>
1691 
1692 /* BytesEquals.proto */
1693 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1694 
1695 /* UnicodeEquals.proto */
1696 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1697 
1698 /* StrEquals.proto */
1699 #if PY_MAJOR_VERSION >= 3
1700 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1701 #else
1702 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1703 #endif
1704 
1705 /* UnaryNegOverflows.proto */
1706 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1707         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1708 
1709 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1710 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1711 /* GetAttr.proto */
1712 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1713 
1714 /* GetItemInt.proto */
1715 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1716     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1717     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1718     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1719                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1720 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1721     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1722     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1723     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1724 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1725                                                               int wraparound, int boundscheck);
1726 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1727     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1728     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1729     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1730 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1731                                                               int wraparound, int boundscheck);
1732 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1733 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1734                                                      int is_list, int wraparound, int boundscheck);
1735 
1736 /* ObjectGetItem.proto */
1737 #if CYTHON_USE_TYPE_SLOTS
1738 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1739 #else
1740 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1741 #endif
1742 
1743 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1744 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1745     int byteorder = 0;
1746     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1747 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1748 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1749     int byteorder = -1;
1750     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1751 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1752 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1753     int byteorder = 1;
1754     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1755 }
1756 
1757 /* decode_c_string.proto */
1758 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1759          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1760          const char* encoding, const char* errors,
1761          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1762 
1763 /* GetAttr3.proto */
1764 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1765 
1766 /* SwapException.proto */
1767 #if CYTHON_FAST_THREAD_STATE
1768 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1769 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1770 #else
1771 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1772 #endif
1773 
1774 /* Import.proto */
1775 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1776 
1777 /* FastTypeChecks.proto */
1778 #if CYTHON_COMPILING_IN_CPYTHON
1779 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1780 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1781 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1782 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1783 #else
1784 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1785 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1786 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1787 #endif
1788 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1789 
1790 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1791 /* ListCompAppend.proto */
1792 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)1793 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1794     PyListObject* L = (PyListObject*) list;
1795     Py_ssize_t len = Py_SIZE(list);
1796     if (likely(L->allocated > len)) {
1797         Py_INCREF(x);
1798         PyList_SET_ITEM(list, len, x);
1799         __Pyx_SET_SIZE(list, len + 1);
1800         return 0;
1801     }
1802     return PyList_Append(list, x);
1803 }
1804 #else
1805 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1806 #endif
1807 
1808 /* PyIntBinop.proto */
1809 #if !CYTHON_COMPILING_IN_PYPY
1810 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1811 #else
1812 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1813     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1814 #endif
1815 
1816 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)1817 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1818 #if CYTHON_COMPILING_IN_CPYTHON
1819     PyObject* none = _PyList_Extend((PyListObject*)L, v);
1820     if (unlikely(!none))
1821         return -1;
1822     Py_DECREF(none);
1823     return 0;
1824 #else
1825     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1826 #endif
1827 }
1828 
1829 /* ListAppend.proto */
1830 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1831 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1832     PyListObject* L = (PyListObject*) list;
1833     Py_ssize_t len = Py_SIZE(list);
1834     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1835         Py_INCREF(x);
1836         PyList_SET_ITEM(list, len, x);
1837         __Pyx_SET_SIZE(list, len + 1);
1838         return 0;
1839     }
1840     return PyList_Append(list, x);
1841 }
1842 #else
1843 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1844 #endif
1845 
1846 /* None.proto */
1847 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1848 
1849 /* ImportFrom.proto */
1850 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1851 
1852 /* HasAttr.proto */
1853 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1854 
1855 /* PyObject_GenericGetAttrNoDict.proto */
1856 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1857 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1858 #else
1859 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1860 #endif
1861 
1862 /* PyObject_GenericGetAttr.proto */
1863 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1864 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1865 #else
1866 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1867 #endif
1868 
1869 /* SetVTable.proto */
1870 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1871 
1872 /* PyObjectGetAttrStrNoError.proto */
1873 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1874 
1875 /* SetupReduce.proto */
1876 static int __Pyx_setup_reduce(PyObject* type_obj);
1877 
1878 /* TypeImport.proto */
1879 #ifndef __PYX_HAVE_RT_ImportType_proto
1880 #define __PYX_HAVE_RT_ImportType_proto
1881 enum __Pyx_ImportType_CheckSize {
1882    __Pyx_ImportType_CheckSize_Error = 0,
1883    __Pyx_ImportType_CheckSize_Warn = 1,
1884    __Pyx_ImportType_CheckSize_Ignore = 2
1885 };
1886 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1887 #endif
1888 
1889 /* CLineInTraceback.proto */
1890 #ifdef CYTHON_CLINE_IN_TRACEBACK
1891 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1892 #else
1893 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1894 #endif
1895 
1896 /* CodeObjectCache.proto */
1897 typedef struct {
1898     PyCodeObject* code_object;
1899     int code_line;
1900 } __Pyx_CodeObjectCacheEntry;
1901 struct __Pyx_CodeObjectCache {
1902     int count;
1903     int max_count;
1904     __Pyx_CodeObjectCacheEntry* entries;
1905 };
1906 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1907 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1908 static PyCodeObject *__pyx_find_code_object(int code_line);
1909 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1910 
1911 /* AddTraceback.proto */
1912 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1913                                int py_line, const char *filename);
1914 
1915 #if PY_MAJOR_VERSION < 3
1916     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1917     static void __Pyx_ReleaseBuffer(Py_buffer *view);
1918 #else
1919     #define __Pyx_GetBuffer PyObject_GetBuffer
1920     #define __Pyx_ReleaseBuffer PyBuffer_Release
1921 #endif
1922 
1923 
1924 /* BufferStructDeclare.proto */
1925 typedef struct {
1926   Py_ssize_t shape, strides, suboffsets;
1927 } __Pyx_Buf_DimInfo;
1928 typedef struct {
1929   size_t refcount;
1930   Py_buffer pybuffer;
1931 } __Pyx_Buffer;
1932 typedef struct {
1933   __Pyx_Buffer *rcbuffer;
1934   char *data;
1935   __Pyx_Buf_DimInfo diminfo[8];
1936 } __Pyx_LocalBuf_ND;
1937 
1938 /* MemviewSliceIsContig.proto */
1939 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
1940 
1941 /* OverlappingSlices.proto */
1942 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1943                                 __Pyx_memviewslice *slice2,
1944                                 int ndim, size_t itemsize);
1945 
1946 /* Capsule.proto */
1947 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
1948 
1949 /* RealImag.proto */
1950 #if CYTHON_CCOMPLEX
1951   #ifdef __cplusplus
1952     #define __Pyx_CREAL(z) ((z).real())
1953     #define __Pyx_CIMAG(z) ((z).imag())
1954   #else
1955     #define __Pyx_CREAL(z) (__real__(z))
1956     #define __Pyx_CIMAG(z) (__imag__(z))
1957   #endif
1958 #else
1959     #define __Pyx_CREAL(z) ((z).real)
1960     #define __Pyx_CIMAG(z) ((z).imag)
1961 #endif
1962 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1963         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1964     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1965     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1966 #else
1967     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1968     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1969 #endif
1970 
1971 /* Arithmetic.proto */
1972 #if CYTHON_CCOMPLEX
1973     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
1974     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
1975     #define __Pyx_c_diff_double(a, b) ((a)-(b))
1976     #define __Pyx_c_prod_double(a, b) ((a)*(b))
1977     #define __Pyx_c_quot_double(a, b) ((a)/(b))
1978     #define __Pyx_c_neg_double(a)     (-(a))
1979   #ifdef __cplusplus
1980     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1981     #define __Pyx_c_conj_double(z)    (::std::conj(z))
1982     #if 1
1983         #define __Pyx_c_abs_double(z)     (::std::abs(z))
1984         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
1985     #endif
1986   #else
1987     #define __Pyx_c_is_zero_double(z) ((z)==0)
1988     #define __Pyx_c_conj_double(z)    (conj(z))
1989     #if 1
1990         #define __Pyx_c_abs_double(z)     (cabs(z))
1991         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
1992     #endif
1993  #endif
1994 #else
1995     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1996     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1997     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1998     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1999     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2000     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2001     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2002     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2003     #if 1
2004         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2005         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2006     #endif
2007 #endif
2008 
2009 /* IsLittleEndian.proto */
2010 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2011 
2012 /* BufferFormatCheck.proto */
2013 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2014 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2015                               __Pyx_BufFmt_StackElem* stack,
2016                               __Pyx_TypeInfo* type);
2017 
2018 /* TypeInfoCompare.proto */
2019 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2020 
2021 /* MemviewSliceValidateAndInit.proto */
2022 static int __Pyx_ValidateAndInit_memviewslice(
2023                 int *axes_specs,
2024                 int c_or_f_flag,
2025                 int buf_flags,
2026                 int ndim,
2027                 __Pyx_TypeInfo *dtype,
2028                 __Pyx_BufFmt_StackElem stack[],
2029                 __Pyx_memviewslice *memviewslice,
2030                 PyObject *original_obj);
2031 
2032 /* ObjectToMemviewSlice.proto */
2033 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *, int writable_flag);
2034 
2035 /* MemviewDtypeToObject.proto */
2036 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2037 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2038 
2039 /* ToPy.proto */
2040 #define __pyx_PyComplex_FromComplex(z)\
2041         PyComplex_FromDoubles((double)__Pyx_CREAL(z),\
2042                               (double)__Pyx_CIMAG(z))
2043 
2044 /* FromPy.proto */
2045 static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);
2046 
2047 /* MemviewDtypeToObject.proto */
2048 static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const char *itemp);
2049 static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj);
2050 
2051 /* ObjectToMemviewSlice.proto */
2052 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(PyObject *, int writable_flag);
2053 
2054 /* ObjectToMemviewSlice.proto */
2055 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2056 
2057 /* Arithmetic.proto */
2058 #if CYTHON_CCOMPLEX
2059     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2060     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2061     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2062     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2063     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2064     #define __Pyx_c_neg_float(a)     (-(a))
2065   #ifdef __cplusplus
2066     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2067     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2068     #if 1
2069         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2070         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2071     #endif
2072   #else
2073     #define __Pyx_c_is_zero_float(z) ((z)==0)
2074     #define __Pyx_c_conj_float(z)    (conjf(z))
2075     #if 1
2076         #define __Pyx_c_abs_float(z)     (cabsf(z))
2077         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2078     #endif
2079  #endif
2080 #else
2081     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2082     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2083     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2084     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2085     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2086     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2087     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2088     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2089     #if 1
2090         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2091         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2092     #endif
2093 #endif
2094 
2095 /* GCCDiagnostics.proto */
2096 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2097 #define __Pyx_HAS_GCC_DIAGNOSTIC
2098 #endif
2099 
2100 /* MemviewSliceCopyTemplate.proto */
2101 static __Pyx_memviewslice
2102 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2103                                  const char *mode, int ndim,
2104                                  size_t sizeof_dtype, int contig_flag,
2105                                  int dtype_is_object);
2106 
2107 /* CIntToPy.proto */
2108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2109 
2110 /* CIntFromPy.proto */
2111 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2112 
2113 /* CIntToPy.proto */
2114 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2115 
2116 /* CIntFromPy.proto */
2117 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2118 
2119 /* CIntToPy.proto */
2120 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2121 
2122 /* CIntFromPy.proto */
2123 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2124 
2125 /* CheckBinaryVersion.proto */
2126 static int __Pyx_check_binary_version(void);
2127 
2128 /* FunctionExport.proto */
2129 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2130 
2131 /* InitStrings.proto */
2132 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2133 
2134 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2135 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2136 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2137 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2138 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2139 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2140 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2141 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2142 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2143 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2144 
2145 /* Module declarations from 'openTSNE._matrix_mul' */
2146 
2147 /* Module declarations from 'openTSNE' */
2148 
2149 /* Module declarations from 'cpython.buffer' */
2150 
2151 /* Module declarations from 'libc.string' */
2152 
2153 /* Module declarations from 'libc.stdio' */
2154 
2155 /* Module declarations from '__builtin__' */
2156 
2157 /* Module declarations from 'cpython.type' */
2158 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2159 
2160 /* Module declarations from 'cpython' */
2161 
2162 /* Module declarations from 'cpython.object' */
2163 
2164 /* Module declarations from 'cpython.ref' */
2165 
2166 /* Module declarations from 'cpython.mem' */
2167 
2168 /* Module declarations from 'numpy' */
2169 
2170 /* Module declarations from 'numpy' */
2171 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2172 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2173 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2174 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2175 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2176 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2177 
2178 /* Module declarations from 'openTSNE._matrix_mul.matrix_mul' */
2179 static PyTypeObject *__pyx_array_type = 0;
2180 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2181 static PyTypeObject *__pyx_memoryview_type = 0;
2182 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2183 static PyObject *generic = 0;
2184 static PyObject *strided = 0;
2185 static PyObject *indirect = 0;
2186 static PyObject *contiguous = 0;
2187 static PyObject *indirect_contiguous = 0;
2188 static int __pyx_memoryview_thread_locks_used;
2189 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2190 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2191 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2192 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2193 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2194 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2195 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2196 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2197 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2198 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2199 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2200 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2201 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2202 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2203 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2204 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2205 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2206 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2207 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2208 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2209 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2210 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2211 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2212 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2213 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2214 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2215 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2216 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2217 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2218 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2219 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2220 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2221 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2222 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2223 static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
2224 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2225 #define __Pyx_MODULE_NAME "openTSNE._matrix_mul.matrix_mul"
2226 extern int __pyx_module_is_main_openTSNE___matrix_mul__matrix_mul;
2227 int __pyx_module_is_main_openTSNE___matrix_mul__matrix_mul = 0;
2228 
2229 /* Implementation of 'openTSNE._matrix_mul.matrix_mul' */
2230 static PyObject *__pyx_builtin_range;
2231 static PyObject *__pyx_builtin_ValueError;
2232 static PyObject *__pyx_builtin_RuntimeError;
2233 static PyObject *__pyx_builtin_ImportError;
2234 static PyObject *__pyx_builtin_MemoryError;
2235 static PyObject *__pyx_builtin_enumerate;
2236 static PyObject *__pyx_builtin_TypeError;
2237 static PyObject *__pyx_builtin_Ellipsis;
2238 static PyObject *__pyx_builtin_id;
2239 static PyObject *__pyx_builtin_IndexError;
2240 static const char __pyx_k_O[] = "O";
2241 static const char __pyx_k_c[] = "c";
2242 static const char __pyx_k_id[] = "id";
2243 static const char __pyx_k_np[] = "np";
2244 static const char __pyx_k_fft[] = "fft";
2245 static const char __pyx_k_new[] = "__new__";
2246 static const char __pyx_k_obj[] = "obj";
2247 static const char __pyx_k_base[] = "base";
2248 static const char __pyx_k_dict[] = "__dict__";
2249 static const char __pyx_k_ifft[] = "ifft";
2250 static const char __pyx_k_main[] = "__main__";
2251 static const char __pyx_k_mode[] = "mode";
2252 static const char __pyx_k_name[] = "name";
2253 static const char __pyx_k_ndim[] = "ndim";
2254 static const char __pyx_k_pack[] = "pack";
2255 static const char __pyx_k_real[] = "real";
2256 static const char __pyx_k_size[] = "size";
2257 static const char __pyx_k_step[] = "step";
2258 static const char __pyx_k_stop[] = "stop";
2259 static const char __pyx_k_test[] = "__test__";
2260 static const char __pyx_k_ASCII[] = "ASCII";
2261 static const char __pyx_k_class[] = "__class__";
2262 static const char __pyx_k_dtype[] = "dtype";
2263 static const char __pyx_k_empty[] = "empty";
2264 static const char __pyx_k_error[] = "error";
2265 static const char __pyx_k_flags[] = "flags";
2266 static const char __pyx_k_numpy[] = "numpy";
2267 static const char __pyx_k_range[] = "range";
2268 static const char __pyx_k_rfft2[] = "rfft2";
2269 static const char __pyx_k_shape[] = "shape";
2270 static const char __pyx_k_start[] = "start";
2271 static const char __pyx_k_zeros[] = "zeros";
2272 static const char __pyx_k_encode[] = "encode";
2273 static const char __pyx_k_format[] = "format";
2274 static const char __pyx_k_import[] = "__import__";
2275 static const char __pyx_k_irfft2[] = "irfft2";
2276 static const char __pyx_k_name_2[] = "__name__";
2277 static const char __pyx_k_pickle[] = "pickle";
2278 static const char __pyx_k_reduce[] = "__reduce__";
2279 static const char __pyx_k_struct[] = "struct";
2280 static const char __pyx_k_unpack[] = "unpack";
2281 static const char __pyx_k_update[] = "update";
2282 static const char __pyx_k_fortran[] = "fortran";
2283 static const char __pyx_k_memview[] = "memview";
2284 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2285 static const char __pyx_k_getstate[] = "__getstate__";
2286 static const char __pyx_k_itemsize[] = "itemsize";
2287 static const char __pyx_k_multiply[] = "multiply";
2288 static const char __pyx_k_pyx_type[] = "__pyx_type";
2289 static const char __pyx_k_setstate[] = "__setstate__";
2290 static const char __pyx_k_TypeError[] = "TypeError";
2291 static const char __pyx_k_enumerate[] = "enumerate";
2292 static const char __pyx_k_pyx_state[] = "__pyx_state";
2293 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2294 static const char __pyx_k_IndexError[] = "IndexError";
2295 static const char __pyx_k_ValueError[] = "ValueError";
2296 static const char __pyx_k_pyx_result[] = "__pyx_result";
2297 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2298 static const char __pyx_k_ImportError[] = "ImportError";
2299 static const char __pyx_k_MemoryError[] = "MemoryError";
2300 static const char __pyx_k_PickleError[] = "PickleError";
2301 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2302 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2303 static const char __pyx_k_stringsource[] = "stringsource";
2304 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2305 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2306 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2307 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2308 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2309 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2310 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2311 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2312 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2313 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2314 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2315 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2316 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2317 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2318 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2319 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2320 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2321 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2322 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2323 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2324 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2325 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2326 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2327 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2328 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2329 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2330 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2331 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2332 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2333 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2334 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2335 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2336 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2337 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2338 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2339 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2340 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2341 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2342 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2343 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2344 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2345 static PyObject *__pyx_n_s_ASCII;
2346 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2347 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2348 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2349 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2350 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2351 static PyObject *__pyx_n_s_Ellipsis;
2352 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2353 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2354 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2355 static PyObject *__pyx_n_s_ImportError;
2356 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2357 static PyObject *__pyx_n_s_IndexError;
2358 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2359 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2360 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2361 static PyObject *__pyx_n_s_MemoryError;
2362 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2363 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2364 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2365 static PyObject *__pyx_n_b_O;
2366 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2367 static PyObject *__pyx_n_s_PickleError;
2368 static PyObject *__pyx_n_s_RuntimeError;
2369 static PyObject *__pyx_n_s_TypeError;
2370 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2371 static PyObject *__pyx_n_s_ValueError;
2372 static PyObject *__pyx_n_s_View_MemoryView;
2373 static PyObject *__pyx_n_s_allocate_buffer;
2374 static PyObject *__pyx_n_s_base;
2375 static PyObject *__pyx_n_s_c;
2376 static PyObject *__pyx_n_u_c;
2377 static PyObject *__pyx_n_s_class;
2378 static PyObject *__pyx_n_s_cline_in_traceback;
2379 static PyObject *__pyx_kp_s_contiguous_and_direct;
2380 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2381 static PyObject *__pyx_n_s_dict;
2382 static PyObject *__pyx_n_s_dtype;
2383 static PyObject *__pyx_n_s_dtype_is_object;
2384 static PyObject *__pyx_n_s_empty;
2385 static PyObject *__pyx_n_s_encode;
2386 static PyObject *__pyx_n_s_enumerate;
2387 static PyObject *__pyx_n_s_error;
2388 static PyObject *__pyx_n_s_fft;
2389 static PyObject *__pyx_n_s_flags;
2390 static PyObject *__pyx_n_s_format;
2391 static PyObject *__pyx_n_s_fortran;
2392 static PyObject *__pyx_n_u_fortran;
2393 static PyObject *__pyx_n_s_getstate;
2394 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2395 static PyObject *__pyx_n_s_id;
2396 static PyObject *__pyx_n_s_ifft;
2397 static PyObject *__pyx_n_s_import;
2398 static PyObject *__pyx_n_s_irfft2;
2399 static PyObject *__pyx_n_s_itemsize;
2400 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2401 static PyObject *__pyx_n_s_main;
2402 static PyObject *__pyx_n_s_memview;
2403 static PyObject *__pyx_n_s_mode;
2404 static PyObject *__pyx_n_s_multiply;
2405 static PyObject *__pyx_n_s_name;
2406 static PyObject *__pyx_n_s_name_2;
2407 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2408 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2409 static PyObject *__pyx_n_s_ndim;
2410 static PyObject *__pyx_n_s_new;
2411 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2412 static PyObject *__pyx_n_s_np;
2413 static PyObject *__pyx_n_s_numpy;
2414 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
2415 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
2416 static PyObject *__pyx_n_s_obj;
2417 static PyObject *__pyx_n_s_pack;
2418 static PyObject *__pyx_n_s_pickle;
2419 static PyObject *__pyx_n_s_pyx_PickleError;
2420 static PyObject *__pyx_n_s_pyx_checksum;
2421 static PyObject *__pyx_n_s_pyx_getbuffer;
2422 static PyObject *__pyx_n_s_pyx_result;
2423 static PyObject *__pyx_n_s_pyx_state;
2424 static PyObject *__pyx_n_s_pyx_type;
2425 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2426 static PyObject *__pyx_n_s_pyx_vtable;
2427 static PyObject *__pyx_n_s_range;
2428 static PyObject *__pyx_n_s_real;
2429 static PyObject *__pyx_n_s_reduce;
2430 static PyObject *__pyx_n_s_reduce_cython;
2431 static PyObject *__pyx_n_s_reduce_ex;
2432 static PyObject *__pyx_n_s_rfft2;
2433 static PyObject *__pyx_n_s_setstate;
2434 static PyObject *__pyx_n_s_setstate_cython;
2435 static PyObject *__pyx_n_s_shape;
2436 static PyObject *__pyx_n_s_size;
2437 static PyObject *__pyx_n_s_start;
2438 static PyObject *__pyx_n_s_step;
2439 static PyObject *__pyx_n_s_stop;
2440 static PyObject *__pyx_kp_s_strided_and_direct;
2441 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2442 static PyObject *__pyx_kp_s_strided_and_indirect;
2443 static PyObject *__pyx_kp_s_stringsource;
2444 static PyObject *__pyx_n_s_struct;
2445 static PyObject *__pyx_n_s_test;
2446 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2447 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2448 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2449 static PyObject *__pyx_n_s_unpack;
2450 static PyObject *__pyx_n_s_update;
2451 static PyObject *__pyx_n_s_zeros;
2452 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2453 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2454 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2455 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2456 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2457 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2458 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2459 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2460 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2461 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2462 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2463 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2464 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2465 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2466 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2467 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2468 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2469 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2470 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2471 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2472 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2473 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2474 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2475 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2476 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2477 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2478 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2479 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2480 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2481 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2482 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2483 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2484 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2485 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2486 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2487 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2488 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2489 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2490 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2491 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2492 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2493 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2494 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2495 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2496 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2497 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2498 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2499 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2500 static PyObject *__pyx_int_0;
2501 static PyObject *__pyx_int_1;
2502 static PyObject *__pyx_int_184977713;
2503 static PyObject *__pyx_int_neg_1;
2504 static PyObject *__pyx_tuple_;
2505 static PyObject *__pyx_tuple__2;
2506 static PyObject *__pyx_tuple__3;
2507 static PyObject *__pyx_tuple__4;
2508 static PyObject *__pyx_tuple__5;
2509 static PyObject *__pyx_tuple__6;
2510 static PyObject *__pyx_tuple__7;
2511 static PyObject *__pyx_tuple__8;
2512 static PyObject *__pyx_tuple__9;
2513 static PyObject *__pyx_slice__22;
2514 static PyObject *__pyx_tuple__10;
2515 static PyObject *__pyx_tuple__11;
2516 static PyObject *__pyx_tuple__12;
2517 static PyObject *__pyx_tuple__13;
2518 static PyObject *__pyx_tuple__14;
2519 static PyObject *__pyx_tuple__15;
2520 static PyObject *__pyx_tuple__16;
2521 static PyObject *__pyx_tuple__17;
2522 static PyObject *__pyx_tuple__18;
2523 static PyObject *__pyx_tuple__19;
2524 static PyObject *__pyx_tuple__20;
2525 static PyObject *__pyx_tuple__21;
2526 static PyObject *__pyx_tuple__23;
2527 static PyObject *__pyx_tuple__24;
2528 static PyObject *__pyx_tuple__25;
2529 static PyObject *__pyx_tuple__26;
2530 static PyObject *__pyx_tuple__27;
2531 static PyObject *__pyx_tuple__28;
2532 static PyObject *__pyx_tuple__29;
2533 static PyObject *__pyx_tuple__30;
2534 static PyObject *__pyx_tuple__31;
2535 static PyObject *__pyx_codeobj__32;
2536 /* Late includes */
2537 
2538 /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":12
2539  *
2540  *
2541  * cdef void matrix_multiply_fft_1d(             # <<<<<<<<<<<<<<
2542  *     double[::1] kernel_tilde,
2543  *     double[:, ::1] w_coefficients,
2544  */
2545 
__pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_1d(__Pyx_memviewslice __pyx_v_kernel_tilde,__Pyx_memviewslice __pyx_v_w_coefficients,__Pyx_memviewslice __pyx_v_out)2546 static void __pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_1d(__Pyx_memviewslice __pyx_v_kernel_tilde, __Pyx_memviewslice __pyx_v_w_coefficients, __Pyx_memviewslice __pyx_v_out) {
2547   Py_ssize_t __pyx_v_n_interpolation_points_1d;
2548   Py_ssize_t __pyx_v_n_terms;
2549   Py_ssize_t __pyx_v_n_fft_coeffs;
2550   __Pyx_memviewslice __pyx_v_fft_kernel_tilde = { 0, 0, { 0 }, { 0 }, { 0 } };
2551   __Pyx_memviewslice __pyx_v_fft_w_coeffs = { 0, 0, { 0 }, { 0 }, { 0 } };
2552   __Pyx_memviewslice __pyx_v_fft_in_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
2553   __Pyx_memviewslice __pyx_v_fft_out_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
2554   Py_ssize_t __pyx_v_d;
2555   Py_ssize_t __pyx_v_i;
2556   __Pyx_RefNannyDeclarations
2557   PyObject *__pyx_t_1 = NULL;
2558   PyObject *__pyx_t_2 = NULL;
2559   PyObject *__pyx_t_3 = NULL;
2560   PyObject *__pyx_t_4 = NULL;
2561   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
2562   Py_ssize_t __pyx_t_6;
2563   Py_ssize_t __pyx_t_7;
2564   Py_ssize_t __pyx_t_8;
2565   Py_ssize_t __pyx_t_9;
2566   Py_ssize_t __pyx_t_10;
2567   Py_ssize_t __pyx_t_11;
2568   Py_ssize_t __pyx_t_12;
2569   Py_ssize_t __pyx_t_13;
2570   Py_ssize_t __pyx_t_14;
2571   PyObject *__pyx_t_15 = NULL;
2572   int __pyx_t_16;
2573   PyObject *__pyx_t_17 = NULL;
2574   double __pyx_t_18;
2575   int __pyx_lineno = 0;
2576   const char *__pyx_filename = NULL;
2577   int __pyx_clineno = 0;
2578   __Pyx_RefNannySetupContext("matrix_multiply_fft_1d", 0);
2579 
2580   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":36
2581  *     """
2582  *     cdef:
2583  *         Py_ssize_t n_interpolation_points_1d = w_coefficients.shape[0]             # <<<<<<<<<<<<<<
2584  *         Py_ssize_t n_terms = w_coefficients.shape[1]
2585  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
2586  */
2587   __pyx_v_n_interpolation_points_1d = (__pyx_v_w_coefficients.shape[0]);
2588 
2589   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":37
2590  *     cdef:
2591  *         Py_ssize_t n_interpolation_points_1d = w_coefficients.shape[0]
2592  *         Py_ssize_t n_terms = w_coefficients.shape[1]             # <<<<<<<<<<<<<<
2593  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
2594  *
2595  */
2596   __pyx_v_n_terms = (__pyx_v_w_coefficients.shape[1]);
2597 
2598   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":38
2599  *         Py_ssize_t n_interpolation_points_1d = w_coefficients.shape[0]
2600  *         Py_ssize_t n_terms = w_coefficients.shape[1]
2601  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]             # <<<<<<<<<<<<<<
2602  *
2603  *         complex[::1] fft_kernel_tilde = np.empty(n_fft_coeffs, dtype=complex)
2604  */
2605   __pyx_v_n_fft_coeffs = (__pyx_v_kernel_tilde.shape[0]);
2606 
2607   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":40
2608  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
2609  *
2610  *         complex[::1] fft_kernel_tilde = np.empty(n_fft_coeffs, dtype=complex)             # <<<<<<<<<<<<<<
2611  *         complex[::1] fft_w_coeffs = np.empty(n_fft_coeffs, dtype=complex)
2612  *         # Note that we can't use the same buffer for the input and output since
2613  */
2614   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
2615   __Pyx_GOTREF(__pyx_t_1);
2616   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
2617   __Pyx_GOTREF(__pyx_t_2);
2618   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2619   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
2620   __Pyx_GOTREF(__pyx_t_1);
2621   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
2622   __Pyx_GOTREF(__pyx_t_3);
2623   __Pyx_GIVEREF(__pyx_t_1);
2624   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2625   __pyx_t_1 = 0;
2626   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
2627   __Pyx_GOTREF(__pyx_t_1);
2628   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
2629   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error)
2630   __Pyx_GOTREF(__pyx_t_4);
2631   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2632   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2633   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2634   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 40, __pyx_L1_error)
2635   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2636   __pyx_v_fft_kernel_tilde = __pyx_t_5;
2637   __pyx_t_5.memview = NULL;
2638   __pyx_t_5.data = NULL;
2639 
2640   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":41
2641  *
2642  *         complex[::1] fft_kernel_tilde = np.empty(n_fft_coeffs, dtype=complex)
2643  *         complex[::1] fft_w_coeffs = np.empty(n_fft_coeffs, dtype=complex)             # <<<<<<<<<<<<<<
2644  *         # Note that we can't use the same buffer for the input and output since
2645  *         # we only write to the first half of the vector - we'd need to
2646  */
2647   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
2648   __Pyx_GOTREF(__pyx_t_4);
2649   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
2650   __Pyx_GOTREF(__pyx_t_1);
2651   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2652   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
2653   __Pyx_GOTREF(__pyx_t_4);
2654   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2655   __Pyx_GOTREF(__pyx_t_3);
2656   __Pyx_GIVEREF(__pyx_t_4);
2657   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
2658   __pyx_t_4 = 0;
2659   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
2660   __Pyx_GOTREF(__pyx_t_4);
2661   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
2662   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
2663   __Pyx_GOTREF(__pyx_t_2);
2664   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2665   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2666   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2667   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 41, __pyx_L1_error)
2668   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2669   __pyx_v_fft_w_coeffs = __pyx_t_5;
2670   __pyx_t_5.memview = NULL;
2671   __pyx_t_5.data = NULL;
2672 
2673   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":47
2674  *         # changed during the IDFT, so it's faster to use two buffers, at the
2675  *         # cost of some memory
2676  *         complex[::1] fft_in_buffer = np.zeros(n_fft_coeffs, dtype=complex)             # <<<<<<<<<<<<<<
2677  *         complex[::1] fft_out_buffer = np.zeros(n_fft_coeffs, dtype=complex)
2678  *
2679  */
2680   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
2681   __Pyx_GOTREF(__pyx_t_2);
2682   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
2683   __Pyx_GOTREF(__pyx_t_4);
2684   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2685   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
2686   __Pyx_GOTREF(__pyx_t_2);
2687   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
2688   __Pyx_GOTREF(__pyx_t_3);
2689   __Pyx_GIVEREF(__pyx_t_2);
2690   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
2691   __pyx_t_2 = 0;
2692   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
2693   __Pyx_GOTREF(__pyx_t_2);
2694   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
2695   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
2696   __Pyx_GOTREF(__pyx_t_1);
2697   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2698   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2699   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2700   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 47, __pyx_L1_error)
2701   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2702   __pyx_v_fft_in_buffer = __pyx_t_5;
2703   __pyx_t_5.memview = NULL;
2704   __pyx_t_5.data = NULL;
2705 
2706   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":48
2707  *         # cost of some memory
2708  *         complex[::1] fft_in_buffer = np.zeros(n_fft_coeffs, dtype=complex)
2709  *         complex[::1] fft_out_buffer = np.zeros(n_fft_coeffs, dtype=complex)             # <<<<<<<<<<<<<<
2710  *
2711  *         Py_ssize_t d, i
2712  */
2713   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
2714   __Pyx_GOTREF(__pyx_t_1);
2715   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
2716   __Pyx_GOTREF(__pyx_t_2);
2717   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2718   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
2719   __Pyx_GOTREF(__pyx_t_1);
2720   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
2721   __Pyx_GOTREF(__pyx_t_3);
2722   __Pyx_GIVEREF(__pyx_t_1);
2723   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2724   __pyx_t_1 = 0;
2725   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
2726   __Pyx_GOTREF(__pyx_t_1);
2727   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
2728   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
2729   __Pyx_GOTREF(__pyx_t_4);
2730   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2731   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2732   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2733   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 48, __pyx_L1_error)
2734   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2735   __pyx_v_fft_out_buffer = __pyx_t_5;
2736   __pyx_t_5.memview = NULL;
2737   __pyx_t_5.data = NULL;
2738 
2739   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":53
2740  *
2741  *     # Compute the FFT of the kernel vector
2742  *     fft_kernel_tilde = np.fft.fft(kernel_tilde)             # <<<<<<<<<<<<<<
2743  *
2744  *     for d in range(n_terms):
2745  */
2746   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
2747   __Pyx_GOTREF(__pyx_t_1);
2748   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
2749   __Pyx_GOTREF(__pyx_t_3);
2750   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2751   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
2752   __Pyx_GOTREF(__pyx_t_1);
2753   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2754   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_kernel_tilde, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
2755   __Pyx_GOTREF(__pyx_t_3);
2756   __pyx_t_2 = NULL;
2757   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
2758     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
2759     if (likely(__pyx_t_2)) {
2760       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2761       __Pyx_INCREF(__pyx_t_2);
2762       __Pyx_INCREF(function);
2763       __Pyx_DECREF_SET(__pyx_t_1, function);
2764     }
2765   }
2766   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
2767   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2768   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2769   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
2770   __Pyx_GOTREF(__pyx_t_4);
2771   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2772   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 53, __pyx_L1_error)
2773   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2774   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_kernel_tilde, 1);
2775   __pyx_v_fft_kernel_tilde = __pyx_t_5;
2776   __pyx_t_5.memview = NULL;
2777   __pyx_t_5.data = NULL;
2778 
2779   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":55
2780  *     fft_kernel_tilde = np.fft.fft(kernel_tilde)
2781  *
2782  *     for d in range(n_terms):             # <<<<<<<<<<<<<<
2783  *         for i in range(n_interpolation_points_1d):
2784  *             fft_in_buffer[i] = w_coefficients[i, d]
2785  */
2786   __pyx_t_6 = __pyx_v_n_terms;
2787   __pyx_t_7 = __pyx_t_6;
2788   for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
2789     __pyx_v_d = __pyx_t_8;
2790 
2791     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":56
2792  *
2793  *     for d in range(n_terms):
2794  *         for i in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
2795  *             fft_in_buffer[i] = w_coefficients[i, d]
2796  *
2797  */
2798     __pyx_t_9 = __pyx_v_n_interpolation_points_1d;
2799     __pyx_t_10 = __pyx_t_9;
2800     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
2801       __pyx_v_i = __pyx_t_11;
2802 
2803       /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":57
2804  *     for d in range(n_terms):
2805  *         for i in range(n_interpolation_points_1d):
2806  *             fft_in_buffer[i] = w_coefficients[i, d]             # <<<<<<<<<<<<<<
2807  *
2808  *         fft_w_coeffs = np.fft.fft(fft_in_buffer)
2809  */
2810       __pyx_t_12 = __pyx_v_i;
2811       __pyx_t_13 = __pyx_v_d;
2812       __pyx_t_14 = __pyx_v_i;
2813       *((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_fft_in_buffer.data) + __pyx_t_14)) )) = __pyx_t_double_complex_from_parts((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_w_coefficients.data + __pyx_t_12 * __pyx_v_w_coefficients.strides[0]) )) + __pyx_t_13)) ))), 0);
2814     }
2815 
2816     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":59
2817  *             fft_in_buffer[i] = w_coefficients[i, d]
2818  *
2819  *         fft_w_coeffs = np.fft.fft(fft_in_buffer)             # <<<<<<<<<<<<<<
2820  *
2821  *         # Take the Hadamard product of two complex vectors
2822  */
2823     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
2824     __Pyx_GOTREF(__pyx_t_1);
2825     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
2826     __Pyx_GOTREF(__pyx_t_3);
2827     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2828     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
2829     __Pyx_GOTREF(__pyx_t_1);
2830     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2831     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_fft_in_buffer, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
2832     __Pyx_GOTREF(__pyx_t_3);
2833     __pyx_t_2 = NULL;
2834     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
2835       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
2836       if (likely(__pyx_t_2)) {
2837         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2838         __Pyx_INCREF(__pyx_t_2);
2839         __Pyx_INCREF(function);
2840         __Pyx_DECREF_SET(__pyx_t_1, function);
2841       }
2842     }
2843     __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
2844     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2845     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2846     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
2847     __Pyx_GOTREF(__pyx_t_4);
2848     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2849     __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 59, __pyx_L1_error)
2850     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2851     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coeffs, 1);
2852     __pyx_v_fft_w_coeffs = __pyx_t_5;
2853     __pyx_t_5.memview = NULL;
2854     __pyx_t_5.data = NULL;
2855 
2856     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":62
2857  *
2858  *         # Take the Hadamard product of two complex vectors
2859  *         fft_w_coeffs = np.multiply(fft_w_coeffs, fft_kernel_tilde)             # <<<<<<<<<<<<<<
2860  *
2861  *         fft_out_buffer = np.fft.ifft(fft_w_coeffs)
2862  */
2863     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2864     __Pyx_GOTREF(__pyx_t_1);
2865     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multiply); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
2866     __Pyx_GOTREF(__pyx_t_3);
2867     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2868     __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_fft_w_coeffs, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2869     __Pyx_GOTREF(__pyx_t_1);
2870     __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_fft_kernel_tilde, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2871     __Pyx_GOTREF(__pyx_t_2);
2872     __pyx_t_15 = NULL;
2873     __pyx_t_16 = 0;
2874     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2875       __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
2876       if (likely(__pyx_t_15)) {
2877         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2878         __Pyx_INCREF(__pyx_t_15);
2879         __Pyx_INCREF(function);
2880         __Pyx_DECREF_SET(__pyx_t_3, function);
2881         __pyx_t_16 = 1;
2882       }
2883     }
2884     #if CYTHON_FAST_PYCALL
2885     if (PyFunction_Check(__pyx_t_3)) {
2886       PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_1, __pyx_t_2};
2887       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2888       __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
2889       __Pyx_GOTREF(__pyx_t_4);
2890       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2891       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2892     } else
2893     #endif
2894     #if CYTHON_FAST_PYCCALL
2895     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2896       PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_1, __pyx_t_2};
2897       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2898       __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
2899       __Pyx_GOTREF(__pyx_t_4);
2900       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2901       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2902     } else
2903     #endif
2904     {
2905       __pyx_t_17 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 62, __pyx_L1_error)
2906       __Pyx_GOTREF(__pyx_t_17);
2907       if (__pyx_t_15) {
2908         __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL;
2909       }
2910       __Pyx_GIVEREF(__pyx_t_1);
2911       PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_16, __pyx_t_1);
2912       __Pyx_GIVEREF(__pyx_t_2);
2913       PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_16, __pyx_t_2);
2914       __pyx_t_1 = 0;
2915       __pyx_t_2 = 0;
2916       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2917       __Pyx_GOTREF(__pyx_t_4);
2918       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
2919     }
2920     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2921     __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 62, __pyx_L1_error)
2922     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2923     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coeffs, 1);
2924     __pyx_v_fft_w_coeffs = __pyx_t_5;
2925     __pyx_t_5.memview = NULL;
2926     __pyx_t_5.data = NULL;
2927 
2928     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":64
2929  *         fft_w_coeffs = np.multiply(fft_w_coeffs, fft_kernel_tilde)
2930  *
2931  *         fft_out_buffer = np.fft.ifft(fft_w_coeffs)             # <<<<<<<<<<<<<<
2932  *
2933  *         for i in range(n_interpolation_points_1d):
2934  */
2935     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
2936     __Pyx_GOTREF(__pyx_t_3);
2937     __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 64, __pyx_L1_error)
2938     __Pyx_GOTREF(__pyx_t_17);
2939     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2940     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_ifft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
2941     __Pyx_GOTREF(__pyx_t_3);
2942     __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
2943     __pyx_t_17 = __pyx_memoryview_fromslice(__pyx_v_fft_w_coeffs, 1, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 64, __pyx_L1_error)
2944     __Pyx_GOTREF(__pyx_t_17);
2945     __pyx_t_2 = NULL;
2946     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2947       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
2948       if (likely(__pyx_t_2)) {
2949         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2950         __Pyx_INCREF(__pyx_t_2);
2951         __Pyx_INCREF(function);
2952         __Pyx_DECREF_SET(__pyx_t_3, function);
2953       }
2954     }
2955     __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_17) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_17);
2956     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2957     __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
2958     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
2959     __Pyx_GOTREF(__pyx_t_4);
2960     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2961     __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 64, __pyx_L1_error)
2962     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2963     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_out_buffer, 1);
2964     __pyx_v_fft_out_buffer = __pyx_t_5;
2965     __pyx_t_5.memview = NULL;
2966     __pyx_t_5.data = NULL;
2967 
2968     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":66
2969  *         fft_out_buffer = np.fft.ifft(fft_w_coeffs)
2970  *
2971  *         for i in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
2972  *             out[i, d] = fft_out_buffer[n_interpolation_points_1d + i].real
2973  *
2974  */
2975     __pyx_t_9 = __pyx_v_n_interpolation_points_1d;
2976     __pyx_t_10 = __pyx_t_9;
2977     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
2978       __pyx_v_i = __pyx_t_11;
2979 
2980       /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":67
2981  *
2982  *         for i in range(n_interpolation_points_1d):
2983  *             out[i, d] = fft_out_buffer[n_interpolation_points_1d + i].real             # <<<<<<<<<<<<<<
2984  *
2985  *
2986  */
2987       __pyx_t_13 = (__pyx_v_n_interpolation_points_1d + __pyx_v_i);
2988       __pyx_t_18 = __Pyx_CREAL((*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_fft_out_buffer.data) + __pyx_t_13)) ))));
2989       __pyx_t_13 = __pyx_v_i;
2990       __pyx_t_12 = __pyx_v_d;
2991       *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_13 * __pyx_v_out.strides[0]) )) + __pyx_t_12)) )) = __pyx_t_18;
2992     }
2993   }
2994 
2995   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":12
2996  *
2997  *
2998  * cdef void matrix_multiply_fft_1d(             # <<<<<<<<<<<<<<
2999  *     double[::1] kernel_tilde,
3000  *     double[:, ::1] w_coefficients,
3001  */
3002 
3003   /* function exit code */
3004   goto __pyx_L0;
3005   __pyx_L1_error:;
3006   __Pyx_XDECREF(__pyx_t_1);
3007   __Pyx_XDECREF(__pyx_t_2);
3008   __Pyx_XDECREF(__pyx_t_3);
3009   __Pyx_XDECREF(__pyx_t_4);
3010   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3011   __Pyx_XDECREF(__pyx_t_15);
3012   __Pyx_XDECREF(__pyx_t_17);
3013   __Pyx_WriteUnraisable("openTSNE._matrix_mul.matrix_mul.matrix_multiply_fft_1d", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3014   __pyx_L0:;
3015   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_kernel_tilde, 1);
3016   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coeffs, 1);
3017   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_in_buffer, 1);
3018   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_out_buffer, 1);
3019   __Pyx_RefNannyFinishContext();
3020 }
3021 
3022 /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":70
3023  *
3024  *
3025  * cdef void matrix_multiply_fft_2d(             # <<<<<<<<<<<<<<
3026  *     double[:, ::1] kernel_tilde,
3027  *     double[:, ::1] w_coefficients,
3028  */
3029 
__pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_2d(__Pyx_memviewslice __pyx_v_kernel_tilde,__Pyx_memviewslice __pyx_v_w_coefficients,__Pyx_memviewslice __pyx_v_out)3030 static void __pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_2d(__Pyx_memviewslice __pyx_v_kernel_tilde, __Pyx_memviewslice __pyx_v_w_coefficients, __Pyx_memviewslice __pyx_v_out) {
3031   CYTHON_UNUSED Py_ssize_t __pyx_v_total_interpolation_points;
3032   Py_ssize_t __pyx_v_n_terms;
3033   Py_ssize_t __pyx_v_n_fft_coeffs;
3034   Py_ssize_t __pyx_v_n_interpolation_points_1d;
3035   __Pyx_memviewslice __pyx_v_fft_w_coefficients = { 0, 0, { 0 }, { 0 }, { 0 } };
3036   __Pyx_memviewslice __pyx_v_fft_kernel_tilde = { 0, 0, { 0 }, { 0 }, { 0 } };
3037   __Pyx_memviewslice __pyx_v_fft_in_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
3038   __Pyx_memviewslice __pyx_v_fft_out_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
3039   Py_ssize_t __pyx_v_d;
3040   Py_ssize_t __pyx_v_i;
3041   Py_ssize_t __pyx_v_j;
3042   Py_ssize_t __pyx_v_idx;
3043   __Pyx_RefNannyDeclarations
3044   PyObject *__pyx_t_1 = NULL;
3045   PyObject *__pyx_t_2 = NULL;
3046   PyObject *__pyx_t_3 = NULL;
3047   PyObject *__pyx_t_4 = NULL;
3048   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
3049   __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3050   Py_ssize_t __pyx_t_7;
3051   Py_ssize_t __pyx_t_8;
3052   Py_ssize_t __pyx_t_9;
3053   Py_ssize_t __pyx_t_10;
3054   Py_ssize_t __pyx_t_11;
3055   Py_ssize_t __pyx_t_12;
3056   Py_ssize_t __pyx_t_13;
3057   Py_ssize_t __pyx_t_14;
3058   Py_ssize_t __pyx_t_15;
3059   Py_ssize_t __pyx_t_16;
3060   Py_ssize_t __pyx_t_17;
3061   Py_ssize_t __pyx_t_18;
3062   Py_ssize_t __pyx_t_19;
3063   PyObject *__pyx_t_20 = NULL;
3064   int __pyx_t_21;
3065   PyObject *__pyx_t_22 = NULL;
3066   double __pyx_t_23;
3067   int __pyx_lineno = 0;
3068   const char *__pyx_filename = NULL;
3069   int __pyx_clineno = 0;
3070   __Pyx_RefNannySetupContext("matrix_multiply_fft_2d", 0);
3071 
3072   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":94
3073  *     """
3074  *     cdef:
3075  *         Py_ssize_t total_interpolation_points = w_coefficients.shape[0]             # <<<<<<<<<<<<<<
3076  *         Py_ssize_t n_terms = w_coefficients.shape[1]
3077  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
3078  */
3079   __pyx_v_total_interpolation_points = (__pyx_v_w_coefficients.shape[0]);
3080 
3081   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":95
3082  *     cdef:
3083  *         Py_ssize_t total_interpolation_points = w_coefficients.shape[0]
3084  *         Py_ssize_t n_terms = w_coefficients.shape[1]             # <<<<<<<<<<<<<<
3085  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
3086  *         Py_ssize_t n_interpolation_points_1d = n_fft_coeffs / 2
3087  */
3088   __pyx_v_n_terms = (__pyx_v_w_coefficients.shape[1]);
3089 
3090   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":96
3091  *         Py_ssize_t total_interpolation_points = w_coefficients.shape[0]
3092  *         Py_ssize_t n_terms = w_coefficients.shape[1]
3093  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]             # <<<<<<<<<<<<<<
3094  *         Py_ssize_t n_interpolation_points_1d = n_fft_coeffs / 2
3095  *
3096  */
3097   __pyx_v_n_fft_coeffs = (__pyx_v_kernel_tilde.shape[0]);
3098 
3099   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":97
3100  *         Py_ssize_t n_terms = w_coefficients.shape[1]
3101  *         Py_ssize_t n_fft_coeffs = kernel_tilde.shape[0]
3102  *         Py_ssize_t n_interpolation_points_1d = n_fft_coeffs / 2             # <<<<<<<<<<<<<<
3103  *
3104  *         complex[:, :] fft_w_coefficients = np.empty((n_fft_coeffs, (n_fft_coeffs / 2 + 1)), dtype=complex)
3105  */
3106   __pyx_v_n_interpolation_points_1d = (__pyx_v_n_fft_coeffs / 2);
3107 
3108   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":99
3109  *         Py_ssize_t n_interpolation_points_1d = n_fft_coeffs / 2
3110  *
3111  *         complex[:, :] fft_w_coefficients = np.empty((n_fft_coeffs, (n_fft_coeffs / 2 + 1)), dtype=complex)             # <<<<<<<<<<<<<<
3112  *         complex[:, :] fft_kernel_tilde = np.empty((n_fft_coeffs, (n_fft_coeffs / 2 + 1)), dtype=complex)
3113  *         # Note that we can't use the same buffer for the input and output since
3114  */
3115   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
3116   __Pyx_GOTREF(__pyx_t_1);
3117   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
3118   __Pyx_GOTREF(__pyx_t_2);
3119   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3120   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
3121   __Pyx_GOTREF(__pyx_t_1);
3122   __pyx_t_3 = PyInt_FromSsize_t(((__pyx_v_n_fft_coeffs / 2) + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
3123   __Pyx_GOTREF(__pyx_t_3);
3124   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
3125   __Pyx_GOTREF(__pyx_t_4);
3126   __Pyx_GIVEREF(__pyx_t_1);
3127   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3128   __Pyx_GIVEREF(__pyx_t_3);
3129   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3130   __pyx_t_1 = 0;
3131   __pyx_t_3 = 0;
3132   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
3133   __Pyx_GOTREF(__pyx_t_3);
3134   __Pyx_GIVEREF(__pyx_t_4);
3135   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
3136   __pyx_t_4 = 0;
3137   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
3138   __Pyx_GOTREF(__pyx_t_4);
3139   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
3140   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
3141   __Pyx_GOTREF(__pyx_t_1);
3142   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3143   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3144   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3145   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 99, __pyx_L1_error)
3146   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3147   __pyx_v_fft_w_coefficients = __pyx_t_5;
3148   __pyx_t_5.memview = NULL;
3149   __pyx_t_5.data = NULL;
3150 
3151   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":100
3152  *
3153  *         complex[:, :] fft_w_coefficients = np.empty((n_fft_coeffs, (n_fft_coeffs / 2 + 1)), dtype=complex)
3154  *         complex[:, :] fft_kernel_tilde = np.empty((n_fft_coeffs, (n_fft_coeffs / 2 + 1)), dtype=complex)             # <<<<<<<<<<<<<<
3155  *         # Note that we can't use the same buffer for the input and output since
3156  *         # we only write to the top quadrant of the in matrix - we'd need to
3157  */
3158   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
3159   __Pyx_GOTREF(__pyx_t_1);
3160   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
3161   __Pyx_GOTREF(__pyx_t_4);
3162   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3163   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
3164   __Pyx_GOTREF(__pyx_t_1);
3165   __pyx_t_3 = PyInt_FromSsize_t(((__pyx_v_n_fft_coeffs / 2) + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
3166   __Pyx_GOTREF(__pyx_t_3);
3167   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
3168   __Pyx_GOTREF(__pyx_t_2);
3169   __Pyx_GIVEREF(__pyx_t_1);
3170   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3171   __Pyx_GIVEREF(__pyx_t_3);
3172   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3173   __pyx_t_1 = 0;
3174   __pyx_t_3 = 0;
3175   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
3176   __Pyx_GOTREF(__pyx_t_3);
3177   __Pyx_GIVEREF(__pyx_t_2);
3178   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3179   __pyx_t_2 = 0;
3180   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
3181   __Pyx_GOTREF(__pyx_t_2);
3182   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
3183   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
3184   __Pyx_GOTREF(__pyx_t_1);
3185   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3186   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3187   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3188   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 100, __pyx_L1_error)
3189   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3190   __pyx_v_fft_kernel_tilde = __pyx_t_5;
3191   __pyx_t_5.memview = NULL;
3192   __pyx_t_5.data = NULL;
3193 
3194   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":106
3195  *         # changed during the IDFT, so it's faster to use two buffers, at the
3196  *         # cost of some memory
3197  *         double[:, ::1] fft_in_buffer = np.zeros((n_fft_coeffs, n_fft_coeffs), dtype=float)             # <<<<<<<<<<<<<<
3198  *         double[:, ::1] fft_out_buffer = np.zeros((n_fft_coeffs, n_fft_coeffs), dtype=float)
3199  *
3200  */
3201   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
3202   __Pyx_GOTREF(__pyx_t_1);
3203   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
3204   __Pyx_GOTREF(__pyx_t_2);
3205   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3206   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
3207   __Pyx_GOTREF(__pyx_t_1);
3208   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
3209   __Pyx_GOTREF(__pyx_t_3);
3210   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
3211   __Pyx_GOTREF(__pyx_t_4);
3212   __Pyx_GIVEREF(__pyx_t_1);
3213   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3214   __Pyx_GIVEREF(__pyx_t_3);
3215   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
3216   __pyx_t_1 = 0;
3217   __pyx_t_3 = 0;
3218   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
3219   __Pyx_GOTREF(__pyx_t_3);
3220   __Pyx_GIVEREF(__pyx_t_4);
3221   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
3222   __pyx_t_4 = 0;
3223   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
3224   __Pyx_GOTREF(__pyx_t_4);
3225   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
3226   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
3227   __Pyx_GOTREF(__pyx_t_1);
3228   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3229   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3230   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3231   __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 106, __pyx_L1_error)
3232   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3233   __pyx_v_fft_in_buffer = __pyx_t_6;
3234   __pyx_t_6.memview = NULL;
3235   __pyx_t_6.data = NULL;
3236 
3237   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":107
3238  *         # cost of some memory
3239  *         double[:, ::1] fft_in_buffer = np.zeros((n_fft_coeffs, n_fft_coeffs), dtype=float)
3240  *         double[:, ::1] fft_out_buffer = np.zeros((n_fft_coeffs, n_fft_coeffs), dtype=float)             # <<<<<<<<<<<<<<
3241  *
3242  *         Py_ssize_t d, i, j, idx
3243  */
3244   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
3245   __Pyx_GOTREF(__pyx_t_1);
3246   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
3247   __Pyx_GOTREF(__pyx_t_4);
3248   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3249   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
3250   __Pyx_GOTREF(__pyx_t_1);
3251   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_fft_coeffs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
3252   __Pyx_GOTREF(__pyx_t_3);
3253   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
3254   __Pyx_GOTREF(__pyx_t_2);
3255   __Pyx_GIVEREF(__pyx_t_1);
3256   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3257   __Pyx_GIVEREF(__pyx_t_3);
3258   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3259   __pyx_t_1 = 0;
3260   __pyx_t_3 = 0;
3261   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
3262   __Pyx_GOTREF(__pyx_t_3);
3263   __Pyx_GIVEREF(__pyx_t_2);
3264   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3265   __pyx_t_2 = 0;
3266   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
3267   __Pyx_GOTREF(__pyx_t_2);
3268   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
3269   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
3270   __Pyx_GOTREF(__pyx_t_1);
3271   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3272   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3273   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3274   __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 107, __pyx_L1_error)
3275   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3276   __pyx_v_fft_out_buffer = __pyx_t_6;
3277   __pyx_t_6.memview = NULL;
3278   __pyx_t_6.data = NULL;
3279 
3280   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":111
3281  *         Py_ssize_t d, i, j, idx
3282  *
3283  *     fft_kernel_tilde = np.fft.rfft2(kernel_tilde)             # <<<<<<<<<<<<<<
3284  *
3285  *     for d in range(n_terms):
3286  */
3287   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
3288   __Pyx_GOTREF(__pyx_t_2);
3289   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
3290   __Pyx_GOTREF(__pyx_t_3);
3291   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3292   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_rfft2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
3293   __Pyx_GOTREF(__pyx_t_2);
3294   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3295   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_kernel_tilde, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
3296   __Pyx_GOTREF(__pyx_t_3);
3297   __pyx_t_4 = NULL;
3298   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3299     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3300     if (likely(__pyx_t_4)) {
3301       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3302       __Pyx_INCREF(__pyx_t_4);
3303       __Pyx_INCREF(function);
3304       __Pyx_DECREF_SET(__pyx_t_2, function);
3305     }
3306   }
3307   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
3308   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3309   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3310   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
3311   __Pyx_GOTREF(__pyx_t_1);
3312   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3313   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 111, __pyx_L1_error)
3314   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3315   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_kernel_tilde, 1);
3316   __pyx_v_fft_kernel_tilde = __pyx_t_5;
3317   __pyx_t_5.memview = NULL;
3318   __pyx_t_5.data = NULL;
3319 
3320   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":113
3321  *     fft_kernel_tilde = np.fft.rfft2(kernel_tilde)
3322  *
3323  *     for d in range(n_terms):             # <<<<<<<<<<<<<<
3324  *         for i in range(n_interpolation_points_1d):
3325  *             for j in range(n_interpolation_points_1d):
3326  */
3327   __pyx_t_7 = __pyx_v_n_terms;
3328   __pyx_t_8 = __pyx_t_7;
3329   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
3330     __pyx_v_d = __pyx_t_9;
3331 
3332     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":114
3333  *
3334  *     for d in range(n_terms):
3335  *         for i in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
3336  *             for j in range(n_interpolation_points_1d):
3337  *                 fft_in_buffer[i, j] = w_coefficients[i * n_interpolation_points_1d + j, d]
3338  */
3339     __pyx_t_10 = __pyx_v_n_interpolation_points_1d;
3340     __pyx_t_11 = __pyx_t_10;
3341     for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
3342       __pyx_v_i = __pyx_t_12;
3343 
3344       /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":115
3345  *     for d in range(n_terms):
3346  *         for i in range(n_interpolation_points_1d):
3347  *             for j in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
3348  *                 fft_in_buffer[i, j] = w_coefficients[i * n_interpolation_points_1d + j, d]
3349  *
3350  */
3351       __pyx_t_13 = __pyx_v_n_interpolation_points_1d;
3352       __pyx_t_14 = __pyx_t_13;
3353       for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
3354         __pyx_v_j = __pyx_t_15;
3355 
3356         /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":116
3357  *         for i in range(n_interpolation_points_1d):
3358  *             for j in range(n_interpolation_points_1d):
3359  *                 fft_in_buffer[i, j] = w_coefficients[i * n_interpolation_points_1d + j, d]             # <<<<<<<<<<<<<<
3360  *
3361  *         fft_w_coefficients = np.fft.rfft2(fft_in_buffer)
3362  */
3363         __pyx_t_16 = ((__pyx_v_i * __pyx_v_n_interpolation_points_1d) + __pyx_v_j);
3364         __pyx_t_17 = __pyx_v_d;
3365         __pyx_t_18 = __pyx_v_i;
3366         __pyx_t_19 = __pyx_v_j;
3367         *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_fft_in_buffer.data + __pyx_t_18 * __pyx_v_fft_in_buffer.strides[0]) )) + __pyx_t_19)) )) = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_w_coefficients.data + __pyx_t_16 * __pyx_v_w_coefficients.strides[0]) )) + __pyx_t_17)) )));
3368       }
3369     }
3370 
3371     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":118
3372  *                 fft_in_buffer[i, j] = w_coefficients[i * n_interpolation_points_1d + j, d]
3373  *
3374  *         fft_w_coefficients = np.fft.rfft2(fft_in_buffer)             # <<<<<<<<<<<<<<
3375  *
3376  *         # Take the Hadamard product of two complex vectors
3377  */
3378     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3379     __Pyx_GOTREF(__pyx_t_2);
3380     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
3381     __Pyx_GOTREF(__pyx_t_3);
3382     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3383     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_rfft2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3384     __Pyx_GOTREF(__pyx_t_2);
3385     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3386     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_fft_in_buffer, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
3387     __Pyx_GOTREF(__pyx_t_3);
3388     __pyx_t_4 = NULL;
3389     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3390       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3391       if (likely(__pyx_t_4)) {
3392         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3393         __Pyx_INCREF(__pyx_t_4);
3394         __Pyx_INCREF(function);
3395         __Pyx_DECREF_SET(__pyx_t_2, function);
3396       }
3397     }
3398     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
3399     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3400     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3401     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
3402     __Pyx_GOTREF(__pyx_t_1);
3403     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3404     __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 118, __pyx_L1_error)
3405     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3406     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coefficients, 1);
3407     __pyx_v_fft_w_coefficients = __pyx_t_5;
3408     __pyx_t_5.memview = NULL;
3409     __pyx_t_5.data = NULL;
3410 
3411     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":121
3412  *
3413  *         # Take the Hadamard product of two complex vectors
3414  *         fft_w_coefficients = np.multiply(fft_w_coefficients, fft_kernel_tilde)             # <<<<<<<<<<<<<<
3415  *
3416  *         # Invert the computed values at the interpolated nodes
3417  */
3418     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
3419     __Pyx_GOTREF(__pyx_t_2);
3420     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_multiply); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
3421     __Pyx_GOTREF(__pyx_t_3);
3422     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3423     __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_fft_w_coefficients, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
3424     __Pyx_GOTREF(__pyx_t_2);
3425     __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_fft_kernel_tilde, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
3426     __Pyx_GOTREF(__pyx_t_4);
3427     __pyx_t_20 = NULL;
3428     __pyx_t_21 = 0;
3429     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3430       __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3);
3431       if (likely(__pyx_t_20)) {
3432         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3433         __Pyx_INCREF(__pyx_t_20);
3434         __Pyx_INCREF(function);
3435         __Pyx_DECREF_SET(__pyx_t_3, function);
3436         __pyx_t_21 = 1;
3437       }
3438     }
3439     #if CYTHON_FAST_PYCALL
3440     if (PyFunction_Check(__pyx_t_3)) {
3441       PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_2, __pyx_t_4};
3442       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
3443       __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
3444       __Pyx_GOTREF(__pyx_t_1);
3445       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3446       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3447     } else
3448     #endif
3449     #if CYTHON_FAST_PYCCALL
3450     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3451       PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_2, __pyx_t_4};
3452       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_21, 2+__pyx_t_21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
3453       __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
3454       __Pyx_GOTREF(__pyx_t_1);
3455       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3456       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3457     } else
3458     #endif
3459     {
3460       __pyx_t_22 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 121, __pyx_L1_error)
3461       __Pyx_GOTREF(__pyx_t_22);
3462       if (__pyx_t_20) {
3463         __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20); __pyx_t_20 = NULL;
3464       }
3465       __Pyx_GIVEREF(__pyx_t_2);
3466       PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_21, __pyx_t_2);
3467       __Pyx_GIVEREF(__pyx_t_4);
3468       PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_21, __pyx_t_4);
3469       __pyx_t_2 = 0;
3470       __pyx_t_4 = 0;
3471       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
3472       __Pyx_GOTREF(__pyx_t_1);
3473       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
3474     }
3475     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3476     __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 121, __pyx_L1_error)
3477     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3478     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coefficients, 1);
3479     __pyx_v_fft_w_coefficients = __pyx_t_5;
3480     __pyx_t_5.memview = NULL;
3481     __pyx_t_5.data = NULL;
3482 
3483     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":124
3484  *
3485  *         # Invert the computed values at the interpolated nodes
3486  *         fft_out_buffer = np.fft.irfft2(fft_w_coefficients)             # <<<<<<<<<<<<<<
3487  *
3488  *         for i in range(n_interpolation_points_1d):
3489  */
3490     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
3491     __Pyx_GOTREF(__pyx_t_3);
3492     __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 124, __pyx_L1_error)
3493     __Pyx_GOTREF(__pyx_t_22);
3494     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3495     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_irfft2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
3496     __Pyx_GOTREF(__pyx_t_3);
3497     __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
3498     __pyx_t_22 = __pyx_memoryview_fromslice(__pyx_v_fft_w_coefficients, 2, (PyObject *(*)(char *)) __pyx_memview_get___pyx_t_double_complex, (int (*)(char *, PyObject *)) __pyx_memview_set___pyx_t_double_complex, 0);; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 124, __pyx_L1_error)
3499     __Pyx_GOTREF(__pyx_t_22);
3500     __pyx_t_4 = NULL;
3501     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3502       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3503       if (likely(__pyx_t_4)) {
3504         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3505         __Pyx_INCREF(__pyx_t_4);
3506         __Pyx_INCREF(function);
3507         __Pyx_DECREF_SET(__pyx_t_3, function);
3508       }
3509     }
3510     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_22) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_22);
3511     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3512     __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
3513     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
3514     __Pyx_GOTREF(__pyx_t_1);
3515     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3516     __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 124, __pyx_L1_error)
3517     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3518     __PYX_XDEC_MEMVIEW(&__pyx_v_fft_out_buffer, 1);
3519     __pyx_v_fft_out_buffer = __pyx_t_6;
3520     __pyx_t_6.memview = NULL;
3521     __pyx_t_6.data = NULL;
3522 
3523     /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":126
3524  *         fft_out_buffer = np.fft.irfft2(fft_w_coefficients)
3525  *
3526  *         for i in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
3527  *             for j in range(n_interpolation_points_1d):
3528  *                 idx = i * n_interpolation_points_1d + j
3529  */
3530     __pyx_t_10 = __pyx_v_n_interpolation_points_1d;
3531     __pyx_t_11 = __pyx_t_10;
3532     for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
3533       __pyx_v_i = __pyx_t_12;
3534 
3535       /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":127
3536  *
3537  *         for i in range(n_interpolation_points_1d):
3538  *             for j in range(n_interpolation_points_1d):             # <<<<<<<<<<<<<<
3539  *                 idx = i * n_interpolation_points_1d + j
3540  *                 out[idx, d] = fft_out_buffer[n_interpolation_points_1d + i,
3541  */
3542       __pyx_t_13 = __pyx_v_n_interpolation_points_1d;
3543       __pyx_t_14 = __pyx_t_13;
3544       for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
3545         __pyx_v_j = __pyx_t_15;
3546 
3547         /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":128
3548  *         for i in range(n_interpolation_points_1d):
3549  *             for j in range(n_interpolation_points_1d):
3550  *                 idx = i * n_interpolation_points_1d + j             # <<<<<<<<<<<<<<
3551  *                 out[idx, d] = fft_out_buffer[n_interpolation_points_1d + i,
3552  *                                              n_interpolation_points_1d + j].real
3553  */
3554         __pyx_v_idx = ((__pyx_v_i * __pyx_v_n_interpolation_points_1d) + __pyx_v_j);
3555 
3556         /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":129
3557  *             for j in range(n_interpolation_points_1d):
3558  *                 idx = i * n_interpolation_points_1d + j
3559  *                 out[idx, d] = fft_out_buffer[n_interpolation_points_1d + i,             # <<<<<<<<<<<<<<
3560  *                                              n_interpolation_points_1d + j].real
3561  */
3562         __pyx_t_17 = (__pyx_v_n_interpolation_points_1d + __pyx_v_i);
3563         __pyx_t_16 = (__pyx_v_n_interpolation_points_1d + __pyx_v_j);
3564         __pyx_t_1 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_fft_out_buffer.data + __pyx_t_17 * __pyx_v_fft_out_buffer.strides[0]) )) + __pyx_t_16)) )))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3565         __Pyx_GOTREF(__pyx_t_1);
3566 
3567         /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":130
3568  *                 idx = i * n_interpolation_points_1d + j
3569  *                 out[idx, d] = fft_out_buffer[n_interpolation_points_1d + i,
3570  *                                              n_interpolation_points_1d + j].real             # <<<<<<<<<<<<<<
3571  */
3572         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
3573         __Pyx_GOTREF(__pyx_t_3);
3574         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3575         __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error)
3576         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3577 
3578         /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":129
3579  *             for j in range(n_interpolation_points_1d):
3580  *                 idx = i * n_interpolation_points_1d + j
3581  *                 out[idx, d] = fft_out_buffer[n_interpolation_points_1d + i,             # <<<<<<<<<<<<<<
3582  *                                              n_interpolation_points_1d + j].real
3583  */
3584         __pyx_t_16 = __pyx_v_idx;
3585         __pyx_t_17 = __pyx_v_d;
3586         *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_16 * __pyx_v_out.strides[0]) )) + __pyx_t_17)) )) = __pyx_t_23;
3587       }
3588     }
3589   }
3590 
3591   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":70
3592  *
3593  *
3594  * cdef void matrix_multiply_fft_2d(             # <<<<<<<<<<<<<<
3595  *     double[:, ::1] kernel_tilde,
3596  *     double[:, ::1] w_coefficients,
3597  */
3598 
3599   /* function exit code */
3600   goto __pyx_L0;
3601   __pyx_L1_error:;
3602   __Pyx_XDECREF(__pyx_t_1);
3603   __Pyx_XDECREF(__pyx_t_2);
3604   __Pyx_XDECREF(__pyx_t_3);
3605   __Pyx_XDECREF(__pyx_t_4);
3606   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3607   __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3608   __Pyx_XDECREF(__pyx_t_20);
3609   __Pyx_XDECREF(__pyx_t_22);
3610   __Pyx_WriteUnraisable("openTSNE._matrix_mul.matrix_mul.matrix_multiply_fft_2d", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3611   __pyx_L0:;
3612   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_w_coefficients, 1);
3613   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_kernel_tilde, 1);
3614   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_in_buffer, 1);
3615   __PYX_XDEC_MEMVIEW(&__pyx_v_fft_out_buffer, 1);
3616   __Pyx_RefNannyFinishContext();
3617 }
3618 
3619 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
3620  *         # experimental exception made for __getbuffer__ and __releasebuffer__
3621  *         # -- the details of this may change.
3622  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
3623  *             # This implementation of getbuffer is geared towards Cython
3624  *             # requirements, and does not yet fulfill the PEP.
3625  */
3626 
3627 /* Python wrapper */
3628 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3629 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3630   int __pyx_r;
3631   __Pyx_RefNannyDeclarations
3632   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
3633   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
3634 
3635   /* function exit code */
3636   __Pyx_RefNannyFinishContext();
3637   return __pyx_r;
3638 }
3639 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3640 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3641   int __pyx_v_i;
3642   int __pyx_v_ndim;
3643   int __pyx_v_endian_detector;
3644   int __pyx_v_little_endian;
3645   int __pyx_v_t;
3646   char *__pyx_v_f;
3647   PyArray_Descr *__pyx_v_descr = 0;
3648   int __pyx_v_offset;
3649   int __pyx_r;
3650   __Pyx_RefNannyDeclarations
3651   int __pyx_t_1;
3652   int __pyx_t_2;
3653   PyObject *__pyx_t_3 = NULL;
3654   int __pyx_t_4;
3655   int __pyx_t_5;
3656   int __pyx_t_6;
3657   PyArray_Descr *__pyx_t_7;
3658   PyObject *__pyx_t_8 = NULL;
3659   char *__pyx_t_9;
3660   int __pyx_lineno = 0;
3661   const char *__pyx_filename = NULL;
3662   int __pyx_clineno = 0;
3663   if (__pyx_v_info == NULL) {
3664     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
3665     return -1;
3666   }
3667   __Pyx_RefNannySetupContext("__getbuffer__", 0);
3668   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
3669   __Pyx_GIVEREF(__pyx_v_info->obj);
3670 
3671   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
3672  *
3673  *             cdef int i, ndim
3674  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
3675  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3676  *
3677  */
3678   __pyx_v_endian_detector = 1;
3679 
3680   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
3681  *             cdef int i, ndim
3682  *             cdef int endian_detector = 1
3683  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
3684  *
3685  *             ndim = PyArray_NDIM(self)
3686  */
3687   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3688 
3689   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
3690  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3691  *
3692  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
3693  *
3694  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3695  */
3696   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
3697 
3698   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
3699  *             ndim = PyArray_NDIM(self)
3700  *
3701  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3702  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3703  *                 raise ValueError(u"ndarray is not C contiguous")
3704  */
3705   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
3706   if (__pyx_t_2) {
3707   } else {
3708     __pyx_t_1 = __pyx_t_2;
3709     goto __pyx_L4_bool_binop_done;
3710   }
3711 
3712   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
3713  *
3714  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3715  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
3716  *                 raise ValueError(u"ndarray is not C contiguous")
3717  *
3718  */
3719   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
3720   __pyx_t_1 = __pyx_t_2;
3721   __pyx_L4_bool_binop_done:;
3722 
3723   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
3724  *             ndim = PyArray_NDIM(self)
3725  *
3726  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3727  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3728  *                 raise ValueError(u"ndarray is not C contiguous")
3729  */
3730   if (unlikely(__pyx_t_1)) {
3731 
3732     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
3733  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3734  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3735  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
3736  *
3737  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3738  */
3739     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
3740     __Pyx_GOTREF(__pyx_t_3);
3741     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3742     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3743     __PYX_ERR(1, 272, __pyx_L1_error)
3744 
3745     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
3746  *             ndim = PyArray_NDIM(self)
3747  *
3748  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3749  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3750  *                 raise ValueError(u"ndarray is not C contiguous")
3751  */
3752   }
3753 
3754   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
3755  *                 raise ValueError(u"ndarray is not C contiguous")
3756  *
3757  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3758  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3759  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3760  */
3761   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
3762   if (__pyx_t_2) {
3763   } else {
3764     __pyx_t_1 = __pyx_t_2;
3765     goto __pyx_L7_bool_binop_done;
3766   }
3767 
3768   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
3769  *
3770  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3771  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
3772  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3773  *
3774  */
3775   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
3776   __pyx_t_1 = __pyx_t_2;
3777   __pyx_L7_bool_binop_done:;
3778 
3779   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
3780  *                 raise ValueError(u"ndarray is not C contiguous")
3781  *
3782  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3783  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3784  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3785  */
3786   if (unlikely(__pyx_t_1)) {
3787 
3788     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
3789  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3790  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3791  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
3792  *
3793  *             info.buf = PyArray_DATA(self)
3794  */
3795     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
3796     __Pyx_GOTREF(__pyx_t_3);
3797     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3798     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3799     __PYX_ERR(1, 276, __pyx_L1_error)
3800 
3801     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
3802  *                 raise ValueError(u"ndarray is not C contiguous")
3803  *
3804  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3805  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3806  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3807  */
3808   }
3809 
3810   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
3811  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3812  *
3813  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
3814  *             info.ndim = ndim
3815  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3816  */
3817   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
3818 
3819   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
3820  *
3821  *             info.buf = PyArray_DATA(self)
3822  *             info.ndim = ndim             # <<<<<<<<<<<<<<
3823  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3824  *                 # Allocate new buffer for strides and shape info.
3825  */
3826   __pyx_v_info->ndim = __pyx_v_ndim;
3827 
3828   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
3829  *             info.buf = PyArray_DATA(self)
3830  *             info.ndim = ndim
3831  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3832  *                 # Allocate new buffer for strides and shape info.
3833  *                 # This is allocated as one block, strides first.
3834  */
3835   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3836   if (__pyx_t_1) {
3837 
3838     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
3839  *                 # Allocate new buffer for strides and shape info.
3840  *                 # This is allocated as one block, strides first.
3841  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
3842  *                 info.shape = info.strides + ndim
3843  *                 for i in range(ndim):
3844  */
3845     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
3846 
3847     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
3848  *                 # This is allocated as one block, strides first.
3849  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
3850  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
3851  *                 for i in range(ndim):
3852  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3853  */
3854     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
3855 
3856     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
3857  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
3858  *                 info.shape = info.strides + ndim
3859  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
3860  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3861  *                     info.shape[i] = PyArray_DIMS(self)[i]
3862  */
3863     __pyx_t_4 = __pyx_v_ndim;
3864     __pyx_t_5 = __pyx_t_4;
3865     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3866       __pyx_v_i = __pyx_t_6;
3867 
3868       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
3869  *                 info.shape = info.strides + ndim
3870  *                 for i in range(ndim):
3871  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
3872  *                     info.shape[i] = PyArray_DIMS(self)[i]
3873  *             else:
3874  */
3875       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
3876 
3877       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
3878  *                 for i in range(ndim):
3879  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3880  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
3881  *             else:
3882  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3883  */
3884       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
3885     }
3886 
3887     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
3888  *             info.buf = PyArray_DATA(self)
3889  *             info.ndim = ndim
3890  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3891  *                 # Allocate new buffer for strides and shape info.
3892  *                 # This is allocated as one block, strides first.
3893  */
3894     goto __pyx_L9;
3895   }
3896 
3897   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
3898  *                     info.shape[i] = PyArray_DIMS(self)[i]
3899  *             else:
3900  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
3901  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3902  *             info.suboffsets = NULL
3903  */
3904   /*else*/ {
3905     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
3906 
3907     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
3908  *             else:
3909  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3910  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
3911  *             info.suboffsets = NULL
3912  *             info.itemsize = PyArray_ITEMSIZE(self)
3913  */
3914     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
3915   }
3916   __pyx_L9:;
3917 
3918   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
3919  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3920  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3921  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
3922  *             info.itemsize = PyArray_ITEMSIZE(self)
3923  *             info.readonly = not PyArray_ISWRITEABLE(self)
3924  */
3925   __pyx_v_info->suboffsets = NULL;
3926 
3927   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
3928  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3929  *             info.suboffsets = NULL
3930  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
3931  *             info.readonly = not PyArray_ISWRITEABLE(self)
3932  *
3933  */
3934   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
3935 
3936   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
3937  *             info.suboffsets = NULL
3938  *             info.itemsize = PyArray_ITEMSIZE(self)
3939  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
3940  *
3941  *             cdef int t
3942  */
3943   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
3944 
3945   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
3946  *
3947  *             cdef int t
3948  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
3949  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
3950  *             cdef int offset
3951  */
3952   __pyx_v_f = NULL;
3953 
3954   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
3955  *             cdef int t
3956  *             cdef char* f = NULL
3957  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
3958  *             cdef int offset
3959  *
3960  */
3961   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
3962   __pyx_t_3 = ((PyObject *)__pyx_t_7);
3963   __Pyx_INCREF(__pyx_t_3);
3964   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
3965   __pyx_t_3 = 0;
3966 
3967   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
3968  *             cdef int offset
3969  *
3970  *             info.obj = self             # <<<<<<<<<<<<<<
3971  *
3972  *             if not PyDataType_HASFIELDS(descr):
3973  */
3974   __Pyx_INCREF(((PyObject *)__pyx_v_self));
3975   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3976   __Pyx_GOTREF(__pyx_v_info->obj);
3977   __Pyx_DECREF(__pyx_v_info->obj);
3978   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
3979 
3980   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
3981  *             info.obj = self
3982  *
3983  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
3984  *                 t = descr.type_num
3985  *                 if ((descr.byteorder == c'>' and little_endian) or
3986  */
3987   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
3988   if (__pyx_t_1) {
3989 
3990     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
3991  *
3992  *             if not PyDataType_HASFIELDS(descr):
3993  *                 t = descr.type_num             # <<<<<<<<<<<<<<
3994  *                 if ((descr.byteorder == c'>' and little_endian) or
3995  *                     (descr.byteorder == c'<' and not little_endian)):
3996  */
3997     __pyx_t_4 = __pyx_v_descr->type_num;
3998     __pyx_v_t = __pyx_t_4;
3999 
4000     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
4001  *             if not PyDataType_HASFIELDS(descr):
4002  *                 t = descr.type_num
4003  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4004  *                     (descr.byteorder == c'<' and not little_endian)):
4005  *                     raise ValueError(u"Non-native byte order not supported")
4006  */
4007     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
4008     if (!__pyx_t_2) {
4009       goto __pyx_L15_next_or;
4010     } else {
4011     }
4012     __pyx_t_2 = (__pyx_v_little_endian != 0);
4013     if (!__pyx_t_2) {
4014     } else {
4015       __pyx_t_1 = __pyx_t_2;
4016       goto __pyx_L14_bool_binop_done;
4017     }
4018     __pyx_L15_next_or:;
4019 
4020     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
4021  *                 t = descr.type_num
4022  *                 if ((descr.byteorder == c'>' and little_endian) or
4023  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
4024  *                     raise ValueError(u"Non-native byte order not supported")
4025  *                 if   t == NPY_BYTE:        f = "b"
4026  */
4027     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
4028     if (__pyx_t_2) {
4029     } else {
4030       __pyx_t_1 = __pyx_t_2;
4031       goto __pyx_L14_bool_binop_done;
4032     }
4033     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
4034     __pyx_t_1 = __pyx_t_2;
4035     __pyx_L14_bool_binop_done:;
4036 
4037     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
4038  *             if not PyDataType_HASFIELDS(descr):
4039  *                 t = descr.type_num
4040  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4041  *                     (descr.byteorder == c'<' and not little_endian)):
4042  *                     raise ValueError(u"Non-native byte order not supported")
4043  */
4044     if (unlikely(__pyx_t_1)) {
4045 
4046       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
4047  *                 if ((descr.byteorder == c'>' and little_endian) or
4048  *                     (descr.byteorder == c'<' and not little_endian)):
4049  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
4050  *                 if   t == NPY_BYTE:        f = "b"
4051  *                 elif t == NPY_UBYTE:       f = "B"
4052  */
4053       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
4054       __Pyx_GOTREF(__pyx_t_3);
4055       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4056       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4057       __PYX_ERR(1, 306, __pyx_L1_error)
4058 
4059       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
4060  *             if not PyDataType_HASFIELDS(descr):
4061  *                 t = descr.type_num
4062  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4063  *                     (descr.byteorder == c'<' and not little_endian)):
4064  *                     raise ValueError(u"Non-native byte order not supported")
4065  */
4066     }
4067 
4068     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
4069  *                     (descr.byteorder == c'<' and not little_endian)):
4070  *                     raise ValueError(u"Non-native byte order not supported")
4071  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
4072  *                 elif t == NPY_UBYTE:       f = "B"
4073  *                 elif t == NPY_SHORT:       f = "h"
4074  */
4075     switch (__pyx_v_t) {
4076       case NPY_BYTE:
4077       __pyx_v_f = ((char *)"b");
4078       break;
4079       case NPY_UBYTE:
4080 
4081       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
4082  *                     raise ValueError(u"Non-native byte order not supported")
4083  *                 if   t == NPY_BYTE:        f = "b"
4084  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
4085  *                 elif t == NPY_SHORT:       f = "h"
4086  *                 elif t == NPY_USHORT:      f = "H"
4087  */
4088       __pyx_v_f = ((char *)"B");
4089       break;
4090       case NPY_SHORT:
4091 
4092       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
4093  *                 if   t == NPY_BYTE:        f = "b"
4094  *                 elif t == NPY_UBYTE:       f = "B"
4095  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
4096  *                 elif t == NPY_USHORT:      f = "H"
4097  *                 elif t == NPY_INT:         f = "i"
4098  */
4099       __pyx_v_f = ((char *)"h");
4100       break;
4101       case NPY_USHORT:
4102 
4103       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
4104  *                 elif t == NPY_UBYTE:       f = "B"
4105  *                 elif t == NPY_SHORT:       f = "h"
4106  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
4107  *                 elif t == NPY_INT:         f = "i"
4108  *                 elif t == NPY_UINT:        f = "I"
4109  */
4110       __pyx_v_f = ((char *)"H");
4111       break;
4112       case NPY_INT:
4113 
4114       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
4115  *                 elif t == NPY_SHORT:       f = "h"
4116  *                 elif t == NPY_USHORT:      f = "H"
4117  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
4118  *                 elif t == NPY_UINT:        f = "I"
4119  *                 elif t == NPY_LONG:        f = "l"
4120  */
4121       __pyx_v_f = ((char *)"i");
4122       break;
4123       case NPY_UINT:
4124 
4125       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
4126  *                 elif t == NPY_USHORT:      f = "H"
4127  *                 elif t == NPY_INT:         f = "i"
4128  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
4129  *                 elif t == NPY_LONG:        f = "l"
4130  *                 elif t == NPY_ULONG:       f = "L"
4131  */
4132       __pyx_v_f = ((char *)"I");
4133       break;
4134       case NPY_LONG:
4135 
4136       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
4137  *                 elif t == NPY_INT:         f = "i"
4138  *                 elif t == NPY_UINT:        f = "I"
4139  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
4140  *                 elif t == NPY_ULONG:       f = "L"
4141  *                 elif t == NPY_LONGLONG:    f = "q"
4142  */
4143       __pyx_v_f = ((char *)"l");
4144       break;
4145       case NPY_ULONG:
4146 
4147       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
4148  *                 elif t == NPY_UINT:        f = "I"
4149  *                 elif t == NPY_LONG:        f = "l"
4150  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
4151  *                 elif t == NPY_LONGLONG:    f = "q"
4152  *                 elif t == NPY_ULONGLONG:   f = "Q"
4153  */
4154       __pyx_v_f = ((char *)"L");
4155       break;
4156       case NPY_LONGLONG:
4157 
4158       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
4159  *                 elif t == NPY_LONG:        f = "l"
4160  *                 elif t == NPY_ULONG:       f = "L"
4161  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
4162  *                 elif t == NPY_ULONGLONG:   f = "Q"
4163  *                 elif t == NPY_FLOAT:       f = "f"
4164  */
4165       __pyx_v_f = ((char *)"q");
4166       break;
4167       case NPY_ULONGLONG:
4168 
4169       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
4170  *                 elif t == NPY_ULONG:       f = "L"
4171  *                 elif t == NPY_LONGLONG:    f = "q"
4172  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
4173  *                 elif t == NPY_FLOAT:       f = "f"
4174  *                 elif t == NPY_DOUBLE:      f = "d"
4175  */
4176       __pyx_v_f = ((char *)"Q");
4177       break;
4178       case NPY_FLOAT:
4179 
4180       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
4181  *                 elif t == NPY_LONGLONG:    f = "q"
4182  *                 elif t == NPY_ULONGLONG:   f = "Q"
4183  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
4184  *                 elif t == NPY_DOUBLE:      f = "d"
4185  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4186  */
4187       __pyx_v_f = ((char *)"f");
4188       break;
4189       case NPY_DOUBLE:
4190 
4191       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
4192  *                 elif t == NPY_ULONGLONG:   f = "Q"
4193  *                 elif t == NPY_FLOAT:       f = "f"
4194  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
4195  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4196  *                 elif t == NPY_CFLOAT:      f = "Zf"
4197  */
4198       __pyx_v_f = ((char *)"d");
4199       break;
4200       case NPY_LONGDOUBLE:
4201 
4202       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
4203  *                 elif t == NPY_FLOAT:       f = "f"
4204  *                 elif t == NPY_DOUBLE:      f = "d"
4205  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
4206  *                 elif t == NPY_CFLOAT:      f = "Zf"
4207  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4208  */
4209       __pyx_v_f = ((char *)"g");
4210       break;
4211       case NPY_CFLOAT:
4212 
4213       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
4214  *                 elif t == NPY_DOUBLE:      f = "d"
4215  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4216  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
4217  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4218  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4219  */
4220       __pyx_v_f = ((char *)"Zf");
4221       break;
4222       case NPY_CDOUBLE:
4223 
4224       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
4225  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4226  *                 elif t == NPY_CFLOAT:      f = "Zf"
4227  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
4228  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4229  *                 elif t == NPY_OBJECT:      f = "O"
4230  */
4231       __pyx_v_f = ((char *)"Zd");
4232       break;
4233       case NPY_CLONGDOUBLE:
4234 
4235       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
4236  *                 elif t == NPY_CFLOAT:      f = "Zf"
4237  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4238  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
4239  *                 elif t == NPY_OBJECT:      f = "O"
4240  *                 else:
4241  */
4242       __pyx_v_f = ((char *)"Zg");
4243       break;
4244       case NPY_OBJECT:
4245 
4246       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
4247  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4248  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4249  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
4250  *                 else:
4251  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4252  */
4253       __pyx_v_f = ((char *)"O");
4254       break;
4255       default:
4256 
4257       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
4258  *                 elif t == NPY_OBJECT:      f = "O"
4259  *                 else:
4260  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
4261  *                 info.format = f
4262  *                 return
4263  */
4264       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
4265       __Pyx_GOTREF(__pyx_t_3);
4266       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
4267       __Pyx_GOTREF(__pyx_t_8);
4268       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4269       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
4270       __Pyx_GOTREF(__pyx_t_3);
4271       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4272       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4273       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4274       __PYX_ERR(1, 325, __pyx_L1_error)
4275       break;
4276     }
4277 
4278     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
4279  *                 else:
4280  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4281  *                 info.format = f             # <<<<<<<<<<<<<<
4282  *                 return
4283  *             else:
4284  */
4285     __pyx_v_info->format = __pyx_v_f;
4286 
4287     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
4288  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4289  *                 info.format = f
4290  *                 return             # <<<<<<<<<<<<<<
4291  *             else:
4292  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4293  */
4294     __pyx_r = 0;
4295     goto __pyx_L0;
4296 
4297     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
4298  *             info.obj = self
4299  *
4300  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
4301  *                 t = descr.type_num
4302  *                 if ((descr.byteorder == c'>' and little_endian) or
4303  */
4304   }
4305 
4306   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
4307  *                 return
4308  *             else:
4309  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
4310  *                 info.format[0] = c'^' # Native data types, manual alignment
4311  *                 offset = 0
4312  */
4313   /*else*/ {
4314     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
4315 
4316     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
4317  *             else:
4318  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4319  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
4320  *                 offset = 0
4321  *                 f = _util_dtypestring(descr, info.format + 1,
4322  */
4323     (__pyx_v_info->format[0]) = '^';
4324 
4325     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
4326  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4327  *                 info.format[0] = c'^' # Native data types, manual alignment
4328  *                 offset = 0             # <<<<<<<<<<<<<<
4329  *                 f = _util_dtypestring(descr, info.format + 1,
4330  *                                       info.format + _buffer_format_string_len,
4331  */
4332     __pyx_v_offset = 0;
4333 
4334     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
4335  *                 info.format[0] = c'^' # Native data types, manual alignment
4336  *                 offset = 0
4337  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
4338  *                                       info.format + _buffer_format_string_len,
4339  *                                       &offset)
4340  */
4341     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
4342     __pyx_v_f = __pyx_t_9;
4343 
4344     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
4345  *                                       info.format + _buffer_format_string_len,
4346  *                                       &offset)
4347  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
4348  *
4349  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4350  */
4351     (__pyx_v_f[0]) = '\x00';
4352   }
4353 
4354   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
4355  *         # experimental exception made for __getbuffer__ and __releasebuffer__
4356  *         # -- the details of this may change.
4357  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
4358  *             # This implementation of getbuffer is geared towards Cython
4359  *             # requirements, and does not yet fulfill the PEP.
4360  */
4361 
4362   /* function exit code */
4363   __pyx_r = 0;
4364   goto __pyx_L0;
4365   __pyx_L1_error:;
4366   __Pyx_XDECREF(__pyx_t_3);
4367   __Pyx_XDECREF(__pyx_t_8);
4368   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4369   __pyx_r = -1;
4370   if (__pyx_v_info->obj != NULL) {
4371     __Pyx_GOTREF(__pyx_v_info->obj);
4372     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4373   }
4374   goto __pyx_L2;
4375   __pyx_L0:;
4376   if (__pyx_v_info->obj == Py_None) {
4377     __Pyx_GOTREF(__pyx_v_info->obj);
4378     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4379   }
4380   __pyx_L2:;
4381   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4382   __Pyx_RefNannyFinishContext();
4383   return __pyx_r;
4384 }
4385 
4386 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
4387  *                 f[0] = c'\0' # Terminate format string
4388  *
4389  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4390  *             if PyArray_HASFIELDS(self):
4391  *                 PyObject_Free(info.format)
4392  */
4393 
4394 /* Python wrapper */
4395 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)4396 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4397   __Pyx_RefNannyDeclarations
4398   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4399   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4400 
4401   /* function exit code */
4402   __Pyx_RefNannyFinishContext();
4403 }
4404 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)4405 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4406   __Pyx_RefNannyDeclarations
4407   int __pyx_t_1;
4408   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4409 
4410   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
4411  *
4412  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4413  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4414  *                 PyObject_Free(info.format)
4415  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4416  */
4417   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4418   if (__pyx_t_1) {
4419 
4420     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
4421  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4422  *             if PyArray_HASFIELDS(self):
4423  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
4424  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4425  *                 PyObject_Free(info.strides)
4426  */
4427     PyObject_Free(__pyx_v_info->format);
4428 
4429     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
4430  *
4431  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4432  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4433  *                 PyObject_Free(info.format)
4434  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4435  */
4436   }
4437 
4438   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
4439  *             if PyArray_HASFIELDS(self):
4440  *                 PyObject_Free(info.format)
4441  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4442  *                 PyObject_Free(info.strides)
4443  *                 # info.shape was stored after info.strides in the same block
4444  */
4445   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4446   if (__pyx_t_1) {
4447 
4448     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
4449  *                 PyObject_Free(info.format)
4450  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4451  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
4452  *                 # info.shape was stored after info.strides in the same block
4453  *
4454  */
4455     PyObject_Free(__pyx_v_info->strides);
4456 
4457     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
4458  *             if PyArray_HASFIELDS(self):
4459  *                 PyObject_Free(info.format)
4460  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4461  *                 PyObject_Free(info.strides)
4462  *                 # info.shape was stored after info.strides in the same block
4463  */
4464   }
4465 
4466   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
4467  *                 f[0] = c'\0' # Terminate format string
4468  *
4469  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4470  *             if PyArray_HASFIELDS(self):
4471  *                 PyObject_Free(info.format)
4472  */
4473 
4474   /* function exit code */
4475   __Pyx_RefNannyFinishContext();
4476 }
4477 
4478 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
4479  * ctypedef npy_cdouble     complex_t
4480  *
4481  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
4482  *     return PyArray_MultiIterNew(1, <void*>a)
4483  *
4484  */
4485 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)4486 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4487   PyObject *__pyx_r = NULL;
4488   __Pyx_RefNannyDeclarations
4489   PyObject *__pyx_t_1 = NULL;
4490   int __pyx_lineno = 0;
4491   const char *__pyx_filename = NULL;
4492   int __pyx_clineno = 0;
4493   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4494 
4495   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
4496  *
4497  * cdef inline object PyArray_MultiIterNew1(a):
4498  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
4499  *
4500  * cdef inline object PyArray_MultiIterNew2(a, b):
4501  */
4502   __Pyx_XDECREF(__pyx_r);
4503   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 821, __pyx_L1_error)
4504   __Pyx_GOTREF(__pyx_t_1);
4505   __pyx_r = __pyx_t_1;
4506   __pyx_t_1 = 0;
4507   goto __pyx_L0;
4508 
4509   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
4510  * ctypedef npy_cdouble     complex_t
4511  *
4512  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
4513  *     return PyArray_MultiIterNew(1, <void*>a)
4514  *
4515  */
4516 
4517   /* function exit code */
4518   __pyx_L1_error:;
4519   __Pyx_XDECREF(__pyx_t_1);
4520   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4521   __pyx_r = 0;
4522   __pyx_L0:;
4523   __Pyx_XGIVEREF(__pyx_r);
4524   __Pyx_RefNannyFinishContext();
4525   return __pyx_r;
4526 }
4527 
4528 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
4529  *     return PyArray_MultiIterNew(1, <void*>a)
4530  *
4531  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
4532  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4533  *
4534  */
4535 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)4536 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4537   PyObject *__pyx_r = NULL;
4538   __Pyx_RefNannyDeclarations
4539   PyObject *__pyx_t_1 = NULL;
4540   int __pyx_lineno = 0;
4541   const char *__pyx_filename = NULL;
4542   int __pyx_clineno = 0;
4543   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4544 
4545   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
4546  *
4547  * cdef inline object PyArray_MultiIterNew2(a, b):
4548  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
4549  *
4550  * cdef inline object PyArray_MultiIterNew3(a, b, c):
4551  */
4552   __Pyx_XDECREF(__pyx_r);
4553   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 824, __pyx_L1_error)
4554   __Pyx_GOTREF(__pyx_t_1);
4555   __pyx_r = __pyx_t_1;
4556   __pyx_t_1 = 0;
4557   goto __pyx_L0;
4558 
4559   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
4560  *     return PyArray_MultiIterNew(1, <void*>a)
4561  *
4562  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
4563  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4564  *
4565  */
4566 
4567   /* function exit code */
4568   __pyx_L1_error:;
4569   __Pyx_XDECREF(__pyx_t_1);
4570   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4571   __pyx_r = 0;
4572   __pyx_L0:;
4573   __Pyx_XGIVEREF(__pyx_r);
4574   __Pyx_RefNannyFinishContext();
4575   return __pyx_r;
4576 }
4577 
4578 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
4579  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4580  *
4581  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
4582  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4583  *
4584  */
4585 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)4586 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4587   PyObject *__pyx_r = NULL;
4588   __Pyx_RefNannyDeclarations
4589   PyObject *__pyx_t_1 = NULL;
4590   int __pyx_lineno = 0;
4591   const char *__pyx_filename = NULL;
4592   int __pyx_clineno = 0;
4593   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4594 
4595   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
4596  *
4597  * cdef inline object PyArray_MultiIterNew3(a, b, c):
4598  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
4599  *
4600  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4601  */
4602   __Pyx_XDECREF(__pyx_r);
4603   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 827, __pyx_L1_error)
4604   __Pyx_GOTREF(__pyx_t_1);
4605   __pyx_r = __pyx_t_1;
4606   __pyx_t_1 = 0;
4607   goto __pyx_L0;
4608 
4609   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
4610  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4611  *
4612  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
4613  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4614  *
4615  */
4616 
4617   /* function exit code */
4618   __pyx_L1_error:;
4619   __Pyx_XDECREF(__pyx_t_1);
4620   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4621   __pyx_r = 0;
4622   __pyx_L0:;
4623   __Pyx_XGIVEREF(__pyx_r);
4624   __Pyx_RefNannyFinishContext();
4625   return __pyx_r;
4626 }
4627 
4628 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
4629  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4630  *
4631  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
4632  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4633  *
4634  */
4635 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)4636 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4637   PyObject *__pyx_r = NULL;
4638   __Pyx_RefNannyDeclarations
4639   PyObject *__pyx_t_1 = NULL;
4640   int __pyx_lineno = 0;
4641   const char *__pyx_filename = NULL;
4642   int __pyx_clineno = 0;
4643   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4644 
4645   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
4646  *
4647  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4648  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
4649  *
4650  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4651  */
4652   __Pyx_XDECREF(__pyx_r);
4653   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 830, __pyx_L1_error)
4654   __Pyx_GOTREF(__pyx_t_1);
4655   __pyx_r = __pyx_t_1;
4656   __pyx_t_1 = 0;
4657   goto __pyx_L0;
4658 
4659   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
4660  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4661  *
4662  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
4663  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4664  *
4665  */
4666 
4667   /* function exit code */
4668   __pyx_L1_error:;
4669   __Pyx_XDECREF(__pyx_t_1);
4670   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4671   __pyx_r = 0;
4672   __pyx_L0:;
4673   __Pyx_XGIVEREF(__pyx_r);
4674   __Pyx_RefNannyFinishContext();
4675   return __pyx_r;
4676 }
4677 
4678 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
4679  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4680  *
4681  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
4682  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4683  *
4684  */
4685 
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)4686 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
4687   PyObject *__pyx_r = NULL;
4688   __Pyx_RefNannyDeclarations
4689   PyObject *__pyx_t_1 = NULL;
4690   int __pyx_lineno = 0;
4691   const char *__pyx_filename = NULL;
4692   int __pyx_clineno = 0;
4693   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4694 
4695   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
4696  *
4697  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4698  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
4699  *
4700  * cdef inline tuple PyDataType_SHAPE(dtype d):
4701  */
4702   __Pyx_XDECREF(__pyx_r);
4703   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 833, __pyx_L1_error)
4704   __Pyx_GOTREF(__pyx_t_1);
4705   __pyx_r = __pyx_t_1;
4706   __pyx_t_1 = 0;
4707   goto __pyx_L0;
4708 
4709   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
4710  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4711  *
4712  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
4713  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4714  *
4715  */
4716 
4717   /* function exit code */
4718   __pyx_L1_error:;
4719   __Pyx_XDECREF(__pyx_t_1);
4720   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4721   __pyx_r = 0;
4722   __pyx_L0:;
4723   __Pyx_XGIVEREF(__pyx_r);
4724   __Pyx_RefNannyFinishContext();
4725   return __pyx_r;
4726 }
4727 
4728 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
4729  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4730  *
4731  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
4732  *     if PyDataType_HASSUBARRAY(d):
4733  *         return <tuple>d.subarray.shape
4734  */
4735 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)4736 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4737   PyObject *__pyx_r = NULL;
4738   __Pyx_RefNannyDeclarations
4739   int __pyx_t_1;
4740   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
4741 
4742   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
4743  *
4744  * cdef inline tuple PyDataType_SHAPE(dtype d):
4745  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
4746  *         return <tuple>d.subarray.shape
4747  *     else:
4748  */
4749   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4750   if (__pyx_t_1) {
4751 
4752     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
4753  * cdef inline tuple PyDataType_SHAPE(dtype d):
4754  *     if PyDataType_HASSUBARRAY(d):
4755  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
4756  *     else:
4757  *         return ()
4758  */
4759     __Pyx_XDECREF(__pyx_r);
4760     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4761     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4762     goto __pyx_L0;
4763 
4764     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
4765  *
4766  * cdef inline tuple PyDataType_SHAPE(dtype d):
4767  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
4768  *         return <tuple>d.subarray.shape
4769  *     else:
4770  */
4771   }
4772 
4773   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
4774  *         return <tuple>d.subarray.shape
4775  *     else:
4776  *         return ()             # <<<<<<<<<<<<<<
4777  *
4778  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
4779  */
4780   /*else*/ {
4781     __Pyx_XDECREF(__pyx_r);
4782     __Pyx_INCREF(__pyx_empty_tuple);
4783     __pyx_r = __pyx_empty_tuple;
4784     goto __pyx_L0;
4785   }
4786 
4787   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
4788  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4789  *
4790  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
4791  *     if PyDataType_HASSUBARRAY(d):
4792  *         return <tuple>d.subarray.shape
4793  */
4794 
4795   /* function exit code */
4796   __pyx_L0:;
4797   __Pyx_XGIVEREF(__pyx_r);
4798   __Pyx_RefNannyFinishContext();
4799   return __pyx_r;
4800 }
4801 
4802 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
4803  *         return ()
4804  *
4805  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
4806  *     # Recursive utility function used in __getbuffer__ to get format
4807  *     # string. The new location in the format string is returned.
4808  */
4809 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)4810 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
4811   PyArray_Descr *__pyx_v_child = 0;
4812   int __pyx_v_endian_detector;
4813   int __pyx_v_little_endian;
4814   PyObject *__pyx_v_fields = 0;
4815   PyObject *__pyx_v_childname = NULL;
4816   PyObject *__pyx_v_new_offset = NULL;
4817   PyObject *__pyx_v_t = NULL;
4818   char *__pyx_r;
4819   __Pyx_RefNannyDeclarations
4820   PyObject *__pyx_t_1 = NULL;
4821   Py_ssize_t __pyx_t_2;
4822   PyObject *__pyx_t_3 = NULL;
4823   PyObject *__pyx_t_4 = NULL;
4824   int __pyx_t_5;
4825   int __pyx_t_6;
4826   int __pyx_t_7;
4827   long __pyx_t_8;
4828   char *__pyx_t_9;
4829   int __pyx_lineno = 0;
4830   const char *__pyx_filename = NULL;
4831   int __pyx_clineno = 0;
4832   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
4833 
4834   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":846
4835  *
4836  *     cdef dtype child
4837  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
4838  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4839  *     cdef tuple fields
4840  */
4841   __pyx_v_endian_detector = 1;
4842 
4843   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
4844  *     cdef dtype child
4845  *     cdef int endian_detector = 1
4846  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
4847  *     cdef tuple fields
4848  *
4849  */
4850   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4851 
4852   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
4853  *     cdef tuple fields
4854  *
4855  *     for childname in descr.names:             # <<<<<<<<<<<<<<
4856  *         fields = descr.fields[childname]
4857  *         child, new_offset = fields
4858  */
4859   if (unlikely(__pyx_v_descr->names == Py_None)) {
4860     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4861     __PYX_ERR(1, 850, __pyx_L1_error)
4862   }
4863   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4864   for (;;) {
4865     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4866     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4867     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 850, __pyx_L1_error)
4868     #else
4869     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error)
4870     __Pyx_GOTREF(__pyx_t_3);
4871     #endif
4872     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
4873     __pyx_t_3 = 0;
4874 
4875     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
4876  *
4877  *     for childname in descr.names:
4878  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
4879  *         child, new_offset = fields
4880  *
4881  */
4882     if (unlikely(__pyx_v_descr->fields == Py_None)) {
4883       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4884       __PYX_ERR(1, 851, __pyx_L1_error)
4885     }
4886     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
4887     __Pyx_GOTREF(__pyx_t_3);
4888     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 851, __pyx_L1_error)
4889     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
4890     __pyx_t_3 = 0;
4891 
4892     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
4893  *     for childname in descr.names:
4894  *         fields = descr.fields[childname]
4895  *         child, new_offset = fields             # <<<<<<<<<<<<<<
4896  *
4897  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
4898  */
4899     if (likely(__pyx_v_fields != Py_None)) {
4900       PyObject* sequence = __pyx_v_fields;
4901       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4902       if (unlikely(size != 2)) {
4903         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4904         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4905         __PYX_ERR(1, 852, __pyx_L1_error)
4906       }
4907       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4908       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
4909       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
4910       __Pyx_INCREF(__pyx_t_3);
4911       __Pyx_INCREF(__pyx_t_4);
4912       #else
4913       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
4914       __Pyx_GOTREF(__pyx_t_3);
4915       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error)
4916       __Pyx_GOTREF(__pyx_t_4);
4917       #endif
4918     } else {
4919       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 852, __pyx_L1_error)
4920     }
4921     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 852, __pyx_L1_error)
4922     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
4923     __pyx_t_3 = 0;
4924     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
4925     __pyx_t_4 = 0;
4926 
4927     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":854
4928  *         child, new_offset = fields
4929  *
4930  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
4931  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4932  *
4933  */
4934     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 854, __pyx_L1_error)
4935     __Pyx_GOTREF(__pyx_t_4);
4936     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 854, __pyx_L1_error)
4937     __Pyx_GOTREF(__pyx_t_3);
4938     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4939     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 854, __pyx_L1_error)
4940     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4941     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
4942     if (unlikely(__pyx_t_6)) {
4943 
4944       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
4945  *
4946  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
4947  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
4948  *
4949  *         if ((child.byteorder == c'>' and little_endian) or
4950  */
4951       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
4952       __Pyx_GOTREF(__pyx_t_3);
4953       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4954       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4955       __PYX_ERR(1, 855, __pyx_L1_error)
4956 
4957       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":854
4958  *         child, new_offset = fields
4959  *
4960  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
4961  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4962  *
4963  */
4964     }
4965 
4966     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":857
4967  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4968  *
4969  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4970  *             (child.byteorder == c'<' and not little_endian)):
4971  *             raise ValueError(u"Non-native byte order not supported")
4972  */
4973     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
4974     if (!__pyx_t_7) {
4975       goto __pyx_L8_next_or;
4976     } else {
4977     }
4978     __pyx_t_7 = (__pyx_v_little_endian != 0);
4979     if (!__pyx_t_7) {
4980     } else {
4981       __pyx_t_6 = __pyx_t_7;
4982       goto __pyx_L7_bool_binop_done;
4983     }
4984     __pyx_L8_next_or:;
4985 
4986     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
4987  *
4988  *         if ((child.byteorder == c'>' and little_endian) or
4989  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
4990  *             raise ValueError(u"Non-native byte order not supported")
4991  *             # One could encode it in the format string and have Cython
4992  */
4993     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
4994     if (__pyx_t_7) {
4995     } else {
4996       __pyx_t_6 = __pyx_t_7;
4997       goto __pyx_L7_bool_binop_done;
4998     }
4999     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
5000     __pyx_t_6 = __pyx_t_7;
5001     __pyx_L7_bool_binop_done:;
5002 
5003     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":857
5004  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5005  *
5006  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
5007  *             (child.byteorder == c'<' and not little_endian)):
5008  *             raise ValueError(u"Non-native byte order not supported")
5009  */
5010     if (unlikely(__pyx_t_6)) {
5011 
5012       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
5013  *         if ((child.byteorder == c'>' and little_endian) or
5014  *             (child.byteorder == c'<' and not little_endian)):
5015  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
5016  *             # One could encode it in the format string and have Cython
5017  *             # complain instead, BUT: < and > in format strings also imply
5018  */
5019       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 859, __pyx_L1_error)
5020       __Pyx_GOTREF(__pyx_t_3);
5021       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5022       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5023       __PYX_ERR(1, 859, __pyx_L1_error)
5024 
5025       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":857
5026  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5027  *
5028  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
5029  *             (child.byteorder == c'<' and not little_endian)):
5030  *             raise ValueError(u"Non-native byte order not supported")
5031  */
5032     }
5033 
5034     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":869
5035  *
5036  *         # Output padding bytes
5037  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
5038  *             f[0] = 120 # "x"; pad byte
5039  *             f += 1
5040  */
5041     while (1) {
5042       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 869, __pyx_L1_error)
5043       __Pyx_GOTREF(__pyx_t_3);
5044       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 869, __pyx_L1_error)
5045       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5046       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 869, __pyx_L1_error)
5047       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5048       if (!__pyx_t_6) break;
5049 
5050       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
5051  *         # Output padding bytes
5052  *         while offset[0] < new_offset:
5053  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
5054  *             f += 1
5055  *             offset[0] += 1
5056  */
5057       (__pyx_v_f[0]) = 0x78;
5058 
5059       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
5060  *         while offset[0] < new_offset:
5061  *             f[0] = 120 # "x"; pad byte
5062  *             f += 1             # <<<<<<<<<<<<<<
5063  *             offset[0] += 1
5064  *
5065  */
5066       __pyx_v_f = (__pyx_v_f + 1);
5067 
5068       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
5069  *             f[0] = 120 # "x"; pad byte
5070  *             f += 1
5071  *             offset[0] += 1             # <<<<<<<<<<<<<<
5072  *
5073  *         offset[0] += child.itemsize
5074  */
5075       __pyx_t_8 = 0;
5076       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
5077     }
5078 
5079     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":874
5080  *             offset[0] += 1
5081  *
5082  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
5083  *
5084  *         if not PyDataType_HASFIELDS(child):
5085  */
5086     __pyx_t_8 = 0;
5087     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
5088 
5089     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":876
5090  *         offset[0] += child.itemsize
5091  *
5092  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
5093  *             t = child.type_num
5094  *             if end - f < 5:
5095  */
5096     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
5097     if (__pyx_t_6) {
5098 
5099       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
5100  *
5101  *         if not PyDataType_HASFIELDS(child):
5102  *             t = child.type_num             # <<<<<<<<<<<<<<
5103  *             if end - f < 5:
5104  *                 raise RuntimeError(u"Format string allocated too short.")
5105  */
5106       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 877, __pyx_L1_error)
5107       __Pyx_GOTREF(__pyx_t_4);
5108       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
5109       __pyx_t_4 = 0;
5110 
5111       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
5112  *         if not PyDataType_HASFIELDS(child):
5113  *             t = child.type_num
5114  *             if end - f < 5:             # <<<<<<<<<<<<<<
5115  *                 raise RuntimeError(u"Format string allocated too short.")
5116  *
5117  */
5118       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
5119       if (unlikely(__pyx_t_6)) {
5120 
5121         /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
5122  *             t = child.type_num
5123  *             if end - f < 5:
5124  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
5125  *
5126  *             # Until ticket #99 is fixed, use integers to avoid warnings
5127  */
5128         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 879, __pyx_L1_error)
5129         __Pyx_GOTREF(__pyx_t_4);
5130         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5131         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5132         __PYX_ERR(1, 879, __pyx_L1_error)
5133 
5134         /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
5135  *         if not PyDataType_HASFIELDS(child):
5136  *             t = child.type_num
5137  *             if end - f < 5:             # <<<<<<<<<<<<<<
5138  *                 raise RuntimeError(u"Format string allocated too short.")
5139  *
5140  */
5141       }
5142 
5143       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":882
5144  *
5145  *             # Until ticket #99 is fixed, use integers to avoid warnings
5146  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
5147  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5148  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5149  */
5150       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 882, __pyx_L1_error)
5151       __Pyx_GOTREF(__pyx_t_4);
5152       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 882, __pyx_L1_error)
5153       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5154       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 882, __pyx_L1_error)
5155       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5156       if (__pyx_t_6) {
5157         (__pyx_v_f[0]) = 98;
5158         goto __pyx_L15;
5159       }
5160 
5161       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
5162  *             # Until ticket #99 is fixed, use integers to avoid warnings
5163  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
5164  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
5165  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5166  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5167  */
5168       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
5169       __Pyx_GOTREF(__pyx_t_3);
5170       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
5171       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5172       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
5173       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5174       if (__pyx_t_6) {
5175         (__pyx_v_f[0]) = 66;
5176         goto __pyx_L15;
5177       }
5178 
5179       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
5180  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
5181  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5182  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
5183  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5184  *             elif t == NPY_INT:         f[0] = 105 #"i"
5185  */
5186       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
5187       __Pyx_GOTREF(__pyx_t_4);
5188       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
5189       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5190       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
5191       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5192       if (__pyx_t_6) {
5193         (__pyx_v_f[0]) = 0x68;
5194         goto __pyx_L15;
5195       }
5196 
5197       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
5198  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5199  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5200  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
5201  *             elif t == NPY_INT:         f[0] = 105 #"i"
5202  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5203  */
5204       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
5205       __Pyx_GOTREF(__pyx_t_3);
5206       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
5207       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5208       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
5209       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5210       if (__pyx_t_6) {
5211         (__pyx_v_f[0]) = 72;
5212         goto __pyx_L15;
5213       }
5214 
5215       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
5216  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5217  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5218  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
5219  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5220  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5221  */
5222       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
5223       __Pyx_GOTREF(__pyx_t_4);
5224       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
5225       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5226       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
5227       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5228       if (__pyx_t_6) {
5229         (__pyx_v_f[0]) = 0x69;
5230         goto __pyx_L15;
5231       }
5232 
5233       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
5234  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5235  *             elif t == NPY_INT:         f[0] = 105 #"i"
5236  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
5237  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5238  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5239  */
5240       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
5241       __Pyx_GOTREF(__pyx_t_3);
5242       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
5243       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5244       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
5245       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5246       if (__pyx_t_6) {
5247         (__pyx_v_f[0]) = 73;
5248         goto __pyx_L15;
5249       }
5250 
5251       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
5252  *             elif t == NPY_INT:         f[0] = 105 #"i"
5253  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5254  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
5255  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5256  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5257  */
5258       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
5259       __Pyx_GOTREF(__pyx_t_4);
5260       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
5261       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5262       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
5263       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5264       if (__pyx_t_6) {
5265         (__pyx_v_f[0]) = 0x6C;
5266         goto __pyx_L15;
5267       }
5268 
5269       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
5270  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5271  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5272  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
5273  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5274  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5275  */
5276       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
5277       __Pyx_GOTREF(__pyx_t_3);
5278       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
5279       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5280       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
5281       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5282       if (__pyx_t_6) {
5283         (__pyx_v_f[0]) = 76;
5284         goto __pyx_L15;
5285       }
5286 
5287       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
5288  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5289  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5290  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
5291  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5292  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5293  */
5294       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
5295       __Pyx_GOTREF(__pyx_t_4);
5296       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
5297       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5298       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
5299       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5300       if (__pyx_t_6) {
5301         (__pyx_v_f[0]) = 0x71;
5302         goto __pyx_L15;
5303       }
5304 
5305       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
5306  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5307  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5308  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
5309  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5310  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5311  */
5312       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
5313       __Pyx_GOTREF(__pyx_t_3);
5314       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
5315       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5316       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
5317       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5318       if (__pyx_t_6) {
5319         (__pyx_v_f[0]) = 81;
5320         goto __pyx_L15;
5321       }
5322 
5323       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
5324  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5325  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5326  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
5327  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5328  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5329  */
5330       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
5331       __Pyx_GOTREF(__pyx_t_4);
5332       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
5333       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5334       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
5335       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5336       if (__pyx_t_6) {
5337         (__pyx_v_f[0]) = 0x66;
5338         goto __pyx_L15;
5339       }
5340 
5341       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
5342  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5343  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5344  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
5345  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5346  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5347  */
5348       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
5349       __Pyx_GOTREF(__pyx_t_3);
5350       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
5351       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5352       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
5353       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5354       if (__pyx_t_6) {
5355         (__pyx_v_f[0]) = 0x64;
5356         goto __pyx_L15;
5357       }
5358 
5359       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
5360  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5361  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5362  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
5363  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5364  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5365  */
5366       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
5367       __Pyx_GOTREF(__pyx_t_4);
5368       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
5369       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5370       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
5371       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5372       if (__pyx_t_6) {
5373         (__pyx_v_f[0]) = 0x67;
5374         goto __pyx_L15;
5375       }
5376 
5377       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
5378  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5379  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5380  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
5381  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5382  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5383  */
5384       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
5385       __Pyx_GOTREF(__pyx_t_3);
5386       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
5387       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5388       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
5389       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5390       if (__pyx_t_6) {
5391         (__pyx_v_f[0]) = 90;
5392         (__pyx_v_f[1]) = 0x66;
5393         __pyx_v_f = (__pyx_v_f + 1);
5394         goto __pyx_L15;
5395       }
5396 
5397       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
5398  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5399  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5400  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
5401  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5402  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5403  */
5404       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
5405       __Pyx_GOTREF(__pyx_t_4);
5406       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
5407       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5408       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
5409       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5410       if (__pyx_t_6) {
5411         (__pyx_v_f[0]) = 90;
5412         (__pyx_v_f[1]) = 0x64;
5413         __pyx_v_f = (__pyx_v_f + 1);
5414         goto __pyx_L15;
5415       }
5416 
5417       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
5418  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5419  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5420  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
5421  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5422  *             else:
5423  */
5424       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
5425       __Pyx_GOTREF(__pyx_t_3);
5426       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
5427       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5428       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
5429       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5430       if (__pyx_t_6) {
5431         (__pyx_v_f[0]) = 90;
5432         (__pyx_v_f[1]) = 0x67;
5433         __pyx_v_f = (__pyx_v_f + 1);
5434         goto __pyx_L15;
5435       }
5436 
5437       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
5438  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5439  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5440  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
5441  *             else:
5442  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5443  */
5444       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
5445       __Pyx_GOTREF(__pyx_t_4);
5446       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
5447       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5448       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
5449       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5450       if (likely(__pyx_t_6)) {
5451         (__pyx_v_f[0]) = 79;
5452         goto __pyx_L15;
5453       }
5454 
5455       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":900
5456  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5457  *             else:
5458  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
5459  *             f += 1
5460  *         else:
5461  */
5462       /*else*/ {
5463         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 900, __pyx_L1_error)
5464         __Pyx_GOTREF(__pyx_t_3);
5465         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 900, __pyx_L1_error)
5466         __Pyx_GOTREF(__pyx_t_4);
5467         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5468         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5469         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5470         __PYX_ERR(1, 900, __pyx_L1_error)
5471       }
5472       __pyx_L15:;
5473 
5474       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
5475  *             else:
5476  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5477  *             f += 1             # <<<<<<<<<<<<<<
5478  *         else:
5479  *             # Cython ignores struct boundary information ("T{...}"),
5480  */
5481       __pyx_v_f = (__pyx_v_f + 1);
5482 
5483       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":876
5484  *         offset[0] += child.itemsize
5485  *
5486  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
5487  *             t = child.type_num
5488  *             if end - f < 5:
5489  */
5490       goto __pyx_L13;
5491     }
5492 
5493     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":905
5494  *             # Cython ignores struct boundary information ("T{...}"),
5495  *             # so don't output it
5496  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
5497  *     return f
5498  *
5499  */
5500     /*else*/ {
5501       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 905, __pyx_L1_error)
5502       __pyx_v_f = __pyx_t_9;
5503     }
5504     __pyx_L13:;
5505 
5506     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
5507  *     cdef tuple fields
5508  *
5509  *     for childname in descr.names:             # <<<<<<<<<<<<<<
5510  *         fields = descr.fields[childname]
5511  *         child, new_offset = fields
5512  */
5513   }
5514   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5515 
5516   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
5517  *             # so don't output it
5518  *             f = _util_dtypestring(child, f, end, offset)
5519  *     return f             # <<<<<<<<<<<<<<
5520  *
5521  *
5522  */
5523   __pyx_r = __pyx_v_f;
5524   goto __pyx_L0;
5525 
5526   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
5527  *         return ()
5528  *
5529  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
5530  *     # Recursive utility function used in __getbuffer__ to get format
5531  *     # string. The new location in the format string is returned.
5532  */
5533 
5534   /* function exit code */
5535   __pyx_L1_error:;
5536   __Pyx_XDECREF(__pyx_t_1);
5537   __Pyx_XDECREF(__pyx_t_3);
5538   __Pyx_XDECREF(__pyx_t_4);
5539   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
5540   __pyx_r = NULL;
5541   __pyx_L0:;
5542   __Pyx_XDECREF((PyObject *)__pyx_v_child);
5543   __Pyx_XDECREF(__pyx_v_fields);
5544   __Pyx_XDECREF(__pyx_v_childname);
5545   __Pyx_XDECREF(__pyx_v_new_offset);
5546   __Pyx_XDECREF(__pyx_v_t);
5547   __Pyx_RefNannyFinishContext();
5548   return __pyx_r;
5549 }
5550 
5551 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1021
5552  *     int _import_umath() except -1
5553  *
5554  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
5555  *     Py_INCREF(base) # important to do this before stealing the reference below!
5556  *     PyArray_SetBaseObject(arr, base)
5557  */
5558 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)5559 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5560   __Pyx_RefNannyDeclarations
5561   __Pyx_RefNannySetupContext("set_array_base", 0);
5562 
5563   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
5564  *
5565  * cdef inline void set_array_base(ndarray arr, object base):
5566  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
5567  *     PyArray_SetBaseObject(arr, base)
5568  *
5569  */
5570   Py_INCREF(__pyx_v_base);
5571 
5572   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
5573  * cdef inline void set_array_base(ndarray arr, object base):
5574  *     Py_INCREF(base) # important to do this before stealing the reference below!
5575  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
5576  *
5577  * cdef inline object get_array_base(ndarray arr):
5578  */
5579   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5580 
5581   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1021
5582  *     int _import_umath() except -1
5583  *
5584  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
5585  *     Py_INCREF(base) # important to do this before stealing the reference below!
5586  *     PyArray_SetBaseObject(arr, base)
5587  */
5588 
5589   /* function exit code */
5590   __Pyx_RefNannyFinishContext();
5591 }
5592 
5593 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1025
5594  *     PyArray_SetBaseObject(arr, base)
5595  *
5596  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
5597  *     base = PyArray_BASE(arr)
5598  *     if base is NULL:
5599  */
5600 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)5601 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5602   PyObject *__pyx_v_base;
5603   PyObject *__pyx_r = NULL;
5604   __Pyx_RefNannyDeclarations
5605   int __pyx_t_1;
5606   __Pyx_RefNannySetupContext("get_array_base", 0);
5607 
5608   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
5609  *
5610  * cdef inline object get_array_base(ndarray arr):
5611  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
5612  *     if base is NULL:
5613  *         return None
5614  */
5615   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5616 
5617   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
5618  * cdef inline object get_array_base(ndarray arr):
5619  *     base = PyArray_BASE(arr)
5620  *     if base is NULL:             # <<<<<<<<<<<<<<
5621  *         return None
5622  *     return <object>base
5623  */
5624   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5625   if (__pyx_t_1) {
5626 
5627     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
5628  *     base = PyArray_BASE(arr)
5629  *     if base is NULL:
5630  *         return None             # <<<<<<<<<<<<<<
5631  *     return <object>base
5632  *
5633  */
5634     __Pyx_XDECREF(__pyx_r);
5635     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5636     goto __pyx_L0;
5637 
5638     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
5639  * cdef inline object get_array_base(ndarray arr):
5640  *     base = PyArray_BASE(arr)
5641  *     if base is NULL:             # <<<<<<<<<<<<<<
5642  *         return None
5643  *     return <object>base
5644  */
5645   }
5646 
5647   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
5648  *     if base is NULL:
5649  *         return None
5650  *     return <object>base             # <<<<<<<<<<<<<<
5651  *
5652  * # Versions of the import_* functions which are more suitable for
5653  */
5654   __Pyx_XDECREF(__pyx_r);
5655   __Pyx_INCREF(((PyObject *)__pyx_v_base));
5656   __pyx_r = ((PyObject *)__pyx_v_base);
5657   goto __pyx_L0;
5658 
5659   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1025
5660  *     PyArray_SetBaseObject(arr, base)
5661  *
5662  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
5663  *     base = PyArray_BASE(arr)
5664  *     if base is NULL:
5665  */
5666 
5667   /* function exit code */
5668   __pyx_L0:;
5669   __Pyx_XGIVEREF(__pyx_r);
5670   __Pyx_RefNannyFinishContext();
5671   return __pyx_r;
5672 }
5673 
5674 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1033
5675  * # Versions of the import_* functions which are more suitable for
5676  * # Cython code.
5677  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
5678  *     try:
5679  *         _import_array()
5680  */
5681 
__pyx_f_5numpy_import_array(void)5682 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5683   int __pyx_r;
5684   __Pyx_RefNannyDeclarations
5685   PyObject *__pyx_t_1 = NULL;
5686   PyObject *__pyx_t_2 = NULL;
5687   PyObject *__pyx_t_3 = NULL;
5688   int __pyx_t_4;
5689   PyObject *__pyx_t_5 = NULL;
5690   PyObject *__pyx_t_6 = NULL;
5691   PyObject *__pyx_t_7 = NULL;
5692   PyObject *__pyx_t_8 = NULL;
5693   int __pyx_lineno = 0;
5694   const char *__pyx_filename = NULL;
5695   int __pyx_clineno = 0;
5696   __Pyx_RefNannySetupContext("import_array", 0);
5697 
5698   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5699  * # Cython code.
5700  * cdef inline int import_array() except -1:
5701  *     try:             # <<<<<<<<<<<<<<
5702  *         _import_array()
5703  *     except Exception:
5704  */
5705   {
5706     __Pyx_PyThreadState_declare
5707     __Pyx_PyThreadState_assign
5708     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5709     __Pyx_XGOTREF(__pyx_t_1);
5710     __Pyx_XGOTREF(__pyx_t_2);
5711     __Pyx_XGOTREF(__pyx_t_3);
5712     /*try:*/ {
5713 
5714       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
5715  * cdef inline int import_array() except -1:
5716  *     try:
5717  *         _import_array()             # <<<<<<<<<<<<<<
5718  *     except Exception:
5719  *         raise ImportError("numpy.core.multiarray failed to import")
5720  */
5721       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1035, __pyx_L3_error)
5722 
5723       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5724  * # Cython code.
5725  * cdef inline int import_array() except -1:
5726  *     try:             # <<<<<<<<<<<<<<
5727  *         _import_array()
5728  *     except Exception:
5729  */
5730     }
5731     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5732     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5733     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5734     goto __pyx_L8_try_end;
5735     __pyx_L3_error:;
5736 
5737     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
5738  *     try:
5739  *         _import_array()
5740  *     except Exception:             # <<<<<<<<<<<<<<
5741  *         raise ImportError("numpy.core.multiarray failed to import")
5742  *
5743  */
5744     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5745     if (__pyx_t_4) {
5746       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5747       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1036, __pyx_L5_except_error)
5748       __Pyx_GOTREF(__pyx_t_5);
5749       __Pyx_GOTREF(__pyx_t_6);
5750       __Pyx_GOTREF(__pyx_t_7);
5751 
5752       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
5753  *         _import_array()
5754  *     except Exception:
5755  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
5756  *
5757  * cdef inline int import_umath() except -1:
5758  */
5759       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1037, __pyx_L5_except_error)
5760       __Pyx_GOTREF(__pyx_t_8);
5761       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5762       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5763       __PYX_ERR(1, 1037, __pyx_L5_except_error)
5764     }
5765     goto __pyx_L5_except_error;
5766     __pyx_L5_except_error:;
5767 
5768     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5769  * # Cython code.
5770  * cdef inline int import_array() except -1:
5771  *     try:             # <<<<<<<<<<<<<<
5772  *         _import_array()
5773  *     except Exception:
5774  */
5775     __Pyx_XGIVEREF(__pyx_t_1);
5776     __Pyx_XGIVEREF(__pyx_t_2);
5777     __Pyx_XGIVEREF(__pyx_t_3);
5778     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5779     goto __pyx_L1_error;
5780     __pyx_L8_try_end:;
5781   }
5782 
5783   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1033
5784  * # Versions of the import_* functions which are more suitable for
5785  * # Cython code.
5786  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
5787  *     try:
5788  *         _import_array()
5789  */
5790 
5791   /* function exit code */
5792   __pyx_r = 0;
5793   goto __pyx_L0;
5794   __pyx_L1_error:;
5795   __Pyx_XDECREF(__pyx_t_5);
5796   __Pyx_XDECREF(__pyx_t_6);
5797   __Pyx_XDECREF(__pyx_t_7);
5798   __Pyx_XDECREF(__pyx_t_8);
5799   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5800   __pyx_r = -1;
5801   __pyx_L0:;
5802   __Pyx_RefNannyFinishContext();
5803   return __pyx_r;
5804 }
5805 
5806 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1039
5807  *         raise ImportError("numpy.core.multiarray failed to import")
5808  *
5809  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
5810  *     try:
5811  *         _import_umath()
5812  */
5813 
__pyx_f_5numpy_import_umath(void)5814 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5815   int __pyx_r;
5816   __Pyx_RefNannyDeclarations
5817   PyObject *__pyx_t_1 = NULL;
5818   PyObject *__pyx_t_2 = NULL;
5819   PyObject *__pyx_t_3 = NULL;
5820   int __pyx_t_4;
5821   PyObject *__pyx_t_5 = NULL;
5822   PyObject *__pyx_t_6 = NULL;
5823   PyObject *__pyx_t_7 = NULL;
5824   PyObject *__pyx_t_8 = NULL;
5825   int __pyx_lineno = 0;
5826   const char *__pyx_filename = NULL;
5827   int __pyx_clineno = 0;
5828   __Pyx_RefNannySetupContext("import_umath", 0);
5829 
5830   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
5831  *
5832  * cdef inline int import_umath() except -1:
5833  *     try:             # <<<<<<<<<<<<<<
5834  *         _import_umath()
5835  *     except Exception:
5836  */
5837   {
5838     __Pyx_PyThreadState_declare
5839     __Pyx_PyThreadState_assign
5840     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5841     __Pyx_XGOTREF(__pyx_t_1);
5842     __Pyx_XGOTREF(__pyx_t_2);
5843     __Pyx_XGOTREF(__pyx_t_3);
5844     /*try:*/ {
5845 
5846       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
5847  * cdef inline int import_umath() except -1:
5848  *     try:
5849  *         _import_umath()             # <<<<<<<<<<<<<<
5850  *     except Exception:
5851  *         raise ImportError("numpy.core.umath failed to import")
5852  */
5853       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1041, __pyx_L3_error)
5854 
5855       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
5856  *
5857  * cdef inline int import_umath() except -1:
5858  *     try:             # <<<<<<<<<<<<<<
5859  *         _import_umath()
5860  *     except Exception:
5861  */
5862     }
5863     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5864     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5865     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5866     goto __pyx_L8_try_end;
5867     __pyx_L3_error:;
5868 
5869     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
5870  *     try:
5871  *         _import_umath()
5872  *     except Exception:             # <<<<<<<<<<<<<<
5873  *         raise ImportError("numpy.core.umath failed to import")
5874  *
5875  */
5876     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5877     if (__pyx_t_4) {
5878       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5879       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1042, __pyx_L5_except_error)
5880       __Pyx_GOTREF(__pyx_t_5);
5881       __Pyx_GOTREF(__pyx_t_6);
5882       __Pyx_GOTREF(__pyx_t_7);
5883 
5884       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
5885  *         _import_umath()
5886  *     except Exception:
5887  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
5888  *
5889  * cdef inline int import_ufunc() except -1:
5890  */
5891       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1043, __pyx_L5_except_error)
5892       __Pyx_GOTREF(__pyx_t_8);
5893       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5894       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5895       __PYX_ERR(1, 1043, __pyx_L5_except_error)
5896     }
5897     goto __pyx_L5_except_error;
5898     __pyx_L5_except_error:;
5899 
5900     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
5901  *
5902  * cdef inline int import_umath() except -1:
5903  *     try:             # <<<<<<<<<<<<<<
5904  *         _import_umath()
5905  *     except Exception:
5906  */
5907     __Pyx_XGIVEREF(__pyx_t_1);
5908     __Pyx_XGIVEREF(__pyx_t_2);
5909     __Pyx_XGIVEREF(__pyx_t_3);
5910     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5911     goto __pyx_L1_error;
5912     __pyx_L8_try_end:;
5913   }
5914 
5915   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1039
5916  *         raise ImportError("numpy.core.multiarray failed to import")
5917  *
5918  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
5919  *     try:
5920  *         _import_umath()
5921  */
5922 
5923   /* function exit code */
5924   __pyx_r = 0;
5925   goto __pyx_L0;
5926   __pyx_L1_error:;
5927   __Pyx_XDECREF(__pyx_t_5);
5928   __Pyx_XDECREF(__pyx_t_6);
5929   __Pyx_XDECREF(__pyx_t_7);
5930   __Pyx_XDECREF(__pyx_t_8);
5931   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5932   __pyx_r = -1;
5933   __pyx_L0:;
5934   __Pyx_RefNannyFinishContext();
5935   return __pyx_r;
5936 }
5937 
5938 /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1045
5939  *         raise ImportError("numpy.core.umath failed to import")
5940  *
5941  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
5942  *     try:
5943  *         _import_umath()
5944  */
5945 
__pyx_f_5numpy_import_ufunc(void)5946 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5947   int __pyx_r;
5948   __Pyx_RefNannyDeclarations
5949   PyObject *__pyx_t_1 = NULL;
5950   PyObject *__pyx_t_2 = NULL;
5951   PyObject *__pyx_t_3 = NULL;
5952   int __pyx_t_4;
5953   PyObject *__pyx_t_5 = NULL;
5954   PyObject *__pyx_t_6 = NULL;
5955   PyObject *__pyx_t_7 = NULL;
5956   PyObject *__pyx_t_8 = NULL;
5957   int __pyx_lineno = 0;
5958   const char *__pyx_filename = NULL;
5959   int __pyx_clineno = 0;
5960   __Pyx_RefNannySetupContext("import_ufunc", 0);
5961 
5962   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
5963  *
5964  * cdef inline int import_ufunc() except -1:
5965  *     try:             # <<<<<<<<<<<<<<
5966  *         _import_umath()
5967  *     except Exception:
5968  */
5969   {
5970     __Pyx_PyThreadState_declare
5971     __Pyx_PyThreadState_assign
5972     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5973     __Pyx_XGOTREF(__pyx_t_1);
5974     __Pyx_XGOTREF(__pyx_t_2);
5975     __Pyx_XGOTREF(__pyx_t_3);
5976     /*try:*/ {
5977 
5978       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
5979  * cdef inline int import_ufunc() except -1:
5980  *     try:
5981  *         _import_umath()             # <<<<<<<<<<<<<<
5982  *     except Exception:
5983  *         raise ImportError("numpy.core.umath failed to import")
5984  */
5985       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1047, __pyx_L3_error)
5986 
5987       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
5988  *
5989  * cdef inline int import_ufunc() except -1:
5990  *     try:             # <<<<<<<<<<<<<<
5991  *         _import_umath()
5992  *     except Exception:
5993  */
5994     }
5995     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5996     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5997     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5998     goto __pyx_L8_try_end;
5999     __pyx_L3_error:;
6000 
6001     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
6002  *     try:
6003  *         _import_umath()
6004  *     except Exception:             # <<<<<<<<<<<<<<
6005  *         raise ImportError("numpy.core.umath failed to import")
6006  */
6007     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6008     if (__pyx_t_4) {
6009       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6010       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1048, __pyx_L5_except_error)
6011       __Pyx_GOTREF(__pyx_t_5);
6012       __Pyx_GOTREF(__pyx_t_6);
6013       __Pyx_GOTREF(__pyx_t_7);
6014 
6015       /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
6016  *         _import_umath()
6017  *     except Exception:
6018  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
6019  */
6020       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1049, __pyx_L5_except_error)
6021       __Pyx_GOTREF(__pyx_t_8);
6022       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6023       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6024       __PYX_ERR(1, 1049, __pyx_L5_except_error)
6025     }
6026     goto __pyx_L5_except_error;
6027     __pyx_L5_except_error:;
6028 
6029     /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6030  *
6031  * cdef inline int import_ufunc() except -1:
6032  *     try:             # <<<<<<<<<<<<<<
6033  *         _import_umath()
6034  *     except Exception:
6035  */
6036     __Pyx_XGIVEREF(__pyx_t_1);
6037     __Pyx_XGIVEREF(__pyx_t_2);
6038     __Pyx_XGIVEREF(__pyx_t_3);
6039     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6040     goto __pyx_L1_error;
6041     __pyx_L8_try_end:;
6042   }
6043 
6044   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1045
6045  *         raise ImportError("numpy.core.umath failed to import")
6046  *
6047  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
6048  *     try:
6049  *         _import_umath()
6050  */
6051 
6052   /* function exit code */
6053   __pyx_r = 0;
6054   goto __pyx_L0;
6055   __pyx_L1_error:;
6056   __Pyx_XDECREF(__pyx_t_5);
6057   __Pyx_XDECREF(__pyx_t_6);
6058   __Pyx_XDECREF(__pyx_t_7);
6059   __Pyx_XDECREF(__pyx_t_8);
6060   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6061   __pyx_r = -1;
6062   __pyx_L0:;
6063   __Pyx_RefNannyFinishContext();
6064   return __pyx_r;
6065 }
6066 
6067 /* "View.MemoryView":122
6068  *         cdef bint dtype_is_object
6069  *
6070  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
6071  *                   mode="c", bint allocate_buffer=True):
6072  *
6073  */
6074 
6075 /* Python wrapper */
6076 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_array___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6077 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6078   PyObject *__pyx_v_shape = 0;
6079   Py_ssize_t __pyx_v_itemsize;
6080   PyObject *__pyx_v_format = 0;
6081   PyObject *__pyx_v_mode = 0;
6082   int __pyx_v_allocate_buffer;
6083   int __pyx_lineno = 0;
6084   const char *__pyx_filename = NULL;
6085   int __pyx_clineno = 0;
6086   int __pyx_r;
6087   __Pyx_RefNannyDeclarations
6088   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6089   {
6090     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6091     PyObject* values[5] = {0,0,0,0,0};
6092     values[3] = ((PyObject *)__pyx_n_s_c);
6093     if (unlikely(__pyx_kwds)) {
6094       Py_ssize_t kw_args;
6095       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6096       switch (pos_args) {
6097         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6098         CYTHON_FALLTHROUGH;
6099         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6100         CYTHON_FALLTHROUGH;
6101         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6102         CYTHON_FALLTHROUGH;
6103         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6104         CYTHON_FALLTHROUGH;
6105         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6106         CYTHON_FALLTHROUGH;
6107         case  0: break;
6108         default: goto __pyx_L5_argtuple_error;
6109       }
6110       kw_args = PyDict_Size(__pyx_kwds);
6111       switch (pos_args) {
6112         case  0:
6113         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6114         else goto __pyx_L5_argtuple_error;
6115         CYTHON_FALLTHROUGH;
6116         case  1:
6117         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6118         else {
6119           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
6120         }
6121         CYTHON_FALLTHROUGH;
6122         case  2:
6123         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6124         else {
6125           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
6126         }
6127         CYTHON_FALLTHROUGH;
6128         case  3:
6129         if (kw_args > 0) {
6130           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6131           if (value) { values[3] = value; kw_args--; }
6132         }
6133         CYTHON_FALLTHROUGH;
6134         case  4:
6135         if (kw_args > 0) {
6136           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6137           if (value) { values[4] = value; kw_args--; }
6138         }
6139       }
6140       if (unlikely(kw_args > 0)) {
6141         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
6142       }
6143     } else {
6144       switch (PyTuple_GET_SIZE(__pyx_args)) {
6145         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6146         CYTHON_FALLTHROUGH;
6147         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6148         CYTHON_FALLTHROUGH;
6149         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6150         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6151         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152         break;
6153         default: goto __pyx_L5_argtuple_error;
6154       }
6155     }
6156     __pyx_v_shape = ((PyObject*)values[0]);
6157     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
6158     __pyx_v_format = values[2];
6159     __pyx_v_mode = values[3];
6160     if (values[4]) {
6161       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
6162     } else {
6163 
6164       /* "View.MemoryView":123
6165  *
6166  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6167  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
6168  *
6169  *         cdef int idx
6170  */
6171       __pyx_v_allocate_buffer = ((int)1);
6172     }
6173   }
6174   goto __pyx_L4_argument_unpacking_done;
6175   __pyx_L5_argtuple_error:;
6176   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
6177   __pyx_L3_error:;
6178   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6179   __Pyx_RefNannyFinishContext();
6180   return -1;
6181   __pyx_L4_argument_unpacking_done:;
6182   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
6183   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6184     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
6185   }
6186   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6187 
6188   /* "View.MemoryView":122
6189  *         cdef bint dtype_is_object
6190  *
6191  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
6192  *                   mode="c", bint allocate_buffer=True):
6193  *
6194  */
6195 
6196   /* function exit code */
6197   goto __pyx_L0;
6198   __pyx_L1_error:;
6199   __pyx_r = -1;
6200   __pyx_L0:;
6201   __Pyx_RefNannyFinishContext();
6202   return __pyx_r;
6203 }
6204 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,PyObject * __pyx_v_format,PyObject * __pyx_v_mode,int __pyx_v_allocate_buffer)6205 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
6206   int __pyx_v_idx;
6207   Py_ssize_t __pyx_v_i;
6208   Py_ssize_t __pyx_v_dim;
6209   PyObject **__pyx_v_p;
6210   char __pyx_v_order;
6211   int __pyx_r;
6212   __Pyx_RefNannyDeclarations
6213   Py_ssize_t __pyx_t_1;
6214   int __pyx_t_2;
6215   PyObject *__pyx_t_3 = NULL;
6216   int __pyx_t_4;
6217   PyObject *__pyx_t_5 = NULL;
6218   PyObject *__pyx_t_6 = NULL;
6219   char *__pyx_t_7;
6220   int __pyx_t_8;
6221   Py_ssize_t __pyx_t_9;
6222   PyObject *__pyx_t_10 = NULL;
6223   Py_ssize_t __pyx_t_11;
6224   int __pyx_lineno = 0;
6225   const char *__pyx_filename = NULL;
6226   int __pyx_clineno = 0;
6227   __Pyx_RefNannySetupContext("__cinit__", 0);
6228   __Pyx_INCREF(__pyx_v_format);
6229 
6230   /* "View.MemoryView":129
6231  *         cdef PyObject **p
6232  *
6233  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
6234  *         self.itemsize = itemsize
6235  *
6236  */
6237   if (unlikely(__pyx_v_shape == Py_None)) {
6238     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6239     __PYX_ERR(2, 129, __pyx_L1_error)
6240   }
6241   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
6242   __pyx_v_self->ndim = ((int)__pyx_t_1);
6243 
6244   /* "View.MemoryView":130
6245  *
6246  *         self.ndim = <int> len(shape)
6247  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
6248  *
6249  *         if not self.ndim:
6250  */
6251   __pyx_v_self->itemsize = __pyx_v_itemsize;
6252 
6253   /* "View.MemoryView":132
6254  *         self.itemsize = itemsize
6255  *
6256  *         if not self.ndim:             # <<<<<<<<<<<<<<
6257  *             raise ValueError("Empty shape tuple for cython.array")
6258  *
6259  */
6260   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6261   if (unlikely(__pyx_t_2)) {
6262 
6263     /* "View.MemoryView":133
6264  *
6265  *         if not self.ndim:
6266  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
6267  *
6268  *         if itemsize <= 0:
6269  */
6270     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
6271     __Pyx_GOTREF(__pyx_t_3);
6272     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6273     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6274     __PYX_ERR(2, 133, __pyx_L1_error)
6275 
6276     /* "View.MemoryView":132
6277  *         self.itemsize = itemsize
6278  *
6279  *         if not self.ndim:             # <<<<<<<<<<<<<<
6280  *             raise ValueError("Empty shape tuple for cython.array")
6281  *
6282  */
6283   }
6284 
6285   /* "View.MemoryView":135
6286  *             raise ValueError("Empty shape tuple for cython.array")
6287  *
6288  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
6289  *             raise ValueError("itemsize <= 0 for cython.array")
6290  *
6291  */
6292   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6293   if (unlikely(__pyx_t_2)) {
6294 
6295     /* "View.MemoryView":136
6296  *
6297  *         if itemsize <= 0:
6298  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
6299  *
6300  *         if not isinstance(format, bytes):
6301  */
6302     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
6303     __Pyx_GOTREF(__pyx_t_3);
6304     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6305     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6306     __PYX_ERR(2, 136, __pyx_L1_error)
6307 
6308     /* "View.MemoryView":135
6309  *             raise ValueError("Empty shape tuple for cython.array")
6310  *
6311  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
6312  *             raise ValueError("itemsize <= 0 for cython.array")
6313  *
6314  */
6315   }
6316 
6317   /* "View.MemoryView":138
6318  *             raise ValueError("itemsize <= 0 for cython.array")
6319  *
6320  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
6321  *             format = format.encode('ASCII')
6322  *         self._format = format  # keep a reference to the byte string
6323  */
6324   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6325   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6326   if (__pyx_t_4) {
6327 
6328     /* "View.MemoryView":139
6329  *
6330  *         if not isinstance(format, bytes):
6331  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
6332  *         self._format = format  # keep a reference to the byte string
6333  *         self.format = self._format
6334  */
6335     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
6336     __Pyx_GOTREF(__pyx_t_5);
6337     __pyx_t_6 = NULL;
6338     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6339       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6340       if (likely(__pyx_t_6)) {
6341         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6342         __Pyx_INCREF(__pyx_t_6);
6343         __Pyx_INCREF(function);
6344         __Pyx_DECREF_SET(__pyx_t_5, function);
6345       }
6346     }
6347     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6348     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6349     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
6350     __Pyx_GOTREF(__pyx_t_3);
6351     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6352     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6353     __pyx_t_3 = 0;
6354 
6355     /* "View.MemoryView":138
6356  *             raise ValueError("itemsize <= 0 for cython.array")
6357  *
6358  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
6359  *             format = format.encode('ASCII')
6360  *         self._format = format  # keep a reference to the byte string
6361  */
6362   }
6363 
6364   /* "View.MemoryView":140
6365  *         if not isinstance(format, bytes):
6366  *             format = format.encode('ASCII')
6367  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
6368  *         self.format = self._format
6369  *
6370  */
6371   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
6372   __pyx_t_3 = __pyx_v_format;
6373   __Pyx_INCREF(__pyx_t_3);
6374   __Pyx_GIVEREF(__pyx_t_3);
6375   __Pyx_GOTREF(__pyx_v_self->_format);
6376   __Pyx_DECREF(__pyx_v_self->_format);
6377   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6378   __pyx_t_3 = 0;
6379 
6380   /* "View.MemoryView":141
6381  *             format = format.encode('ASCII')
6382  *         self._format = format  # keep a reference to the byte string
6383  *         self.format = self._format             # <<<<<<<<<<<<<<
6384  *
6385  *
6386  */
6387   if (unlikely(__pyx_v_self->_format == Py_None)) {
6388     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6389     __PYX_ERR(2, 141, __pyx_L1_error)
6390   }
6391   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
6392   __pyx_v_self->format = __pyx_t_7;
6393 
6394   /* "View.MemoryView":144
6395  *
6396  *
6397  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
6398  *         self._strides = self._shape + self.ndim
6399  *
6400  */
6401   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6402 
6403   /* "View.MemoryView":145
6404  *
6405  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6406  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
6407  *
6408  *         if not self._shape:
6409  */
6410   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6411 
6412   /* "View.MemoryView":147
6413  *         self._strides = self._shape + self.ndim
6414  *
6415  *         if not self._shape:             # <<<<<<<<<<<<<<
6416  *             raise MemoryError("unable to allocate shape and strides.")
6417  *
6418  */
6419   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6420   if (unlikely(__pyx_t_4)) {
6421 
6422     /* "View.MemoryView":148
6423  *
6424  *         if not self._shape:
6425  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
6426  *
6427  *
6428  */
6429     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
6430     __Pyx_GOTREF(__pyx_t_3);
6431     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6432     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6433     __PYX_ERR(2, 148, __pyx_L1_error)
6434 
6435     /* "View.MemoryView":147
6436  *         self._strides = self._shape + self.ndim
6437  *
6438  *         if not self._shape:             # <<<<<<<<<<<<<<
6439  *             raise MemoryError("unable to allocate shape and strides.")
6440  *
6441  */
6442   }
6443 
6444   /* "View.MemoryView":151
6445  *
6446  *
6447  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
6448  *             if dim <= 0:
6449  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6450  */
6451   __pyx_t_8 = 0;
6452   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6453   for (;;) {
6454     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
6455     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6456     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
6457     #else
6458     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
6459     __Pyx_GOTREF(__pyx_t_5);
6460     #endif
6461     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
6462     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6463     __pyx_v_dim = __pyx_t_9;
6464     __pyx_v_idx = __pyx_t_8;
6465     __pyx_t_8 = (__pyx_t_8 + 1);
6466 
6467     /* "View.MemoryView":152
6468  *
6469  *         for idx, dim in enumerate(shape):
6470  *             if dim <= 0:             # <<<<<<<<<<<<<<
6471  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6472  *             self._shape[idx] = dim
6473  */
6474     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6475     if (unlikely(__pyx_t_4)) {
6476 
6477       /* "View.MemoryView":153
6478  *         for idx, dim in enumerate(shape):
6479  *             if dim <= 0:
6480  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
6481  *             self._shape[idx] = dim
6482  *
6483  */
6484       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
6485       __Pyx_GOTREF(__pyx_t_5);
6486       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
6487       __Pyx_GOTREF(__pyx_t_6);
6488       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
6489       __Pyx_GOTREF(__pyx_t_10);
6490       __Pyx_GIVEREF(__pyx_t_5);
6491       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6492       __Pyx_GIVEREF(__pyx_t_6);
6493       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6494       __pyx_t_5 = 0;
6495       __pyx_t_6 = 0;
6496       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
6497       __Pyx_GOTREF(__pyx_t_6);
6498       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6499       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
6500       __Pyx_GOTREF(__pyx_t_10);
6501       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6502       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6503       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6504       __PYX_ERR(2, 153, __pyx_L1_error)
6505 
6506       /* "View.MemoryView":152
6507  *
6508  *         for idx, dim in enumerate(shape):
6509  *             if dim <= 0:             # <<<<<<<<<<<<<<
6510  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6511  *             self._shape[idx] = dim
6512  */
6513     }
6514 
6515     /* "View.MemoryView":154
6516  *             if dim <= 0:
6517  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6518  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
6519  *
6520  *         cdef char order
6521  */
6522     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6523 
6524     /* "View.MemoryView":151
6525  *
6526  *
6527  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
6528  *             if dim <= 0:
6529  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6530  */
6531   }
6532   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6533 
6534   /* "View.MemoryView":157
6535  *
6536  *         cdef char order
6537  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
6538  *             order = b'F'
6539  *             self.mode = u'fortran'
6540  */
6541   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
6542   if (__pyx_t_4) {
6543 
6544     /* "View.MemoryView":158
6545  *         cdef char order
6546  *         if mode == 'fortran':
6547  *             order = b'F'             # <<<<<<<<<<<<<<
6548  *             self.mode = u'fortran'
6549  *         elif mode == 'c':
6550  */
6551     __pyx_v_order = 'F';
6552 
6553     /* "View.MemoryView":159
6554  *         if mode == 'fortran':
6555  *             order = b'F'
6556  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
6557  *         elif mode == 'c':
6558  *             order = b'C'
6559  */
6560     __Pyx_INCREF(__pyx_n_u_fortran);
6561     __Pyx_GIVEREF(__pyx_n_u_fortran);
6562     __Pyx_GOTREF(__pyx_v_self->mode);
6563     __Pyx_DECREF(__pyx_v_self->mode);
6564     __pyx_v_self->mode = __pyx_n_u_fortran;
6565 
6566     /* "View.MemoryView":157
6567  *
6568  *         cdef char order
6569  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
6570  *             order = b'F'
6571  *             self.mode = u'fortran'
6572  */
6573     goto __pyx_L10;
6574   }
6575 
6576   /* "View.MemoryView":160
6577  *             order = b'F'
6578  *             self.mode = u'fortran'
6579  *         elif mode == 'c':             # <<<<<<<<<<<<<<
6580  *             order = b'C'
6581  *             self.mode = u'c'
6582  */
6583   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
6584   if (likely(__pyx_t_4)) {
6585 
6586     /* "View.MemoryView":161
6587  *             self.mode = u'fortran'
6588  *         elif mode == 'c':
6589  *             order = b'C'             # <<<<<<<<<<<<<<
6590  *             self.mode = u'c'
6591  *         else:
6592  */
6593     __pyx_v_order = 'C';
6594 
6595     /* "View.MemoryView":162
6596  *         elif mode == 'c':
6597  *             order = b'C'
6598  *             self.mode = u'c'             # <<<<<<<<<<<<<<
6599  *         else:
6600  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6601  */
6602     __Pyx_INCREF(__pyx_n_u_c);
6603     __Pyx_GIVEREF(__pyx_n_u_c);
6604     __Pyx_GOTREF(__pyx_v_self->mode);
6605     __Pyx_DECREF(__pyx_v_self->mode);
6606     __pyx_v_self->mode = __pyx_n_u_c;
6607 
6608     /* "View.MemoryView":160
6609  *             order = b'F'
6610  *             self.mode = u'fortran'
6611  *         elif mode == 'c':             # <<<<<<<<<<<<<<
6612  *             order = b'C'
6613  *             self.mode = u'c'
6614  */
6615     goto __pyx_L10;
6616   }
6617 
6618   /* "View.MemoryView":164
6619  *             self.mode = u'c'
6620  *         else:
6621  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
6622  *
6623  *         self.len = fill_contig_strides_array(self._shape, self._strides,
6624  */
6625   /*else*/ {
6626     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
6627     __Pyx_GOTREF(__pyx_t_3);
6628     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
6629     __Pyx_GOTREF(__pyx_t_10);
6630     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6631     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6632     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6633     __PYX_ERR(2, 164, __pyx_L1_error)
6634   }
6635   __pyx_L10:;
6636 
6637   /* "View.MemoryView":166
6638  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6639  *
6640  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
6641  *                                              itemsize, self.ndim, order)
6642  *
6643  */
6644   __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6645 
6646   /* "View.MemoryView":169
6647  *                                              itemsize, self.ndim, order)
6648  *
6649  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
6650  *         self.dtype_is_object = format == b'O'
6651  *         if allocate_buffer:
6652  */
6653   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6654 
6655   /* "View.MemoryView":170
6656  *
6657  *         self.free_data = allocate_buffer
6658  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
6659  *         if allocate_buffer:
6660  *
6661  */
6662   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
6663   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
6664   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6665   __pyx_v_self->dtype_is_object = __pyx_t_4;
6666 
6667   /* "View.MemoryView":171
6668  *         self.free_data = allocate_buffer
6669  *         self.dtype_is_object = format == b'O'
6670  *         if allocate_buffer:             # <<<<<<<<<<<<<<
6671  *
6672  *
6673  */
6674   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6675   if (__pyx_t_4) {
6676 
6677     /* "View.MemoryView":174
6678  *
6679  *
6680  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
6681  *             if not self.data:
6682  *                 raise MemoryError("unable to allocate array data.")
6683  */
6684     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6685 
6686     /* "View.MemoryView":175
6687  *
6688  *             self.data = <char *>malloc(self.len)
6689  *             if not self.data:             # <<<<<<<<<<<<<<
6690  *                 raise MemoryError("unable to allocate array data.")
6691  *
6692  */
6693     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6694     if (unlikely(__pyx_t_4)) {
6695 
6696       /* "View.MemoryView":176
6697  *             self.data = <char *>malloc(self.len)
6698  *             if not self.data:
6699  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
6700  *
6701  *             if self.dtype_is_object:
6702  */
6703       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
6704       __Pyx_GOTREF(__pyx_t_10);
6705       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6706       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6707       __PYX_ERR(2, 176, __pyx_L1_error)
6708 
6709       /* "View.MemoryView":175
6710  *
6711  *             self.data = <char *>malloc(self.len)
6712  *             if not self.data:             # <<<<<<<<<<<<<<
6713  *                 raise MemoryError("unable to allocate array data.")
6714  *
6715  */
6716     }
6717 
6718     /* "View.MemoryView":178
6719  *                 raise MemoryError("unable to allocate array data.")
6720  *
6721  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6722  *                 p = <PyObject **> self.data
6723  *                 for i in range(self.len / itemsize):
6724  */
6725     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6726     if (__pyx_t_4) {
6727 
6728       /* "View.MemoryView":179
6729  *
6730  *             if self.dtype_is_object:
6731  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
6732  *                 for i in range(self.len / itemsize):
6733  *                     p[i] = Py_None
6734  */
6735       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6736 
6737       /* "View.MemoryView":180
6738  *             if self.dtype_is_object:
6739  *                 p = <PyObject **> self.data
6740  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
6741  *                     p[i] = Py_None
6742  *                     Py_INCREF(Py_None)
6743  */
6744       if (unlikely(__pyx_v_itemsize == 0)) {
6745         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6746         __PYX_ERR(2, 180, __pyx_L1_error)
6747       }
6748       else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6749         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6750         __PYX_ERR(2, 180, __pyx_L1_error)
6751       }
6752       __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
6753       __pyx_t_9 = __pyx_t_1;
6754       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6755         __pyx_v_i = __pyx_t_11;
6756 
6757         /* "View.MemoryView":181
6758  *                 p = <PyObject **> self.data
6759  *                 for i in range(self.len / itemsize):
6760  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
6761  *                     Py_INCREF(Py_None)
6762  *
6763  */
6764         (__pyx_v_p[__pyx_v_i]) = Py_None;
6765 
6766         /* "View.MemoryView":182
6767  *                 for i in range(self.len / itemsize):
6768  *                     p[i] = Py_None
6769  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
6770  *
6771  *     @cname('getbuffer')
6772  */
6773         Py_INCREF(Py_None);
6774       }
6775 
6776       /* "View.MemoryView":178
6777  *                 raise MemoryError("unable to allocate array data.")
6778  *
6779  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6780  *                 p = <PyObject **> self.data
6781  *                 for i in range(self.len / itemsize):
6782  */
6783     }
6784 
6785     /* "View.MemoryView":171
6786  *         self.free_data = allocate_buffer
6787  *         self.dtype_is_object = format == b'O'
6788  *         if allocate_buffer:             # <<<<<<<<<<<<<<
6789  *
6790  *
6791  */
6792   }
6793 
6794   /* "View.MemoryView":122
6795  *         cdef bint dtype_is_object
6796  *
6797  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
6798  *                   mode="c", bint allocate_buffer=True):
6799  *
6800  */
6801 
6802   /* function exit code */
6803   __pyx_r = 0;
6804   goto __pyx_L0;
6805   __pyx_L1_error:;
6806   __Pyx_XDECREF(__pyx_t_3);
6807   __Pyx_XDECREF(__pyx_t_5);
6808   __Pyx_XDECREF(__pyx_t_6);
6809   __Pyx_XDECREF(__pyx_t_10);
6810   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6811   __pyx_r = -1;
6812   __pyx_L0:;
6813   __Pyx_XDECREF(__pyx_v_format);
6814   __Pyx_RefNannyFinishContext();
6815   return __pyx_r;
6816 }
6817 
6818 /* "View.MemoryView":185
6819  *
6820  *     @cname('getbuffer')
6821  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
6822  *         cdef int bufmode = -1
6823  *         if self.mode == u"c":
6824  */
6825 
6826 /* Python wrapper */
6827 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_array_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)6828 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6829   int __pyx_r;
6830   __Pyx_RefNannyDeclarations
6831   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6832   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6833 
6834   /* function exit code */
6835   __Pyx_RefNannyFinishContext();
6836   return __pyx_r;
6837 }
6838 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)6839 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6840   int __pyx_v_bufmode;
6841   int __pyx_r;
6842   __Pyx_RefNannyDeclarations
6843   int __pyx_t_1;
6844   int __pyx_t_2;
6845   PyObject *__pyx_t_3 = NULL;
6846   char *__pyx_t_4;
6847   Py_ssize_t __pyx_t_5;
6848   int __pyx_t_6;
6849   Py_ssize_t *__pyx_t_7;
6850   int __pyx_lineno = 0;
6851   const char *__pyx_filename = NULL;
6852   int __pyx_clineno = 0;
6853   if (__pyx_v_info == NULL) {
6854     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6855     return -1;
6856   }
6857   __Pyx_RefNannySetupContext("__getbuffer__", 0);
6858   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6859   __Pyx_GIVEREF(__pyx_v_info->obj);
6860 
6861   /* "View.MemoryView":186
6862  *     @cname('getbuffer')
6863  *     def __getbuffer__(self, Py_buffer *info, int flags):
6864  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
6865  *         if self.mode == u"c":
6866  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6867  */
6868   __pyx_v_bufmode = -1;
6869 
6870   /* "View.MemoryView":187
6871  *     def __getbuffer__(self, Py_buffer *info, int flags):
6872  *         cdef int bufmode = -1
6873  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
6874  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6875  *         elif self.mode == u"fortran":
6876  */
6877   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
6878   __pyx_t_2 = (__pyx_t_1 != 0);
6879   if (__pyx_t_2) {
6880 
6881     /* "View.MemoryView":188
6882  *         cdef int bufmode = -1
6883  *         if self.mode == u"c":
6884  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
6885  *         elif self.mode == u"fortran":
6886  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6887  */
6888     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6889 
6890     /* "View.MemoryView":187
6891  *     def __getbuffer__(self, Py_buffer *info, int flags):
6892  *         cdef int bufmode = -1
6893  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
6894  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6895  *         elif self.mode == u"fortran":
6896  */
6897     goto __pyx_L3;
6898   }
6899 
6900   /* "View.MemoryView":189
6901  *         if self.mode == u"c":
6902  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6903  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
6904  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6905  *         if not (flags & bufmode):
6906  */
6907   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
6908   __pyx_t_1 = (__pyx_t_2 != 0);
6909   if (__pyx_t_1) {
6910 
6911     /* "View.MemoryView":190
6912  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6913  *         elif self.mode == u"fortran":
6914  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
6915  *         if not (flags & bufmode):
6916  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6917  */
6918     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6919 
6920     /* "View.MemoryView":189
6921  *         if self.mode == u"c":
6922  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6923  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
6924  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6925  *         if not (flags & bufmode):
6926  */
6927   }
6928   __pyx_L3:;
6929 
6930   /* "View.MemoryView":191
6931  *         elif self.mode == u"fortran":
6932  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6933  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
6934  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6935  *         info.buf = self.data
6936  */
6937   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
6938   if (unlikely(__pyx_t_1)) {
6939 
6940     /* "View.MemoryView":192
6941  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6942  *         if not (flags & bufmode):
6943  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
6944  *         info.buf = self.data
6945  *         info.len = self.len
6946  */
6947     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
6948     __Pyx_GOTREF(__pyx_t_3);
6949     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6950     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6951     __PYX_ERR(2, 192, __pyx_L1_error)
6952 
6953     /* "View.MemoryView":191
6954  *         elif self.mode == u"fortran":
6955  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6956  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
6957  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6958  *         info.buf = self.data
6959  */
6960   }
6961 
6962   /* "View.MemoryView":193
6963  *         if not (flags & bufmode):
6964  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6965  *         info.buf = self.data             # <<<<<<<<<<<<<<
6966  *         info.len = self.len
6967  *         info.ndim = self.ndim
6968  */
6969   __pyx_t_4 = __pyx_v_self->data;
6970   __pyx_v_info->buf = __pyx_t_4;
6971 
6972   /* "View.MemoryView":194
6973  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6974  *         info.buf = self.data
6975  *         info.len = self.len             # <<<<<<<<<<<<<<
6976  *         info.ndim = self.ndim
6977  *         info.shape = self._shape
6978  */
6979   __pyx_t_5 = __pyx_v_self->len;
6980   __pyx_v_info->len = __pyx_t_5;
6981 
6982   /* "View.MemoryView":195
6983  *         info.buf = self.data
6984  *         info.len = self.len
6985  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
6986  *         info.shape = self._shape
6987  *         info.strides = self._strides
6988  */
6989   __pyx_t_6 = __pyx_v_self->ndim;
6990   __pyx_v_info->ndim = __pyx_t_6;
6991 
6992   /* "View.MemoryView":196
6993  *         info.len = self.len
6994  *         info.ndim = self.ndim
6995  *         info.shape = self._shape             # <<<<<<<<<<<<<<
6996  *         info.strides = self._strides
6997  *         info.suboffsets = NULL
6998  */
6999   __pyx_t_7 = __pyx_v_self->_shape;
7000   __pyx_v_info->shape = __pyx_t_7;
7001 
7002   /* "View.MemoryView":197
7003  *         info.ndim = self.ndim
7004  *         info.shape = self._shape
7005  *         info.strides = self._strides             # <<<<<<<<<<<<<<
7006  *         info.suboffsets = NULL
7007  *         info.itemsize = self.itemsize
7008  */
7009   __pyx_t_7 = __pyx_v_self->_strides;
7010   __pyx_v_info->strides = __pyx_t_7;
7011 
7012   /* "View.MemoryView":198
7013  *         info.shape = self._shape
7014  *         info.strides = self._strides
7015  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
7016  *         info.itemsize = self.itemsize
7017  *         info.readonly = 0
7018  */
7019   __pyx_v_info->suboffsets = NULL;
7020 
7021   /* "View.MemoryView":199
7022  *         info.strides = self._strides
7023  *         info.suboffsets = NULL
7024  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
7025  *         info.readonly = 0
7026  *
7027  */
7028   __pyx_t_5 = __pyx_v_self->itemsize;
7029   __pyx_v_info->itemsize = __pyx_t_5;
7030 
7031   /* "View.MemoryView":200
7032  *         info.suboffsets = NULL
7033  *         info.itemsize = self.itemsize
7034  *         info.readonly = 0             # <<<<<<<<<<<<<<
7035  *
7036  *         if flags & PyBUF_FORMAT:
7037  */
7038   __pyx_v_info->readonly = 0;
7039 
7040   /* "View.MemoryView":202
7041  *         info.readonly = 0
7042  *
7043  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
7044  *             info.format = self.format
7045  *         else:
7046  */
7047   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7048   if (__pyx_t_1) {
7049 
7050     /* "View.MemoryView":203
7051  *
7052  *         if flags & PyBUF_FORMAT:
7053  *             info.format = self.format             # <<<<<<<<<<<<<<
7054  *         else:
7055  *             info.format = NULL
7056  */
7057     __pyx_t_4 = __pyx_v_self->format;
7058     __pyx_v_info->format = __pyx_t_4;
7059 
7060     /* "View.MemoryView":202
7061  *         info.readonly = 0
7062  *
7063  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
7064  *             info.format = self.format
7065  *         else:
7066  */
7067     goto __pyx_L5;
7068   }
7069 
7070   /* "View.MemoryView":205
7071  *             info.format = self.format
7072  *         else:
7073  *             info.format = NULL             # <<<<<<<<<<<<<<
7074  *
7075  *         info.obj = self
7076  */
7077   /*else*/ {
7078     __pyx_v_info->format = NULL;
7079   }
7080   __pyx_L5:;
7081 
7082   /* "View.MemoryView":207
7083  *             info.format = NULL
7084  *
7085  *         info.obj = self             # <<<<<<<<<<<<<<
7086  *
7087  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7088  */
7089   __Pyx_INCREF(((PyObject *)__pyx_v_self));
7090   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7091   __Pyx_GOTREF(__pyx_v_info->obj);
7092   __Pyx_DECREF(__pyx_v_info->obj);
7093   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7094 
7095   /* "View.MemoryView":185
7096  *
7097  *     @cname('getbuffer')
7098  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
7099  *         cdef int bufmode = -1
7100  *         if self.mode == u"c":
7101  */
7102 
7103   /* function exit code */
7104   __pyx_r = 0;
7105   goto __pyx_L0;
7106   __pyx_L1_error:;
7107   __Pyx_XDECREF(__pyx_t_3);
7108   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7109   __pyx_r = -1;
7110   if (__pyx_v_info->obj != NULL) {
7111     __Pyx_GOTREF(__pyx_v_info->obj);
7112     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7113   }
7114   goto __pyx_L2;
7115   __pyx_L0:;
7116   if (__pyx_v_info->obj == Py_None) {
7117     __Pyx_GOTREF(__pyx_v_info->obj);
7118     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7119   }
7120   __pyx_L2:;
7121   __Pyx_RefNannyFinishContext();
7122   return __pyx_r;
7123 }
7124 
7125 /* "View.MemoryView":211
7126  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7127  *
7128  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
7129  *         if self.callback_free_data != NULL:
7130  *             self.callback_free_data(self.data)
7131  */
7132 
7133 /* Python wrapper */
7134 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)7135 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7136   __Pyx_RefNannyDeclarations
7137   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7138   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7139 
7140   /* function exit code */
7141   __Pyx_RefNannyFinishContext();
7142 }
7143 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)7144 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7145   __Pyx_RefNannyDeclarations
7146   int __pyx_t_1;
7147   __Pyx_RefNannySetupContext("__dealloc__", 0);
7148 
7149   /* "View.MemoryView":212
7150  *
7151  *     def __dealloc__(array self):
7152  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
7153  *             self.callback_free_data(self.data)
7154  *         elif self.free_data:
7155  */
7156   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7157   if (__pyx_t_1) {
7158 
7159     /* "View.MemoryView":213
7160  *     def __dealloc__(array self):
7161  *         if self.callback_free_data != NULL:
7162  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
7163  *         elif self.free_data:
7164  *             if self.dtype_is_object:
7165  */
7166     __pyx_v_self->callback_free_data(__pyx_v_self->data);
7167 
7168     /* "View.MemoryView":212
7169  *
7170  *     def __dealloc__(array self):
7171  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
7172  *             self.callback_free_data(self.data)
7173  *         elif self.free_data:
7174  */
7175     goto __pyx_L3;
7176   }
7177 
7178   /* "View.MemoryView":214
7179  *         if self.callback_free_data != NULL:
7180  *             self.callback_free_data(self.data)
7181  *         elif self.free_data:             # <<<<<<<<<<<<<<
7182  *             if self.dtype_is_object:
7183  *                 refcount_objects_in_slice(self.data, self._shape,
7184  */
7185   __pyx_t_1 = (__pyx_v_self->free_data != 0);
7186   if (__pyx_t_1) {
7187 
7188     /* "View.MemoryView":215
7189  *             self.callback_free_data(self.data)
7190  *         elif self.free_data:
7191  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
7192  *                 refcount_objects_in_slice(self.data, self._shape,
7193  *                                           self._strides, self.ndim, False)
7194  */
7195     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7196     if (__pyx_t_1) {
7197 
7198       /* "View.MemoryView":216
7199  *         elif self.free_data:
7200  *             if self.dtype_is_object:
7201  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
7202  *                                           self._strides, self.ndim, False)
7203  *             free(self.data)
7204  */
7205       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7206 
7207       /* "View.MemoryView":215
7208  *             self.callback_free_data(self.data)
7209  *         elif self.free_data:
7210  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
7211  *                 refcount_objects_in_slice(self.data, self._shape,
7212  *                                           self._strides, self.ndim, False)
7213  */
7214     }
7215 
7216     /* "View.MemoryView":218
7217  *                 refcount_objects_in_slice(self.data, self._shape,
7218  *                                           self._strides, self.ndim, False)
7219  *             free(self.data)             # <<<<<<<<<<<<<<
7220  *         PyObject_Free(self._shape)
7221  *
7222  */
7223     free(__pyx_v_self->data);
7224 
7225     /* "View.MemoryView":214
7226  *         if self.callback_free_data != NULL:
7227  *             self.callback_free_data(self.data)
7228  *         elif self.free_data:             # <<<<<<<<<<<<<<
7229  *             if self.dtype_is_object:
7230  *                 refcount_objects_in_slice(self.data, self._shape,
7231  */
7232   }
7233   __pyx_L3:;
7234 
7235   /* "View.MemoryView":219
7236  *                                           self._strides, self.ndim, False)
7237  *             free(self.data)
7238  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
7239  *
7240  *     @property
7241  */
7242   PyObject_Free(__pyx_v_self->_shape);
7243 
7244   /* "View.MemoryView":211
7245  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7246  *
7247  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
7248  *         if self.callback_free_data != NULL:
7249  *             self.callback_free_data(self.data)
7250  */
7251 
7252   /* function exit code */
7253   __Pyx_RefNannyFinishContext();
7254 }
7255 
7256 /* "View.MemoryView":222
7257  *
7258  *     @property
7259  *     def memview(self):             # <<<<<<<<<<<<<<
7260  *         return self.get_memview()
7261  *
7262  */
7263 
7264 /* Python wrapper */
7265 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject * __pyx_v_self)7266 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7267   PyObject *__pyx_r = 0;
7268   __Pyx_RefNannyDeclarations
7269   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7270   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7271 
7272   /* function exit code */
7273   __Pyx_RefNannyFinishContext();
7274   return __pyx_r;
7275 }
7276 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)7277 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7278   PyObject *__pyx_r = NULL;
7279   __Pyx_RefNannyDeclarations
7280   PyObject *__pyx_t_1 = NULL;
7281   int __pyx_lineno = 0;
7282   const char *__pyx_filename = NULL;
7283   int __pyx_clineno = 0;
7284   __Pyx_RefNannySetupContext("__get__", 0);
7285 
7286   /* "View.MemoryView":223
7287  *     @property
7288  *     def memview(self):
7289  *         return self.get_memview()             # <<<<<<<<<<<<<<
7290  *
7291  *     @cname('get_memview')
7292  */
7293   __Pyx_XDECREF(__pyx_r);
7294   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
7295   __Pyx_GOTREF(__pyx_t_1);
7296   __pyx_r = __pyx_t_1;
7297   __pyx_t_1 = 0;
7298   goto __pyx_L0;
7299 
7300   /* "View.MemoryView":222
7301  *
7302  *     @property
7303  *     def memview(self):             # <<<<<<<<<<<<<<
7304  *         return self.get_memview()
7305  *
7306  */
7307 
7308   /* function exit code */
7309   __pyx_L1_error:;
7310   __Pyx_XDECREF(__pyx_t_1);
7311   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7312   __pyx_r = NULL;
7313   __pyx_L0:;
7314   __Pyx_XGIVEREF(__pyx_r);
7315   __Pyx_RefNannyFinishContext();
7316   return __pyx_r;
7317 }
7318 
7319 /* "View.MemoryView":226
7320  *
7321  *     @cname('get_memview')
7322  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
7323  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7324  *         return  memoryview(self, flags, self.dtype_is_object)
7325  */
7326 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)7327 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7328   int __pyx_v_flags;
7329   PyObject *__pyx_r = NULL;
7330   __Pyx_RefNannyDeclarations
7331   PyObject *__pyx_t_1 = NULL;
7332   PyObject *__pyx_t_2 = NULL;
7333   PyObject *__pyx_t_3 = NULL;
7334   int __pyx_lineno = 0;
7335   const char *__pyx_filename = NULL;
7336   int __pyx_clineno = 0;
7337   __Pyx_RefNannySetupContext("get_memview", 0);
7338 
7339   /* "View.MemoryView":227
7340  *     @cname('get_memview')
7341  *     cdef get_memview(self):
7342  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
7343  *         return  memoryview(self, flags, self.dtype_is_object)
7344  *
7345  */
7346   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7347 
7348   /* "View.MemoryView":228
7349  *     cdef get_memview(self):
7350  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7351  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
7352  *
7353  *     def __len__(self):
7354  */
7355   __Pyx_XDECREF(__pyx_r);
7356   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
7357   __Pyx_GOTREF(__pyx_t_1);
7358   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
7359   __Pyx_GOTREF(__pyx_t_2);
7360   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
7361   __Pyx_GOTREF(__pyx_t_3);
7362   __Pyx_INCREF(((PyObject *)__pyx_v_self));
7363   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7364   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7365   __Pyx_GIVEREF(__pyx_t_1);
7366   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7367   __Pyx_GIVEREF(__pyx_t_2);
7368   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7369   __pyx_t_1 = 0;
7370   __pyx_t_2 = 0;
7371   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
7372   __Pyx_GOTREF(__pyx_t_2);
7373   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7374   __pyx_r = __pyx_t_2;
7375   __pyx_t_2 = 0;
7376   goto __pyx_L0;
7377 
7378   /* "View.MemoryView":226
7379  *
7380  *     @cname('get_memview')
7381  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
7382  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7383  *         return  memoryview(self, flags, self.dtype_is_object)
7384  */
7385 
7386   /* function exit code */
7387   __pyx_L1_error:;
7388   __Pyx_XDECREF(__pyx_t_1);
7389   __Pyx_XDECREF(__pyx_t_2);
7390   __Pyx_XDECREF(__pyx_t_3);
7391   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7392   __pyx_r = 0;
7393   __pyx_L0:;
7394   __Pyx_XGIVEREF(__pyx_r);
7395   __Pyx_RefNannyFinishContext();
7396   return __pyx_r;
7397 }
7398 
7399 /* "View.MemoryView":230
7400  *         return  memoryview(self, flags, self.dtype_is_object)
7401  *
7402  *     def __len__(self):             # <<<<<<<<<<<<<<
7403  *         return self._shape[0]
7404  *
7405  */
7406 
7407 /* Python wrapper */
7408 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)7409 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7410   Py_ssize_t __pyx_r;
7411   __Pyx_RefNannyDeclarations
7412   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7413   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7414 
7415   /* function exit code */
7416   __Pyx_RefNannyFinishContext();
7417   return __pyx_r;
7418 }
7419 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)7420 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7421   Py_ssize_t __pyx_r;
7422   __Pyx_RefNannyDeclarations
7423   __Pyx_RefNannySetupContext("__len__", 0);
7424 
7425   /* "View.MemoryView":231
7426  *
7427  *     def __len__(self):
7428  *         return self._shape[0]             # <<<<<<<<<<<<<<
7429  *
7430  *     def __getattr__(self, attr):
7431  */
7432   __pyx_r = (__pyx_v_self->_shape[0]);
7433   goto __pyx_L0;
7434 
7435   /* "View.MemoryView":230
7436  *         return  memoryview(self, flags, self.dtype_is_object)
7437  *
7438  *     def __len__(self):             # <<<<<<<<<<<<<<
7439  *         return self._shape[0]
7440  *
7441  */
7442 
7443   /* function exit code */
7444   __pyx_L0:;
7445   __Pyx_RefNannyFinishContext();
7446   return __pyx_r;
7447 }
7448 
7449 /* "View.MemoryView":233
7450  *         return self._shape[0]
7451  *
7452  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
7453  *         return getattr(self.memview, attr)
7454  *
7455  */
7456 
7457 /* Python wrapper */
7458 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
__pyx_array___getattr__(PyObject * __pyx_v_self,PyObject * __pyx_v_attr)7459 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7460   PyObject *__pyx_r = 0;
7461   __Pyx_RefNannyDeclarations
7462   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7463   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7464 
7465   /* function exit code */
7466   __Pyx_RefNannyFinishContext();
7467   return __pyx_r;
7468 }
7469 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)7470 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7471   PyObject *__pyx_r = NULL;
7472   __Pyx_RefNannyDeclarations
7473   PyObject *__pyx_t_1 = NULL;
7474   PyObject *__pyx_t_2 = NULL;
7475   int __pyx_lineno = 0;
7476   const char *__pyx_filename = NULL;
7477   int __pyx_clineno = 0;
7478   __Pyx_RefNannySetupContext("__getattr__", 0);
7479 
7480   /* "View.MemoryView":234
7481  *
7482  *     def __getattr__(self, attr):
7483  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
7484  *
7485  *     def __getitem__(self, item):
7486  */
7487   __Pyx_XDECREF(__pyx_r);
7488   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
7489   __Pyx_GOTREF(__pyx_t_1);
7490   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
7491   __Pyx_GOTREF(__pyx_t_2);
7492   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7493   __pyx_r = __pyx_t_2;
7494   __pyx_t_2 = 0;
7495   goto __pyx_L0;
7496 
7497   /* "View.MemoryView":233
7498  *         return self._shape[0]
7499  *
7500  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
7501  *         return getattr(self.memview, attr)
7502  *
7503  */
7504 
7505   /* function exit code */
7506   __pyx_L1_error:;
7507   __Pyx_XDECREF(__pyx_t_1);
7508   __Pyx_XDECREF(__pyx_t_2);
7509   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7510   __pyx_r = NULL;
7511   __pyx_L0:;
7512   __Pyx_XGIVEREF(__pyx_r);
7513   __Pyx_RefNannyFinishContext();
7514   return __pyx_r;
7515 }
7516 
7517 /* "View.MemoryView":236
7518  *         return getattr(self.memview, attr)
7519  *
7520  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
7521  *         return self.memview[item]
7522  *
7523  */
7524 
7525 /* Python wrapper */
7526 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_array___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)7527 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7528   PyObject *__pyx_r = 0;
7529   __Pyx_RefNannyDeclarations
7530   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7531   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7532 
7533   /* function exit code */
7534   __Pyx_RefNannyFinishContext();
7535   return __pyx_r;
7536 }
7537 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)7538 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7539   PyObject *__pyx_r = NULL;
7540   __Pyx_RefNannyDeclarations
7541   PyObject *__pyx_t_1 = NULL;
7542   PyObject *__pyx_t_2 = NULL;
7543   int __pyx_lineno = 0;
7544   const char *__pyx_filename = NULL;
7545   int __pyx_clineno = 0;
7546   __Pyx_RefNannySetupContext("__getitem__", 0);
7547 
7548   /* "View.MemoryView":237
7549  *
7550  *     def __getitem__(self, item):
7551  *         return self.memview[item]             # <<<<<<<<<<<<<<
7552  *
7553  *     def __setitem__(self, item, value):
7554  */
7555   __Pyx_XDECREF(__pyx_r);
7556   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
7557   __Pyx_GOTREF(__pyx_t_1);
7558   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
7559   __Pyx_GOTREF(__pyx_t_2);
7560   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7561   __pyx_r = __pyx_t_2;
7562   __pyx_t_2 = 0;
7563   goto __pyx_L0;
7564 
7565   /* "View.MemoryView":236
7566  *         return getattr(self.memview, attr)
7567  *
7568  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
7569  *         return self.memview[item]
7570  *
7571  */
7572 
7573   /* function exit code */
7574   __pyx_L1_error:;
7575   __Pyx_XDECREF(__pyx_t_1);
7576   __Pyx_XDECREF(__pyx_t_2);
7577   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7578   __pyx_r = NULL;
7579   __pyx_L0:;
7580   __Pyx_XGIVEREF(__pyx_r);
7581   __Pyx_RefNannyFinishContext();
7582   return __pyx_r;
7583 }
7584 
7585 /* "View.MemoryView":239
7586  *         return self.memview[item]
7587  *
7588  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
7589  *         self.memview[item] = value
7590  *
7591  */
7592 
7593 /* Python wrapper */
7594 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
__pyx_array___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)7595 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7596   int __pyx_r;
7597   __Pyx_RefNannyDeclarations
7598   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7599   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7600 
7601   /* function exit code */
7602   __Pyx_RefNannyFinishContext();
7603   return __pyx_r;
7604 }
7605 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)7606 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7607   int __pyx_r;
7608   __Pyx_RefNannyDeclarations
7609   PyObject *__pyx_t_1 = NULL;
7610   int __pyx_lineno = 0;
7611   const char *__pyx_filename = NULL;
7612   int __pyx_clineno = 0;
7613   __Pyx_RefNannySetupContext("__setitem__", 0);
7614 
7615   /* "View.MemoryView":240
7616  *
7617  *     def __setitem__(self, item, value):
7618  *         self.memview[item] = value             # <<<<<<<<<<<<<<
7619  *
7620  *
7621  */
7622   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
7623   __Pyx_GOTREF(__pyx_t_1);
7624   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
7625   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7626 
7627   /* "View.MemoryView":239
7628  *         return self.memview[item]
7629  *
7630  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
7631  *         self.memview[item] = value
7632  *
7633  */
7634 
7635   /* function exit code */
7636   __pyx_r = 0;
7637   goto __pyx_L0;
7638   __pyx_L1_error:;
7639   __Pyx_XDECREF(__pyx_t_1);
7640   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7641   __pyx_r = -1;
7642   __pyx_L0:;
7643   __Pyx_RefNannyFinishContext();
7644   return __pyx_r;
7645 }
7646 
7647 /* "(tree fragment)":1
7648  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7649  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7650  * def __setstate_cython__(self, __pyx_state):
7651  */
7652 
7653 /* Python wrapper */
7654 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_array_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7655 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7656   PyObject *__pyx_r = 0;
7657   __Pyx_RefNannyDeclarations
7658   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7659   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7660 
7661   /* function exit code */
7662   __Pyx_RefNannyFinishContext();
7663   return __pyx_r;
7664 }
7665 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)7666 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7667   PyObject *__pyx_r = NULL;
7668   __Pyx_RefNannyDeclarations
7669   PyObject *__pyx_t_1 = NULL;
7670   int __pyx_lineno = 0;
7671   const char *__pyx_filename = NULL;
7672   int __pyx_clineno = 0;
7673   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7674 
7675   /* "(tree fragment)":2
7676  * def __reduce_cython__(self):
7677  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
7678  * def __setstate_cython__(self, __pyx_state):
7679  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7680  */
7681   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
7682   __Pyx_GOTREF(__pyx_t_1);
7683   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7684   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7685   __PYX_ERR(2, 2, __pyx_L1_error)
7686 
7687   /* "(tree fragment)":1
7688  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7689  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7690  * def __setstate_cython__(self, __pyx_state):
7691  */
7692 
7693   /* function exit code */
7694   __pyx_L1_error:;
7695   __Pyx_XDECREF(__pyx_t_1);
7696   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7697   __pyx_r = NULL;
7698   __Pyx_XGIVEREF(__pyx_r);
7699   __Pyx_RefNannyFinishContext();
7700   return __pyx_r;
7701 }
7702 
7703 /* "(tree fragment)":3
7704  * def __reduce_cython__(self):
7705  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7706  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7707  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7708  */
7709 
7710 /* Python wrapper */
7711 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_array_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)7712 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7713   PyObject *__pyx_r = 0;
7714   __Pyx_RefNannyDeclarations
7715   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7716   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7717 
7718   /* function exit code */
7719   __Pyx_RefNannyFinishContext();
7720   return __pyx_r;
7721 }
7722 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)7723 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7724   PyObject *__pyx_r = NULL;
7725   __Pyx_RefNannyDeclarations
7726   PyObject *__pyx_t_1 = NULL;
7727   int __pyx_lineno = 0;
7728   const char *__pyx_filename = NULL;
7729   int __pyx_clineno = 0;
7730   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7731 
7732   /* "(tree fragment)":4
7733  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7734  * def __setstate_cython__(self, __pyx_state):
7735  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
7736  */
7737   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
7738   __Pyx_GOTREF(__pyx_t_1);
7739   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7740   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7741   __PYX_ERR(2, 4, __pyx_L1_error)
7742 
7743   /* "(tree fragment)":3
7744  * def __reduce_cython__(self):
7745  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7746  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7747  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7748  */
7749 
7750   /* function exit code */
7751   __pyx_L1_error:;
7752   __Pyx_XDECREF(__pyx_t_1);
7753   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7754   __pyx_r = NULL;
7755   __Pyx_XGIVEREF(__pyx_r);
7756   __Pyx_RefNannyFinishContext();
7757   return __pyx_r;
7758 }
7759 
7760 /* "View.MemoryView":244
7761  *
7762  * @cname("__pyx_array_new")
7763  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
7764  *                           char *mode, char *buf):
7765  *     cdef array result
7766  */
7767 
__pyx_array_new(PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,char * __pyx_v_format,char * __pyx_v_mode,char * __pyx_v_buf)7768 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
7769   struct __pyx_array_obj *__pyx_v_result = 0;
7770   struct __pyx_array_obj *__pyx_r = NULL;
7771   __Pyx_RefNannyDeclarations
7772   int __pyx_t_1;
7773   PyObject *__pyx_t_2 = NULL;
7774   PyObject *__pyx_t_3 = NULL;
7775   PyObject *__pyx_t_4 = NULL;
7776   PyObject *__pyx_t_5 = NULL;
7777   int __pyx_lineno = 0;
7778   const char *__pyx_filename = NULL;
7779   int __pyx_clineno = 0;
7780   __Pyx_RefNannySetupContext("array_cwrapper", 0);
7781 
7782   /* "View.MemoryView":248
7783  *     cdef array result
7784  *
7785  *     if buf == NULL:             # <<<<<<<<<<<<<<
7786  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7787  *     else:
7788  */
7789   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7790   if (__pyx_t_1) {
7791 
7792     /* "View.MemoryView":249
7793  *
7794  *     if buf == NULL:
7795  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
7796  *     else:
7797  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7798  */
7799     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
7800     __Pyx_GOTREF(__pyx_t_2);
7801     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
7802     __Pyx_GOTREF(__pyx_t_3);
7803     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
7804     __Pyx_GOTREF(__pyx_t_4);
7805     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
7806     __Pyx_GOTREF(__pyx_t_5);
7807     __Pyx_INCREF(__pyx_v_shape);
7808     __Pyx_GIVEREF(__pyx_v_shape);
7809     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
7810     __Pyx_GIVEREF(__pyx_t_2);
7811     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7812     __Pyx_GIVEREF(__pyx_t_3);
7813     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
7814     __Pyx_GIVEREF(__pyx_t_4);
7815     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
7816     __pyx_t_2 = 0;
7817     __pyx_t_3 = 0;
7818     __pyx_t_4 = 0;
7819     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
7820     __Pyx_GOTREF(__pyx_t_4);
7821     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7822     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
7823     __pyx_t_4 = 0;
7824 
7825     /* "View.MemoryView":248
7826  *     cdef array result
7827  *
7828  *     if buf == NULL:             # <<<<<<<<<<<<<<
7829  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7830  *     else:
7831  */
7832     goto __pyx_L3;
7833   }
7834 
7835   /* "View.MemoryView":251
7836  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7837  *     else:
7838  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
7839  *                        allocate_buffer=False)
7840  *         result.data = buf
7841  */
7842   /*else*/ {
7843     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
7844     __Pyx_GOTREF(__pyx_t_4);
7845     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
7846     __Pyx_GOTREF(__pyx_t_5);
7847     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
7848     __Pyx_GOTREF(__pyx_t_3);
7849     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
7850     __Pyx_GOTREF(__pyx_t_2);
7851     __Pyx_INCREF(__pyx_v_shape);
7852     __Pyx_GIVEREF(__pyx_v_shape);
7853     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
7854     __Pyx_GIVEREF(__pyx_t_4);
7855     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7856     __Pyx_GIVEREF(__pyx_t_5);
7857     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
7858     __Pyx_GIVEREF(__pyx_t_3);
7859     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
7860     __pyx_t_4 = 0;
7861     __pyx_t_5 = 0;
7862     __pyx_t_3 = 0;
7863 
7864     /* "View.MemoryView":252
7865  *     else:
7866  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7867  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
7868  *         result.data = buf
7869  *
7870  */
7871     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
7872     __Pyx_GOTREF(__pyx_t_3);
7873     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
7874 
7875     /* "View.MemoryView":251
7876  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7877  *     else:
7878  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
7879  *                        allocate_buffer=False)
7880  *         result.data = buf
7881  */
7882     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
7883     __Pyx_GOTREF(__pyx_t_5);
7884     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7885     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7886     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
7887     __pyx_t_5 = 0;
7888 
7889     /* "View.MemoryView":253
7890  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7891  *                        allocate_buffer=False)
7892  *         result.data = buf             # <<<<<<<<<<<<<<
7893  *
7894  *     return result
7895  */
7896     __pyx_v_result->data = __pyx_v_buf;
7897   }
7898   __pyx_L3:;
7899 
7900   /* "View.MemoryView":255
7901  *         result.data = buf
7902  *
7903  *     return result             # <<<<<<<<<<<<<<
7904  *
7905  *
7906  */
7907   __Pyx_XDECREF(((PyObject *)__pyx_r));
7908   __Pyx_INCREF(((PyObject *)__pyx_v_result));
7909   __pyx_r = __pyx_v_result;
7910   goto __pyx_L0;
7911 
7912   /* "View.MemoryView":244
7913  *
7914  * @cname("__pyx_array_new")
7915  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
7916  *                           char *mode, char *buf):
7917  *     cdef array result
7918  */
7919 
7920   /* function exit code */
7921   __pyx_L1_error:;
7922   __Pyx_XDECREF(__pyx_t_2);
7923   __Pyx_XDECREF(__pyx_t_3);
7924   __Pyx_XDECREF(__pyx_t_4);
7925   __Pyx_XDECREF(__pyx_t_5);
7926   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7927   __pyx_r = 0;
7928   __pyx_L0:;
7929   __Pyx_XDECREF((PyObject *)__pyx_v_result);
7930   __Pyx_XGIVEREF((PyObject *)__pyx_r);
7931   __Pyx_RefNannyFinishContext();
7932   return __pyx_r;
7933 }
7934 
7935 /* "View.MemoryView":281
7936  * cdef class Enum(object):
7937  *     cdef object name
7938  *     def __init__(self, name):             # <<<<<<<<<<<<<<
7939  *         self.name = name
7940  *     def __repr__(self):
7941  */
7942 
7943 /* Python wrapper */
7944 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_MemviewEnum___init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7945 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7946   PyObject *__pyx_v_name = 0;
7947   int __pyx_lineno = 0;
7948   const char *__pyx_filename = NULL;
7949   int __pyx_clineno = 0;
7950   int __pyx_r;
7951   __Pyx_RefNannyDeclarations
7952   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7953   {
7954     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7955     PyObject* values[1] = {0};
7956     if (unlikely(__pyx_kwds)) {
7957       Py_ssize_t kw_args;
7958       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7959       switch (pos_args) {
7960         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7961         CYTHON_FALLTHROUGH;
7962         case  0: break;
7963         default: goto __pyx_L5_argtuple_error;
7964       }
7965       kw_args = PyDict_Size(__pyx_kwds);
7966       switch (pos_args) {
7967         case  0:
7968         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
7969         else goto __pyx_L5_argtuple_error;
7970       }
7971       if (unlikely(kw_args > 0)) {
7972         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
7973       }
7974     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
7975       goto __pyx_L5_argtuple_error;
7976     } else {
7977       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7978     }
7979     __pyx_v_name = values[0];
7980   }
7981   goto __pyx_L4_argument_unpacking_done;
7982   __pyx_L5_argtuple_error:;
7983   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
7984   __pyx_L3_error:;
7985   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7986   __Pyx_RefNannyFinishContext();
7987   return -1;
7988   __pyx_L4_argument_unpacking_done:;
7989   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7990 
7991   /* function exit code */
7992   __Pyx_RefNannyFinishContext();
7993   return __pyx_r;
7994 }
7995 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)7996 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7997   int __pyx_r;
7998   __Pyx_RefNannyDeclarations
7999   __Pyx_RefNannySetupContext("__init__", 0);
8000 
8001   /* "View.MemoryView":282
8002  *     cdef object name
8003  *     def __init__(self, name):
8004  *         self.name = name             # <<<<<<<<<<<<<<
8005  *     def __repr__(self):
8006  *         return self.name
8007  */
8008   __Pyx_INCREF(__pyx_v_name);
8009   __Pyx_GIVEREF(__pyx_v_name);
8010   __Pyx_GOTREF(__pyx_v_self->name);
8011   __Pyx_DECREF(__pyx_v_self->name);
8012   __pyx_v_self->name = __pyx_v_name;
8013 
8014   /* "View.MemoryView":281
8015  * cdef class Enum(object):
8016  *     cdef object name
8017  *     def __init__(self, name):             # <<<<<<<<<<<<<<
8018  *         self.name = name
8019  *     def __repr__(self):
8020  */
8021 
8022   /* function exit code */
8023   __pyx_r = 0;
8024   __Pyx_RefNannyFinishContext();
8025   return __pyx_r;
8026 }
8027 
8028 /* "View.MemoryView":283
8029  *     def __init__(self, name):
8030  *         self.name = name
8031  *     def __repr__(self):             # <<<<<<<<<<<<<<
8032  *         return self.name
8033  *
8034  */
8035 
8036 /* Python wrapper */
8037 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)8038 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8039   PyObject *__pyx_r = 0;
8040   __Pyx_RefNannyDeclarations
8041   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8042   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8043 
8044   /* function exit code */
8045   __Pyx_RefNannyFinishContext();
8046   return __pyx_r;
8047 }
8048 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)8049 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8050   PyObject *__pyx_r = NULL;
8051   __Pyx_RefNannyDeclarations
8052   __Pyx_RefNannySetupContext("__repr__", 0);
8053 
8054   /* "View.MemoryView":284
8055  *         self.name = name
8056  *     def __repr__(self):
8057  *         return self.name             # <<<<<<<<<<<<<<
8058  *
8059  * cdef generic = Enum("<strided and direct or indirect>")
8060  */
8061   __Pyx_XDECREF(__pyx_r);
8062   __Pyx_INCREF(__pyx_v_self->name);
8063   __pyx_r = __pyx_v_self->name;
8064   goto __pyx_L0;
8065 
8066   /* "View.MemoryView":283
8067  *     def __init__(self, name):
8068  *         self.name = name
8069  *     def __repr__(self):             # <<<<<<<<<<<<<<
8070  *         return self.name
8071  *
8072  */
8073 
8074   /* function exit code */
8075   __pyx_L0:;
8076   __Pyx_XGIVEREF(__pyx_r);
8077   __Pyx_RefNannyFinishContext();
8078   return __pyx_r;
8079 }
8080 
8081 /* "(tree fragment)":1
8082  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8083  *     cdef tuple state
8084  *     cdef object _dict
8085  */
8086 
8087 /* Python wrapper */
8088 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8089 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8090   PyObject *__pyx_r = 0;
8091   __Pyx_RefNannyDeclarations
8092   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8093   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8094 
8095   /* function exit code */
8096   __Pyx_RefNannyFinishContext();
8097   return __pyx_r;
8098 }
8099 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)8100 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8101   PyObject *__pyx_v_state = 0;
8102   PyObject *__pyx_v__dict = 0;
8103   int __pyx_v_use_setstate;
8104   PyObject *__pyx_r = NULL;
8105   __Pyx_RefNannyDeclarations
8106   PyObject *__pyx_t_1 = NULL;
8107   int __pyx_t_2;
8108   int __pyx_t_3;
8109   PyObject *__pyx_t_4 = NULL;
8110   PyObject *__pyx_t_5 = NULL;
8111   int __pyx_lineno = 0;
8112   const char *__pyx_filename = NULL;
8113   int __pyx_clineno = 0;
8114   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8115 
8116   /* "(tree fragment)":5
8117  *     cdef object _dict
8118  *     cdef bint use_setstate
8119  *     state = (self.name,)             # <<<<<<<<<<<<<<
8120  *     _dict = getattr(self, '__dict__', None)
8121  *     if _dict is not None:
8122  */
8123   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
8124   __Pyx_GOTREF(__pyx_t_1);
8125   __Pyx_INCREF(__pyx_v_self->name);
8126   __Pyx_GIVEREF(__pyx_v_self->name);
8127   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8128   __pyx_v_state = ((PyObject*)__pyx_t_1);
8129   __pyx_t_1 = 0;
8130 
8131   /* "(tree fragment)":6
8132  *     cdef bint use_setstate
8133  *     state = (self.name,)
8134  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
8135  *     if _dict is not None:
8136  *         state += (_dict,)
8137  */
8138   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
8139   __Pyx_GOTREF(__pyx_t_1);
8140   __pyx_v__dict = __pyx_t_1;
8141   __pyx_t_1 = 0;
8142 
8143   /* "(tree fragment)":7
8144  *     state = (self.name,)
8145  *     _dict = getattr(self, '__dict__', None)
8146  *     if _dict is not None:             # <<<<<<<<<<<<<<
8147  *         state += (_dict,)
8148  *         use_setstate = True
8149  */
8150   __pyx_t_2 = (__pyx_v__dict != Py_None);
8151   __pyx_t_3 = (__pyx_t_2 != 0);
8152   if (__pyx_t_3) {
8153 
8154     /* "(tree fragment)":8
8155  *     _dict = getattr(self, '__dict__', None)
8156  *     if _dict is not None:
8157  *         state += (_dict,)             # <<<<<<<<<<<<<<
8158  *         use_setstate = True
8159  *     else:
8160  */
8161     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
8162     __Pyx_GOTREF(__pyx_t_1);
8163     __Pyx_INCREF(__pyx_v__dict);
8164     __Pyx_GIVEREF(__pyx_v__dict);
8165     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8166     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
8167     __Pyx_GOTREF(__pyx_t_4);
8168     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8169     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8170     __pyx_t_4 = 0;
8171 
8172     /* "(tree fragment)":9
8173  *     if _dict is not None:
8174  *         state += (_dict,)
8175  *         use_setstate = True             # <<<<<<<<<<<<<<
8176  *     else:
8177  *         use_setstate = self.name is not None
8178  */
8179     __pyx_v_use_setstate = 1;
8180 
8181     /* "(tree fragment)":7
8182  *     state = (self.name,)
8183  *     _dict = getattr(self, '__dict__', None)
8184  *     if _dict is not None:             # <<<<<<<<<<<<<<
8185  *         state += (_dict,)
8186  *         use_setstate = True
8187  */
8188     goto __pyx_L3;
8189   }
8190 
8191   /* "(tree fragment)":11
8192  *         use_setstate = True
8193  *     else:
8194  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
8195  *     if use_setstate:
8196  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8197  */
8198   /*else*/ {
8199     __pyx_t_3 = (__pyx_v_self->name != Py_None);
8200     __pyx_v_use_setstate = __pyx_t_3;
8201   }
8202   __pyx_L3:;
8203 
8204   /* "(tree fragment)":12
8205  *     else:
8206  *         use_setstate = self.name is not None
8207  *     if use_setstate:             # <<<<<<<<<<<<<<
8208  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8209  *     else:
8210  */
8211   __pyx_t_3 = (__pyx_v_use_setstate != 0);
8212   if (__pyx_t_3) {
8213 
8214     /* "(tree fragment)":13
8215  *         use_setstate = self.name is not None
8216  *     if use_setstate:
8217  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
8218  *     else:
8219  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8220  */
8221     __Pyx_XDECREF(__pyx_r);
8222     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
8223     __Pyx_GOTREF(__pyx_t_4);
8224     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
8225     __Pyx_GOTREF(__pyx_t_1);
8226     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8227     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8228     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8229     __Pyx_INCREF(__pyx_int_184977713);
8230     __Pyx_GIVEREF(__pyx_int_184977713);
8231     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8232     __Pyx_INCREF(Py_None);
8233     __Pyx_GIVEREF(Py_None);
8234     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8235     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
8236     __Pyx_GOTREF(__pyx_t_5);
8237     __Pyx_GIVEREF(__pyx_t_4);
8238     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8239     __Pyx_GIVEREF(__pyx_t_1);
8240     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8241     __Pyx_INCREF(__pyx_v_state);
8242     __Pyx_GIVEREF(__pyx_v_state);
8243     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8244     __pyx_t_4 = 0;
8245     __pyx_t_1 = 0;
8246     __pyx_r = __pyx_t_5;
8247     __pyx_t_5 = 0;
8248     goto __pyx_L0;
8249 
8250     /* "(tree fragment)":12
8251  *     else:
8252  *         use_setstate = self.name is not None
8253  *     if use_setstate:             # <<<<<<<<<<<<<<
8254  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8255  *     else:
8256  */
8257   }
8258 
8259   /* "(tree fragment)":15
8260  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8261  *     else:
8262  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
8263  * def __setstate_cython__(self, __pyx_state):
8264  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
8265  */
8266   /*else*/ {
8267     __Pyx_XDECREF(__pyx_r);
8268     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
8269     __Pyx_GOTREF(__pyx_t_5);
8270     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
8271     __Pyx_GOTREF(__pyx_t_1);
8272     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8273     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8274     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8275     __Pyx_INCREF(__pyx_int_184977713);
8276     __Pyx_GIVEREF(__pyx_int_184977713);
8277     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8278     __Pyx_INCREF(__pyx_v_state);
8279     __Pyx_GIVEREF(__pyx_v_state);
8280     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8281     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
8282     __Pyx_GOTREF(__pyx_t_4);
8283     __Pyx_GIVEREF(__pyx_t_5);
8284     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8285     __Pyx_GIVEREF(__pyx_t_1);
8286     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8287     __pyx_t_5 = 0;
8288     __pyx_t_1 = 0;
8289     __pyx_r = __pyx_t_4;
8290     __pyx_t_4 = 0;
8291     goto __pyx_L0;
8292   }
8293 
8294   /* "(tree fragment)":1
8295  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8296  *     cdef tuple state
8297  *     cdef object _dict
8298  */
8299 
8300   /* function exit code */
8301   __pyx_L1_error:;
8302   __Pyx_XDECREF(__pyx_t_1);
8303   __Pyx_XDECREF(__pyx_t_4);
8304   __Pyx_XDECREF(__pyx_t_5);
8305   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8306   __pyx_r = NULL;
8307   __pyx_L0:;
8308   __Pyx_XDECREF(__pyx_v_state);
8309   __Pyx_XDECREF(__pyx_v__dict);
8310   __Pyx_XGIVEREF(__pyx_r);
8311   __Pyx_RefNannyFinishContext();
8312   return __pyx_r;
8313 }
8314 
8315 /* "(tree fragment)":16
8316  *     else:
8317  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8318  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8319  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
8320  */
8321 
8322 /* Python wrapper */
8323 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)8324 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8325   PyObject *__pyx_r = 0;
8326   __Pyx_RefNannyDeclarations
8327   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8328   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8329 
8330   /* function exit code */
8331   __Pyx_RefNannyFinishContext();
8332   return __pyx_r;
8333 }
8334 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)8335 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8336   PyObject *__pyx_r = NULL;
8337   __Pyx_RefNannyDeclarations
8338   PyObject *__pyx_t_1 = NULL;
8339   int __pyx_lineno = 0;
8340   const char *__pyx_filename = NULL;
8341   int __pyx_clineno = 0;
8342   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8343 
8344   /* "(tree fragment)":17
8345  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8346  * def __setstate_cython__(self, __pyx_state):
8347  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
8348  */
8349   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
8350   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
8351   __Pyx_GOTREF(__pyx_t_1);
8352   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8353 
8354   /* "(tree fragment)":16
8355  *     else:
8356  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8357  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8358  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
8359  */
8360 
8361   /* function exit code */
8362   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8363   goto __pyx_L0;
8364   __pyx_L1_error:;
8365   __Pyx_XDECREF(__pyx_t_1);
8366   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8367   __pyx_r = NULL;
8368   __pyx_L0:;
8369   __Pyx_XGIVEREF(__pyx_r);
8370   __Pyx_RefNannyFinishContext();
8371   return __pyx_r;
8372 }
8373 
8374 /* "View.MemoryView":298
8375  *
8376  * @cname('__pyx_align_pointer')
8377  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
8378  *     "Align pointer memory on a given boundary"
8379  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8380  */
8381 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)8382 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
8383   Py_intptr_t __pyx_v_aligned_p;
8384   size_t __pyx_v_offset;
8385   void *__pyx_r;
8386   int __pyx_t_1;
8387 
8388   /* "View.MemoryView":300
8389  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
8390  *     "Align pointer memory on a given boundary"
8391  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
8392  *     cdef size_t offset
8393  *
8394  */
8395   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8396 
8397   /* "View.MemoryView":304
8398  *
8399  *     with cython.cdivision(True):
8400  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
8401  *
8402  *     if offset > 0:
8403  */
8404   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8405 
8406   /* "View.MemoryView":306
8407  *         offset = aligned_p % alignment
8408  *
8409  *     if offset > 0:             # <<<<<<<<<<<<<<
8410  *         aligned_p += alignment - offset
8411  *
8412  */
8413   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8414   if (__pyx_t_1) {
8415 
8416     /* "View.MemoryView":307
8417  *
8418  *     if offset > 0:
8419  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
8420  *
8421  *     return <void *> aligned_p
8422  */
8423     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8424 
8425     /* "View.MemoryView":306
8426  *         offset = aligned_p % alignment
8427  *
8428  *     if offset > 0:             # <<<<<<<<<<<<<<
8429  *         aligned_p += alignment - offset
8430  *
8431  */
8432   }
8433 
8434   /* "View.MemoryView":309
8435  *         aligned_p += alignment - offset
8436  *
8437  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
8438  *
8439  *
8440  */
8441   __pyx_r = ((void *)__pyx_v_aligned_p);
8442   goto __pyx_L0;
8443 
8444   /* "View.MemoryView":298
8445  *
8446  * @cname('__pyx_align_pointer')
8447  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
8448  *     "Align pointer memory on a given boundary"
8449  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8450  */
8451 
8452   /* function exit code */
8453   __pyx_L0:;
8454   return __pyx_r;
8455 }
8456 
8457 /* "View.MemoryView":345
8458  *     cdef __Pyx_TypeInfo *typeinfo
8459  *
8460  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
8461  *         self.obj = obj
8462  *         self.flags = flags
8463  */
8464 
8465 /* Python wrapper */
8466 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_memoryview___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8467 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8468   PyObject *__pyx_v_obj = 0;
8469   int __pyx_v_flags;
8470   int __pyx_v_dtype_is_object;
8471   int __pyx_lineno = 0;
8472   const char *__pyx_filename = NULL;
8473   int __pyx_clineno = 0;
8474   int __pyx_r;
8475   __Pyx_RefNannyDeclarations
8476   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8477   {
8478     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8479     PyObject* values[3] = {0,0,0};
8480     if (unlikely(__pyx_kwds)) {
8481       Py_ssize_t kw_args;
8482       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8483       switch (pos_args) {
8484         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8485         CYTHON_FALLTHROUGH;
8486         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8487         CYTHON_FALLTHROUGH;
8488         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8489         CYTHON_FALLTHROUGH;
8490         case  0: break;
8491         default: goto __pyx_L5_argtuple_error;
8492       }
8493       kw_args = PyDict_Size(__pyx_kwds);
8494       switch (pos_args) {
8495         case  0:
8496         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8497         else goto __pyx_L5_argtuple_error;
8498         CYTHON_FALLTHROUGH;
8499         case  1:
8500         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8501         else {
8502           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
8503         }
8504         CYTHON_FALLTHROUGH;
8505         case  2:
8506         if (kw_args > 0) {
8507           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8508           if (value) { values[2] = value; kw_args--; }
8509         }
8510       }
8511       if (unlikely(kw_args > 0)) {
8512         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
8513       }
8514     } else {
8515       switch (PyTuple_GET_SIZE(__pyx_args)) {
8516         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8517         CYTHON_FALLTHROUGH;
8518         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8519         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8520         break;
8521         default: goto __pyx_L5_argtuple_error;
8522       }
8523     }
8524     __pyx_v_obj = values[0];
8525     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
8526     if (values[2]) {
8527       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
8528     } else {
8529       __pyx_v_dtype_is_object = ((int)0);
8530     }
8531   }
8532   goto __pyx_L4_argument_unpacking_done;
8533   __pyx_L5_argtuple_error:;
8534   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
8535   __pyx_L3_error:;
8536   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8537   __Pyx_RefNannyFinishContext();
8538   return -1;
8539   __pyx_L4_argument_unpacking_done:;
8540   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8541 
8542   /* function exit code */
8543   __Pyx_RefNannyFinishContext();
8544   return __pyx_r;
8545 }
8546 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj,int __pyx_v_flags,int __pyx_v_dtype_is_object)8547 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
8548   int __pyx_r;
8549   __Pyx_RefNannyDeclarations
8550   int __pyx_t_1;
8551   int __pyx_t_2;
8552   int __pyx_t_3;
8553   int __pyx_t_4;
8554   int __pyx_lineno = 0;
8555   const char *__pyx_filename = NULL;
8556   int __pyx_clineno = 0;
8557   __Pyx_RefNannySetupContext("__cinit__", 0);
8558 
8559   /* "View.MemoryView":346
8560  *
8561  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8562  *         self.obj = obj             # <<<<<<<<<<<<<<
8563  *         self.flags = flags
8564  *         if type(self) is memoryview or obj is not None:
8565  */
8566   __Pyx_INCREF(__pyx_v_obj);
8567   __Pyx_GIVEREF(__pyx_v_obj);
8568   __Pyx_GOTREF(__pyx_v_self->obj);
8569   __Pyx_DECREF(__pyx_v_self->obj);
8570   __pyx_v_self->obj = __pyx_v_obj;
8571 
8572   /* "View.MemoryView":347
8573  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8574  *         self.obj = obj
8575  *         self.flags = flags             # <<<<<<<<<<<<<<
8576  *         if type(self) is memoryview or obj is not None:
8577  *             __Pyx_GetBuffer(obj, &self.view, flags)
8578  */
8579   __pyx_v_self->flags = __pyx_v_flags;
8580 
8581   /* "View.MemoryView":348
8582  *         self.obj = obj
8583  *         self.flags = flags
8584  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
8585  *             __Pyx_GetBuffer(obj, &self.view, flags)
8586  *             if <PyObject *> self.view.obj == NULL:
8587  */
8588   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8589   __pyx_t_3 = (__pyx_t_2 != 0);
8590   if (!__pyx_t_3) {
8591   } else {
8592     __pyx_t_1 = __pyx_t_3;
8593     goto __pyx_L4_bool_binop_done;
8594   }
8595   __pyx_t_3 = (__pyx_v_obj != Py_None);
8596   __pyx_t_2 = (__pyx_t_3 != 0);
8597   __pyx_t_1 = __pyx_t_2;
8598   __pyx_L4_bool_binop_done:;
8599   if (__pyx_t_1) {
8600 
8601     /* "View.MemoryView":349
8602  *         self.flags = flags
8603  *         if type(self) is memoryview or obj is not None:
8604  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
8605  *             if <PyObject *> self.view.obj == NULL:
8606  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8607  */
8608     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
8609 
8610     /* "View.MemoryView":350
8611  *         if type(self) is memoryview or obj is not None:
8612  *             __Pyx_GetBuffer(obj, &self.view, flags)
8613  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
8614  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8615  *                 Py_INCREF(Py_None)
8616  */
8617     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8618     if (__pyx_t_1) {
8619 
8620       /* "View.MemoryView":351
8621  *             __Pyx_GetBuffer(obj, &self.view, flags)
8622  *             if <PyObject *> self.view.obj == NULL:
8623  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
8624  *                 Py_INCREF(Py_None)
8625  *
8626  */
8627       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8628 
8629       /* "View.MemoryView":352
8630  *             if <PyObject *> self.view.obj == NULL:
8631  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8632  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
8633  *
8634  *         global __pyx_memoryview_thread_locks_used
8635  */
8636       Py_INCREF(Py_None);
8637 
8638       /* "View.MemoryView":350
8639  *         if type(self) is memoryview or obj is not None:
8640  *             __Pyx_GetBuffer(obj, &self.view, flags)
8641  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
8642  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8643  *                 Py_INCREF(Py_None)
8644  */
8645     }
8646 
8647     /* "View.MemoryView":348
8648  *         self.obj = obj
8649  *         self.flags = flags
8650  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
8651  *             __Pyx_GetBuffer(obj, &self.view, flags)
8652  *             if <PyObject *> self.view.obj == NULL:
8653  */
8654   }
8655 
8656   /* "View.MemoryView":355
8657  *
8658  *         global __pyx_memoryview_thread_locks_used
8659  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
8660  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8661  *             __pyx_memoryview_thread_locks_used += 1
8662  */
8663   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8664   if (__pyx_t_1) {
8665 
8666     /* "View.MemoryView":356
8667  *         global __pyx_memoryview_thread_locks_used
8668  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8669  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
8670  *             __pyx_memoryview_thread_locks_used += 1
8671  *         if self.lock is NULL:
8672  */
8673     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8674 
8675     /* "View.MemoryView":357
8676  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8677  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8678  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
8679  *         if self.lock is NULL:
8680  *             self.lock = PyThread_allocate_lock()
8681  */
8682     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8683 
8684     /* "View.MemoryView":355
8685  *
8686  *         global __pyx_memoryview_thread_locks_used
8687  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
8688  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8689  *             __pyx_memoryview_thread_locks_used += 1
8690  */
8691   }
8692 
8693   /* "View.MemoryView":358
8694  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8695  *             __pyx_memoryview_thread_locks_used += 1
8696  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
8697  *             self.lock = PyThread_allocate_lock()
8698  *             if self.lock is NULL:
8699  */
8700   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8701   if (__pyx_t_1) {
8702 
8703     /* "View.MemoryView":359
8704  *             __pyx_memoryview_thread_locks_used += 1
8705  *         if self.lock is NULL:
8706  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
8707  *             if self.lock is NULL:
8708  *                 raise MemoryError
8709  */
8710     __pyx_v_self->lock = PyThread_allocate_lock();
8711 
8712     /* "View.MemoryView":360
8713  *         if self.lock is NULL:
8714  *             self.lock = PyThread_allocate_lock()
8715  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
8716  *                 raise MemoryError
8717  *
8718  */
8719     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8720     if (unlikely(__pyx_t_1)) {
8721 
8722       /* "View.MemoryView":361
8723  *             self.lock = PyThread_allocate_lock()
8724  *             if self.lock is NULL:
8725  *                 raise MemoryError             # <<<<<<<<<<<<<<
8726  *
8727  *         if flags & PyBUF_FORMAT:
8728  */
8729       PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
8730 
8731       /* "View.MemoryView":360
8732  *         if self.lock is NULL:
8733  *             self.lock = PyThread_allocate_lock()
8734  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
8735  *                 raise MemoryError
8736  *
8737  */
8738     }
8739 
8740     /* "View.MemoryView":358
8741  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8742  *             __pyx_memoryview_thread_locks_used += 1
8743  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
8744  *             self.lock = PyThread_allocate_lock()
8745  *             if self.lock is NULL:
8746  */
8747   }
8748 
8749   /* "View.MemoryView":363
8750  *                 raise MemoryError
8751  *
8752  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8753  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8754  *         else:
8755  */
8756   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8757   if (__pyx_t_1) {
8758 
8759     /* "View.MemoryView":364
8760  *
8761  *         if flags & PyBUF_FORMAT:
8762  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
8763  *         else:
8764  *             self.dtype_is_object = dtype_is_object
8765  */
8766     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
8767     if (__pyx_t_2) {
8768     } else {
8769       __pyx_t_1 = __pyx_t_2;
8770       goto __pyx_L11_bool_binop_done;
8771     }
8772     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
8773     __pyx_t_1 = __pyx_t_2;
8774     __pyx_L11_bool_binop_done:;
8775     __pyx_v_self->dtype_is_object = __pyx_t_1;
8776 
8777     /* "View.MemoryView":363
8778  *                 raise MemoryError
8779  *
8780  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8781  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8782  *         else:
8783  */
8784     goto __pyx_L10;
8785   }
8786 
8787   /* "View.MemoryView":366
8788  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8789  *         else:
8790  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
8791  *
8792  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8793  */
8794   /*else*/ {
8795     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8796   }
8797   __pyx_L10:;
8798 
8799   /* "View.MemoryView":368
8800  *             self.dtype_is_object = dtype_is_object
8801  *
8802  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
8803  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
8804  *         self.typeinfo = NULL
8805  */
8806   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
8807 
8808   /* "View.MemoryView":370
8809  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8810  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
8811  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
8812  *
8813  *     def __dealloc__(memoryview self):
8814  */
8815   __pyx_v_self->typeinfo = NULL;
8816 
8817   /* "View.MemoryView":345
8818  *     cdef __Pyx_TypeInfo *typeinfo
8819  *
8820  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
8821  *         self.obj = obj
8822  *         self.flags = flags
8823  */
8824 
8825   /* function exit code */
8826   __pyx_r = 0;
8827   goto __pyx_L0;
8828   __pyx_L1_error:;
8829   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8830   __pyx_r = -1;
8831   __pyx_L0:;
8832   __Pyx_RefNannyFinishContext();
8833   return __pyx_r;
8834 }
8835 
8836 /* "View.MemoryView":372
8837  *         self.typeinfo = NULL
8838  *
8839  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
8840  *         if self.obj is not None:
8841  *             __Pyx_ReleaseBuffer(&self.view)
8842  */
8843 
8844 /* Python wrapper */
8845 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)8846 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8847   __Pyx_RefNannyDeclarations
8848   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8849   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8850 
8851   /* function exit code */
8852   __Pyx_RefNannyFinishContext();
8853 }
8854 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)8855 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8856   int __pyx_v_i;
8857   __Pyx_RefNannyDeclarations
8858   int __pyx_t_1;
8859   int __pyx_t_2;
8860   int __pyx_t_3;
8861   int __pyx_t_4;
8862   int __pyx_t_5;
8863   PyThread_type_lock __pyx_t_6;
8864   PyThread_type_lock __pyx_t_7;
8865   __Pyx_RefNannySetupContext("__dealloc__", 0);
8866 
8867   /* "View.MemoryView":373
8868  *
8869  *     def __dealloc__(memoryview self):
8870  *         if self.obj is not None:             # <<<<<<<<<<<<<<
8871  *             __Pyx_ReleaseBuffer(&self.view)
8872  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
8873  */
8874   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8875   __pyx_t_2 = (__pyx_t_1 != 0);
8876   if (__pyx_t_2) {
8877 
8878     /* "View.MemoryView":374
8879  *     def __dealloc__(memoryview self):
8880  *         if self.obj is not None:
8881  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
8882  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
8883  *
8884  */
8885     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8886 
8887     /* "View.MemoryView":373
8888  *
8889  *     def __dealloc__(memoryview self):
8890  *         if self.obj is not None:             # <<<<<<<<<<<<<<
8891  *             __Pyx_ReleaseBuffer(&self.view)
8892  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
8893  */
8894     goto __pyx_L3;
8895   }
8896 
8897   /* "View.MemoryView":375
8898  *         if self.obj is not None:
8899  *             __Pyx_ReleaseBuffer(&self.view)
8900  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
8901  *
8902  *             (<__pyx_buffer *> &self.view).obj = NULL
8903  */
8904   __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
8905   if (__pyx_t_2) {
8906 
8907     /* "View.MemoryView":377
8908  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
8909  *
8910  *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
8911  *             Py_DECREF(Py_None)
8912  *
8913  */
8914     ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8915 
8916     /* "View.MemoryView":378
8917  *
8918  *             (<__pyx_buffer *> &self.view).obj = NULL
8919  *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
8920  *
8921  *         cdef int i
8922  */
8923     Py_DECREF(Py_None);
8924 
8925     /* "View.MemoryView":375
8926  *         if self.obj is not None:
8927  *             __Pyx_ReleaseBuffer(&self.view)
8928  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
8929  *
8930  *             (<__pyx_buffer *> &self.view).obj = NULL
8931  */
8932   }
8933   __pyx_L3:;
8934 
8935   /* "View.MemoryView":382
8936  *         cdef int i
8937  *         global __pyx_memoryview_thread_locks_used
8938  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
8939  *             for i in range(__pyx_memoryview_thread_locks_used):
8940  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8941  */
8942   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
8943   if (__pyx_t_2) {
8944 
8945     /* "View.MemoryView":383
8946  *         global __pyx_memoryview_thread_locks_used
8947  *         if self.lock != NULL:
8948  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
8949  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8950  *                     __pyx_memoryview_thread_locks_used -= 1
8951  */
8952     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
8953     __pyx_t_4 = __pyx_t_3;
8954     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
8955       __pyx_v_i = __pyx_t_5;
8956 
8957       /* "View.MemoryView":384
8958  *         if self.lock != NULL:
8959  *             for i in range(__pyx_memoryview_thread_locks_used):
8960  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
8961  *                     __pyx_memoryview_thread_locks_used -= 1
8962  *                     if i != __pyx_memoryview_thread_locks_used:
8963  */
8964       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
8965       if (__pyx_t_2) {
8966 
8967         /* "View.MemoryView":385
8968  *             for i in range(__pyx_memoryview_thread_locks_used):
8969  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8970  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
8971  *                     if i != __pyx_memoryview_thread_locks_used:
8972  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8973  */
8974         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8975 
8976         /* "View.MemoryView":386
8977  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8978  *                     __pyx_memoryview_thread_locks_used -= 1
8979  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
8980  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8981  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8982  */
8983         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
8984         if (__pyx_t_2) {
8985 
8986           /* "View.MemoryView":388
8987  *                     if i != __pyx_memoryview_thread_locks_used:
8988  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8989  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
8990  *                     break
8991  *             else:
8992  */
8993           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8994           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8995 
8996           /* "View.MemoryView":387
8997  *                     __pyx_memoryview_thread_locks_used -= 1
8998  *                     if i != __pyx_memoryview_thread_locks_used:
8999  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
9000  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9001  *                     break
9002  */
9003           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9004           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9005 
9006           /* "View.MemoryView":386
9007  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
9008  *                     __pyx_memoryview_thread_locks_used -= 1
9009  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
9010  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9011  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9012  */
9013         }
9014 
9015         /* "View.MemoryView":389
9016  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9017  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9018  *                     break             # <<<<<<<<<<<<<<
9019  *             else:
9020  *                 PyThread_free_lock(self.lock)
9021  */
9022         goto __pyx_L6_break;
9023 
9024         /* "View.MemoryView":384
9025  *         if self.lock != NULL:
9026  *             for i in range(__pyx_memoryview_thread_locks_used):
9027  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
9028  *                     __pyx_memoryview_thread_locks_used -= 1
9029  *                     if i != __pyx_memoryview_thread_locks_used:
9030  */
9031       }
9032     }
9033     /*else*/ {
9034 
9035       /* "View.MemoryView":391
9036  *                     break
9037  *             else:
9038  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
9039  *
9040  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
9041  */
9042       PyThread_free_lock(__pyx_v_self->lock);
9043     }
9044     __pyx_L6_break:;
9045 
9046     /* "View.MemoryView":382
9047  *         cdef int i
9048  *         global __pyx_memoryview_thread_locks_used
9049  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
9050  *             for i in range(__pyx_memoryview_thread_locks_used):
9051  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
9052  */
9053   }
9054 
9055   /* "View.MemoryView":372
9056  *         self.typeinfo = NULL
9057  *
9058  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
9059  *         if self.obj is not None:
9060  *             __Pyx_ReleaseBuffer(&self.view)
9061  */
9062 
9063   /* function exit code */
9064   __Pyx_RefNannyFinishContext();
9065 }
9066 
9067 /* "View.MemoryView":393
9068  *                 PyThread_free_lock(self.lock)
9069  *
9070  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
9071  *         cdef Py_ssize_t dim
9072  *         cdef char *itemp = <char *> self.view.buf
9073  */
9074 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)9075 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9076   Py_ssize_t __pyx_v_dim;
9077   char *__pyx_v_itemp;
9078   PyObject *__pyx_v_idx = NULL;
9079   char *__pyx_r;
9080   __Pyx_RefNannyDeclarations
9081   Py_ssize_t __pyx_t_1;
9082   PyObject *__pyx_t_2 = NULL;
9083   Py_ssize_t __pyx_t_3;
9084   PyObject *(*__pyx_t_4)(PyObject *);
9085   PyObject *__pyx_t_5 = NULL;
9086   Py_ssize_t __pyx_t_6;
9087   char *__pyx_t_7;
9088   int __pyx_lineno = 0;
9089   const char *__pyx_filename = NULL;
9090   int __pyx_clineno = 0;
9091   __Pyx_RefNannySetupContext("get_item_pointer", 0);
9092 
9093   /* "View.MemoryView":395
9094  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
9095  *         cdef Py_ssize_t dim
9096  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
9097  *
9098  *         for dim, idx in enumerate(index):
9099  */
9100   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9101 
9102   /* "View.MemoryView":397
9103  *         cdef char *itemp = <char *> self.view.buf
9104  *
9105  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
9106  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
9107  *
9108  */
9109   __pyx_t_1 = 0;
9110   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9111     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9112     __pyx_t_4 = NULL;
9113   } else {
9114     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
9115     __Pyx_GOTREF(__pyx_t_2);
9116     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
9117   }
9118   for (;;) {
9119     if (likely(!__pyx_t_4)) {
9120       if (likely(PyList_CheckExact(__pyx_t_2))) {
9121         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
9122         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9123         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
9124         #else
9125         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
9126         __Pyx_GOTREF(__pyx_t_5);
9127         #endif
9128       } else {
9129         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9130         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9131         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 397, __pyx_L1_error)
9132         #else
9133         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
9134         __Pyx_GOTREF(__pyx_t_5);
9135         #endif
9136       }
9137     } else {
9138       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9139       if (unlikely(!__pyx_t_5)) {
9140         PyObject* exc_type = PyErr_Occurred();
9141         if (exc_type) {
9142           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9143           else __PYX_ERR(2, 397, __pyx_L1_error)
9144         }
9145         break;
9146       }
9147       __Pyx_GOTREF(__pyx_t_5);
9148     }
9149     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9150     __pyx_t_5 = 0;
9151     __pyx_v_dim = __pyx_t_1;
9152     __pyx_t_1 = (__pyx_t_1 + 1);
9153 
9154     /* "View.MemoryView":398
9155  *
9156  *         for dim, idx in enumerate(index):
9157  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
9158  *
9159  *         return itemp
9160  */
9161     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
9162     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 398, __pyx_L1_error)
9163     __pyx_v_itemp = __pyx_t_7;
9164 
9165     /* "View.MemoryView":397
9166  *         cdef char *itemp = <char *> self.view.buf
9167  *
9168  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
9169  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
9170  *
9171  */
9172   }
9173   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9174 
9175   /* "View.MemoryView":400
9176  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
9177  *
9178  *         return itemp             # <<<<<<<<<<<<<<
9179  *
9180  *
9181  */
9182   __pyx_r = __pyx_v_itemp;
9183   goto __pyx_L0;
9184 
9185   /* "View.MemoryView":393
9186  *                 PyThread_free_lock(self.lock)
9187  *
9188  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
9189  *         cdef Py_ssize_t dim
9190  *         cdef char *itemp = <char *> self.view.buf
9191  */
9192 
9193   /* function exit code */
9194   __pyx_L1_error:;
9195   __Pyx_XDECREF(__pyx_t_2);
9196   __Pyx_XDECREF(__pyx_t_5);
9197   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9198   __pyx_r = NULL;
9199   __pyx_L0:;
9200   __Pyx_XDECREF(__pyx_v_idx);
9201   __Pyx_RefNannyFinishContext();
9202   return __pyx_r;
9203 }
9204 
9205 /* "View.MemoryView":403
9206  *
9207  *
9208  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
9209  *         if index is Ellipsis:
9210  *             return self
9211  */
9212 
9213 /* Python wrapper */
9214 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_memoryview___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)9215 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9216   PyObject *__pyx_r = 0;
9217   __Pyx_RefNannyDeclarations
9218   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9219   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9220 
9221   /* function exit code */
9222   __Pyx_RefNannyFinishContext();
9223   return __pyx_r;
9224 }
9225 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)9226 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9227   PyObject *__pyx_v_have_slices = NULL;
9228   PyObject *__pyx_v_indices = NULL;
9229   char *__pyx_v_itemp;
9230   PyObject *__pyx_r = NULL;
9231   __Pyx_RefNannyDeclarations
9232   int __pyx_t_1;
9233   int __pyx_t_2;
9234   PyObject *__pyx_t_3 = NULL;
9235   PyObject *__pyx_t_4 = NULL;
9236   PyObject *__pyx_t_5 = NULL;
9237   char *__pyx_t_6;
9238   int __pyx_lineno = 0;
9239   const char *__pyx_filename = NULL;
9240   int __pyx_clineno = 0;
9241   __Pyx_RefNannySetupContext("__getitem__", 0);
9242 
9243   /* "View.MemoryView":404
9244  *
9245  *     def __getitem__(memoryview self, object index):
9246  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
9247  *             return self
9248  *
9249  */
9250   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9251   __pyx_t_2 = (__pyx_t_1 != 0);
9252   if (__pyx_t_2) {
9253 
9254     /* "View.MemoryView":405
9255  *     def __getitem__(memoryview self, object index):
9256  *         if index is Ellipsis:
9257  *             return self             # <<<<<<<<<<<<<<
9258  *
9259  *         have_slices, indices = _unellipsify(index, self.view.ndim)
9260  */
9261     __Pyx_XDECREF(__pyx_r);
9262     __Pyx_INCREF(((PyObject *)__pyx_v_self));
9263     __pyx_r = ((PyObject *)__pyx_v_self);
9264     goto __pyx_L0;
9265 
9266     /* "View.MemoryView":404
9267  *
9268  *     def __getitem__(memoryview self, object index):
9269  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
9270  *             return self
9271  *
9272  */
9273   }
9274 
9275   /* "View.MemoryView":407
9276  *             return self
9277  *
9278  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
9279  *
9280  *         cdef char *itemp
9281  */
9282   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
9283   __Pyx_GOTREF(__pyx_t_3);
9284   if (likely(__pyx_t_3 != Py_None)) {
9285     PyObject* sequence = __pyx_t_3;
9286     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9287     if (unlikely(size != 2)) {
9288       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9289       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9290       __PYX_ERR(2, 407, __pyx_L1_error)
9291     }
9292     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9293     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9294     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9295     __Pyx_INCREF(__pyx_t_4);
9296     __Pyx_INCREF(__pyx_t_5);
9297     #else
9298     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
9299     __Pyx_GOTREF(__pyx_t_4);
9300     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
9301     __Pyx_GOTREF(__pyx_t_5);
9302     #endif
9303     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9304   } else {
9305     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
9306   }
9307   __pyx_v_have_slices = __pyx_t_4;
9308   __pyx_t_4 = 0;
9309   __pyx_v_indices = __pyx_t_5;
9310   __pyx_t_5 = 0;
9311 
9312   /* "View.MemoryView":410
9313  *
9314  *         cdef char *itemp
9315  *         if have_slices:             # <<<<<<<<<<<<<<
9316  *             return memview_slice(self, indices)
9317  *         else:
9318  */
9319   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
9320   if (__pyx_t_2) {
9321 
9322     /* "View.MemoryView":411
9323  *         cdef char *itemp
9324  *         if have_slices:
9325  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
9326  *         else:
9327  *             itemp = self.get_item_pointer(indices)
9328  */
9329     __Pyx_XDECREF(__pyx_r);
9330     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
9331     __Pyx_GOTREF(__pyx_t_3);
9332     __pyx_r = __pyx_t_3;
9333     __pyx_t_3 = 0;
9334     goto __pyx_L0;
9335 
9336     /* "View.MemoryView":410
9337  *
9338  *         cdef char *itemp
9339  *         if have_slices:             # <<<<<<<<<<<<<<
9340  *             return memview_slice(self, indices)
9341  *         else:
9342  */
9343   }
9344 
9345   /* "View.MemoryView":413
9346  *             return memview_slice(self, indices)
9347  *         else:
9348  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
9349  *             return self.convert_item_to_object(itemp)
9350  *
9351  */
9352   /*else*/ {
9353     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error)
9354     __pyx_v_itemp = __pyx_t_6;
9355 
9356     /* "View.MemoryView":414
9357  *         else:
9358  *             itemp = self.get_item_pointer(indices)
9359  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
9360  *
9361  *     def __setitem__(memoryview self, object index, object value):
9362  */
9363     __Pyx_XDECREF(__pyx_r);
9364     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 414, __pyx_L1_error)
9365     __Pyx_GOTREF(__pyx_t_3);
9366     __pyx_r = __pyx_t_3;
9367     __pyx_t_3 = 0;
9368     goto __pyx_L0;
9369   }
9370 
9371   /* "View.MemoryView":403
9372  *
9373  *
9374  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
9375  *         if index is Ellipsis:
9376  *             return self
9377  */
9378 
9379   /* function exit code */
9380   __pyx_L1_error:;
9381   __Pyx_XDECREF(__pyx_t_3);
9382   __Pyx_XDECREF(__pyx_t_4);
9383   __Pyx_XDECREF(__pyx_t_5);
9384   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9385   __pyx_r = NULL;
9386   __pyx_L0:;
9387   __Pyx_XDECREF(__pyx_v_have_slices);
9388   __Pyx_XDECREF(__pyx_v_indices);
9389   __Pyx_XGIVEREF(__pyx_r);
9390   __Pyx_RefNannyFinishContext();
9391   return __pyx_r;
9392 }
9393 
9394 /* "View.MemoryView":416
9395  *             return self.convert_item_to_object(itemp)
9396  *
9397  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
9398  *         if self.view.readonly:
9399  *             raise TypeError("Cannot assign to read-only memoryview")
9400  */
9401 
9402 /* Python wrapper */
9403 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
__pyx_memoryview___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)9404 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9405   int __pyx_r;
9406   __Pyx_RefNannyDeclarations
9407   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9408   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9409 
9410   /* function exit code */
9411   __Pyx_RefNannyFinishContext();
9412   return __pyx_r;
9413 }
9414 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)9415 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9416   PyObject *__pyx_v_have_slices = NULL;
9417   PyObject *__pyx_v_obj = NULL;
9418   int __pyx_r;
9419   __Pyx_RefNannyDeclarations
9420   int __pyx_t_1;
9421   PyObject *__pyx_t_2 = NULL;
9422   PyObject *__pyx_t_3 = NULL;
9423   PyObject *__pyx_t_4 = NULL;
9424   int __pyx_lineno = 0;
9425   const char *__pyx_filename = NULL;
9426   int __pyx_clineno = 0;
9427   __Pyx_RefNannySetupContext("__setitem__", 0);
9428   __Pyx_INCREF(__pyx_v_index);
9429 
9430   /* "View.MemoryView":417
9431  *
9432  *     def __setitem__(memoryview self, object index, object value):
9433  *         if self.view.readonly:             # <<<<<<<<<<<<<<
9434  *             raise TypeError("Cannot assign to read-only memoryview")
9435  *
9436  */
9437   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9438   if (unlikely(__pyx_t_1)) {
9439 
9440     /* "View.MemoryView":418
9441  *     def __setitem__(memoryview self, object index, object value):
9442  *         if self.view.readonly:
9443  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
9444  *
9445  *         have_slices, index = _unellipsify(index, self.view.ndim)
9446  */
9447     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
9448     __Pyx_GOTREF(__pyx_t_2);
9449     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9450     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9451     __PYX_ERR(2, 418, __pyx_L1_error)
9452 
9453     /* "View.MemoryView":417
9454  *
9455  *     def __setitem__(memoryview self, object index, object value):
9456  *         if self.view.readonly:             # <<<<<<<<<<<<<<
9457  *             raise TypeError("Cannot assign to read-only memoryview")
9458  *
9459  */
9460   }
9461 
9462   /* "View.MemoryView":420
9463  *             raise TypeError("Cannot assign to read-only memoryview")
9464  *
9465  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
9466  *
9467  *         if have_slices:
9468  */
9469   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
9470   __Pyx_GOTREF(__pyx_t_2);
9471   if (likely(__pyx_t_2 != Py_None)) {
9472     PyObject* sequence = __pyx_t_2;
9473     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9474     if (unlikely(size != 2)) {
9475       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9476       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9477       __PYX_ERR(2, 420, __pyx_L1_error)
9478     }
9479     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9480     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9481     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9482     __Pyx_INCREF(__pyx_t_3);
9483     __Pyx_INCREF(__pyx_t_4);
9484     #else
9485     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
9486     __Pyx_GOTREF(__pyx_t_3);
9487     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
9488     __Pyx_GOTREF(__pyx_t_4);
9489     #endif
9490     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9491   } else {
9492     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
9493   }
9494   __pyx_v_have_slices = __pyx_t_3;
9495   __pyx_t_3 = 0;
9496   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9497   __pyx_t_4 = 0;
9498 
9499   /* "View.MemoryView":422
9500  *         have_slices, index = _unellipsify(index, self.view.ndim)
9501  *
9502  *         if have_slices:             # <<<<<<<<<<<<<<
9503  *             obj = self.is_slice(value)
9504  *             if obj:
9505  */
9506   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
9507   if (__pyx_t_1) {
9508 
9509     /* "View.MemoryView":423
9510  *
9511  *         if have_slices:
9512  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
9513  *             if obj:
9514  *                 self.setitem_slice_assignment(self[index], obj)
9515  */
9516     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
9517     __Pyx_GOTREF(__pyx_t_2);
9518     __pyx_v_obj = __pyx_t_2;
9519     __pyx_t_2 = 0;
9520 
9521     /* "View.MemoryView":424
9522  *         if have_slices:
9523  *             obj = self.is_slice(value)
9524  *             if obj:             # <<<<<<<<<<<<<<
9525  *                 self.setitem_slice_assignment(self[index], obj)
9526  *             else:
9527  */
9528     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
9529     if (__pyx_t_1) {
9530 
9531       /* "View.MemoryView":425
9532  *             obj = self.is_slice(value)
9533  *             if obj:
9534  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
9535  *             else:
9536  *                 self.setitem_slice_assign_scalar(self[index], value)
9537  */
9538       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
9539       __Pyx_GOTREF(__pyx_t_2);
9540       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 425, __pyx_L1_error)
9541       __Pyx_GOTREF(__pyx_t_4);
9542       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9543       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9544 
9545       /* "View.MemoryView":424
9546  *         if have_slices:
9547  *             obj = self.is_slice(value)
9548  *             if obj:             # <<<<<<<<<<<<<<
9549  *                 self.setitem_slice_assignment(self[index], obj)
9550  *             else:
9551  */
9552       goto __pyx_L5;
9553     }
9554 
9555     /* "View.MemoryView":427
9556  *                 self.setitem_slice_assignment(self[index], obj)
9557  *             else:
9558  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
9559  *         else:
9560  *             self.setitem_indexed(index, value)
9561  */
9562     /*else*/ {
9563       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
9564       __Pyx_GOTREF(__pyx_t_4);
9565       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
9566       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 427, __pyx_L1_error)
9567       __Pyx_GOTREF(__pyx_t_2);
9568       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9569       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9570     }
9571     __pyx_L5:;
9572 
9573     /* "View.MemoryView":422
9574  *         have_slices, index = _unellipsify(index, self.view.ndim)
9575  *
9576  *         if have_slices:             # <<<<<<<<<<<<<<
9577  *             obj = self.is_slice(value)
9578  *             if obj:
9579  */
9580     goto __pyx_L4;
9581   }
9582 
9583   /* "View.MemoryView":429
9584  *                 self.setitem_slice_assign_scalar(self[index], value)
9585  *         else:
9586  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
9587  *
9588  *     cdef is_slice(self, obj):
9589  */
9590   /*else*/ {
9591     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 429, __pyx_L1_error)
9592     __Pyx_GOTREF(__pyx_t_2);
9593     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9594   }
9595   __pyx_L4:;
9596 
9597   /* "View.MemoryView":416
9598  *             return self.convert_item_to_object(itemp)
9599  *
9600  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
9601  *         if self.view.readonly:
9602  *             raise TypeError("Cannot assign to read-only memoryview")
9603  */
9604 
9605   /* function exit code */
9606   __pyx_r = 0;
9607   goto __pyx_L0;
9608   __pyx_L1_error:;
9609   __Pyx_XDECREF(__pyx_t_2);
9610   __Pyx_XDECREF(__pyx_t_3);
9611   __Pyx_XDECREF(__pyx_t_4);
9612   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9613   __pyx_r = -1;
9614   __pyx_L0:;
9615   __Pyx_XDECREF(__pyx_v_have_slices);
9616   __Pyx_XDECREF(__pyx_v_obj);
9617   __Pyx_XDECREF(__pyx_v_index);
9618   __Pyx_RefNannyFinishContext();
9619   return __pyx_r;
9620 }
9621 
9622 /* "View.MemoryView":431
9623  *             self.setitem_indexed(index, value)
9624  *
9625  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
9626  *         if not isinstance(obj, memoryview):
9627  *             try:
9628  */
9629 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)9630 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9631   PyObject *__pyx_r = NULL;
9632   __Pyx_RefNannyDeclarations
9633   int __pyx_t_1;
9634   int __pyx_t_2;
9635   PyObject *__pyx_t_3 = NULL;
9636   PyObject *__pyx_t_4 = NULL;
9637   PyObject *__pyx_t_5 = NULL;
9638   PyObject *__pyx_t_6 = NULL;
9639   PyObject *__pyx_t_7 = NULL;
9640   PyObject *__pyx_t_8 = NULL;
9641   int __pyx_t_9;
9642   int __pyx_lineno = 0;
9643   const char *__pyx_filename = NULL;
9644   int __pyx_clineno = 0;
9645   __Pyx_RefNannySetupContext("is_slice", 0);
9646   __Pyx_INCREF(__pyx_v_obj);
9647 
9648   /* "View.MemoryView":432
9649  *
9650  *     cdef is_slice(self, obj):
9651  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
9652  *             try:
9653  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9654  */
9655   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9656   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9657   if (__pyx_t_2) {
9658 
9659     /* "View.MemoryView":433
9660  *     cdef is_slice(self, obj):
9661  *         if not isinstance(obj, memoryview):
9662  *             try:             # <<<<<<<<<<<<<<
9663  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9664  *                                  self.dtype_is_object)
9665  */
9666     {
9667       __Pyx_PyThreadState_declare
9668       __Pyx_PyThreadState_assign
9669       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9670       __Pyx_XGOTREF(__pyx_t_3);
9671       __Pyx_XGOTREF(__pyx_t_4);
9672       __Pyx_XGOTREF(__pyx_t_5);
9673       /*try:*/ {
9674 
9675         /* "View.MemoryView":434
9676  *         if not isinstance(obj, memoryview):
9677  *             try:
9678  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
9679  *                                  self.dtype_is_object)
9680  *             except TypeError:
9681  */
9682         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
9683         __Pyx_GOTREF(__pyx_t_6);
9684 
9685         /* "View.MemoryView":435
9686  *             try:
9687  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9688  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
9689  *             except TypeError:
9690  *                 return None
9691  */
9692         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
9693         __Pyx_GOTREF(__pyx_t_7);
9694 
9695         /* "View.MemoryView":434
9696  *         if not isinstance(obj, memoryview):
9697  *             try:
9698  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
9699  *                                  self.dtype_is_object)
9700  *             except TypeError:
9701  */
9702         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
9703         __Pyx_GOTREF(__pyx_t_8);
9704         __Pyx_INCREF(__pyx_v_obj);
9705         __Pyx_GIVEREF(__pyx_v_obj);
9706         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9707         __Pyx_GIVEREF(__pyx_t_6);
9708         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9709         __Pyx_GIVEREF(__pyx_t_7);
9710         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9711         __pyx_t_6 = 0;
9712         __pyx_t_7 = 0;
9713         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
9714         __Pyx_GOTREF(__pyx_t_7);
9715         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9716         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9717         __pyx_t_7 = 0;
9718 
9719         /* "View.MemoryView":433
9720  *     cdef is_slice(self, obj):
9721  *         if not isinstance(obj, memoryview):
9722  *             try:             # <<<<<<<<<<<<<<
9723  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9724  *                                  self.dtype_is_object)
9725  */
9726       }
9727       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9728       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9729       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9730       goto __pyx_L9_try_end;
9731       __pyx_L4_error:;
9732       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9733       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9734       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9735 
9736       /* "View.MemoryView":436
9737  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9738  *                                  self.dtype_is_object)
9739  *             except TypeError:             # <<<<<<<<<<<<<<
9740  *                 return None
9741  *
9742  */
9743       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9744       if (__pyx_t_9) {
9745         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9746         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
9747         __Pyx_GOTREF(__pyx_t_7);
9748         __Pyx_GOTREF(__pyx_t_8);
9749         __Pyx_GOTREF(__pyx_t_6);
9750 
9751         /* "View.MemoryView":437
9752  *                                  self.dtype_is_object)
9753  *             except TypeError:
9754  *                 return None             # <<<<<<<<<<<<<<
9755  *
9756  *         return obj
9757  */
9758         __Pyx_XDECREF(__pyx_r);
9759         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9760         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9761         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9762         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9763         goto __pyx_L7_except_return;
9764       }
9765       goto __pyx_L6_except_error;
9766       __pyx_L6_except_error:;
9767 
9768       /* "View.MemoryView":433
9769  *     cdef is_slice(self, obj):
9770  *         if not isinstance(obj, memoryview):
9771  *             try:             # <<<<<<<<<<<<<<
9772  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9773  *                                  self.dtype_is_object)
9774  */
9775       __Pyx_XGIVEREF(__pyx_t_3);
9776       __Pyx_XGIVEREF(__pyx_t_4);
9777       __Pyx_XGIVEREF(__pyx_t_5);
9778       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9779       goto __pyx_L1_error;
9780       __pyx_L7_except_return:;
9781       __Pyx_XGIVEREF(__pyx_t_3);
9782       __Pyx_XGIVEREF(__pyx_t_4);
9783       __Pyx_XGIVEREF(__pyx_t_5);
9784       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9785       goto __pyx_L0;
9786       __pyx_L9_try_end:;
9787     }
9788 
9789     /* "View.MemoryView":432
9790  *
9791  *     cdef is_slice(self, obj):
9792  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
9793  *             try:
9794  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9795  */
9796   }
9797 
9798   /* "View.MemoryView":439
9799  *                 return None
9800  *
9801  *         return obj             # <<<<<<<<<<<<<<
9802  *
9803  *     cdef setitem_slice_assignment(self, dst, src):
9804  */
9805   __Pyx_XDECREF(__pyx_r);
9806   __Pyx_INCREF(__pyx_v_obj);
9807   __pyx_r = __pyx_v_obj;
9808   goto __pyx_L0;
9809 
9810   /* "View.MemoryView":431
9811  *             self.setitem_indexed(index, value)
9812  *
9813  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
9814  *         if not isinstance(obj, memoryview):
9815  *             try:
9816  */
9817 
9818   /* function exit code */
9819   __pyx_L1_error:;
9820   __Pyx_XDECREF(__pyx_t_6);
9821   __Pyx_XDECREF(__pyx_t_7);
9822   __Pyx_XDECREF(__pyx_t_8);
9823   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9824   __pyx_r = 0;
9825   __pyx_L0:;
9826   __Pyx_XDECREF(__pyx_v_obj);
9827   __Pyx_XGIVEREF(__pyx_r);
9828   __Pyx_RefNannyFinishContext();
9829   return __pyx_r;
9830 }
9831 
9832 /* "View.MemoryView":441
9833  *         return obj
9834  *
9835  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
9836  *         cdef __Pyx_memviewslice dst_slice
9837  *         cdef __Pyx_memviewslice src_slice
9838  */
9839 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)9840 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9841   __Pyx_memviewslice __pyx_v_dst_slice;
9842   __Pyx_memviewslice __pyx_v_src_slice;
9843   PyObject *__pyx_r = NULL;
9844   __Pyx_RefNannyDeclarations
9845   __Pyx_memviewslice *__pyx_t_1;
9846   __Pyx_memviewslice *__pyx_t_2;
9847   PyObject *__pyx_t_3 = NULL;
9848   int __pyx_t_4;
9849   int __pyx_t_5;
9850   int __pyx_t_6;
9851   int __pyx_lineno = 0;
9852   const char *__pyx_filename = NULL;
9853   int __pyx_clineno = 0;
9854   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
9855 
9856   /* "View.MemoryView":445
9857  *         cdef __Pyx_memviewslice src_slice
9858  *
9859  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
9860  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9861  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9862  */
9863   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
9864   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error)
9865 
9866   /* "View.MemoryView":446
9867  *
9868  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
9869  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
9870  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9871  *
9872  */
9873   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
9874   __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error)
9875 
9876   /* "View.MemoryView":447
9877  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
9878  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9879  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
9880  *
9881  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9882  */
9883   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
9884   __Pyx_GOTREF(__pyx_t_3);
9885   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
9886   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9887   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
9888   __Pyx_GOTREF(__pyx_t_3);
9889   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
9890   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9891 
9892   /* "View.MemoryView":445
9893  *         cdef __Pyx_memviewslice src_slice
9894  *
9895  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
9896  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9897  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9898  */
9899   __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 445, __pyx_L1_error)
9900 
9901   /* "View.MemoryView":441
9902  *         return obj
9903  *
9904  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
9905  *         cdef __Pyx_memviewslice dst_slice
9906  *         cdef __Pyx_memviewslice src_slice
9907  */
9908 
9909   /* function exit code */
9910   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9911   goto __pyx_L0;
9912   __pyx_L1_error:;
9913   __Pyx_XDECREF(__pyx_t_3);
9914   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9915   __pyx_r = 0;
9916   __pyx_L0:;
9917   __Pyx_XGIVEREF(__pyx_r);
9918   __Pyx_RefNannyFinishContext();
9919   return __pyx_r;
9920 }
9921 
9922 /* "View.MemoryView":449
9923  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9924  *
9925  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
9926  *         cdef int array[128]
9927  *         cdef void *tmp = NULL
9928  */
9929 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)9930 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9931   int __pyx_v_array[0x80];
9932   void *__pyx_v_tmp;
9933   void *__pyx_v_item;
9934   __Pyx_memviewslice *__pyx_v_dst_slice;
9935   __Pyx_memviewslice __pyx_v_tmp_slice;
9936   PyObject *__pyx_r = NULL;
9937   __Pyx_RefNannyDeclarations
9938   __Pyx_memviewslice *__pyx_t_1;
9939   int __pyx_t_2;
9940   PyObject *__pyx_t_3 = NULL;
9941   int __pyx_t_4;
9942   int __pyx_t_5;
9943   char const *__pyx_t_6;
9944   PyObject *__pyx_t_7 = NULL;
9945   PyObject *__pyx_t_8 = NULL;
9946   PyObject *__pyx_t_9 = NULL;
9947   PyObject *__pyx_t_10 = NULL;
9948   PyObject *__pyx_t_11 = NULL;
9949   PyObject *__pyx_t_12 = NULL;
9950   int __pyx_lineno = 0;
9951   const char *__pyx_filename = NULL;
9952   int __pyx_clineno = 0;
9953   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
9954 
9955   /* "View.MemoryView":451
9956  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9957  *         cdef int array[128]
9958  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
9959  *         cdef void *item
9960  *
9961  */
9962   __pyx_v_tmp = NULL;
9963 
9964   /* "View.MemoryView":456
9965  *         cdef __Pyx_memviewslice *dst_slice
9966  *         cdef __Pyx_memviewslice tmp_slice
9967  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
9968  *
9969  *         if <size_t>self.view.itemsize > sizeof(array):
9970  */
9971   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error)
9972   __pyx_v_dst_slice = __pyx_t_1;
9973 
9974   /* "View.MemoryView":458
9975  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
9976  *
9977  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
9978  *             tmp = PyMem_Malloc(self.view.itemsize)
9979  *             if tmp == NULL:
9980  */
9981   __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
9982   if (__pyx_t_2) {
9983 
9984     /* "View.MemoryView":459
9985  *
9986  *         if <size_t>self.view.itemsize > sizeof(array):
9987  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
9988  *             if tmp == NULL:
9989  *                 raise MemoryError
9990  */
9991     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9992 
9993     /* "View.MemoryView":460
9994  *         if <size_t>self.view.itemsize > sizeof(array):
9995  *             tmp = PyMem_Malloc(self.view.itemsize)
9996  *             if tmp == NULL:             # <<<<<<<<<<<<<<
9997  *                 raise MemoryError
9998  *             item = tmp
9999  */
10000     __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10001     if (unlikely(__pyx_t_2)) {
10002 
10003       /* "View.MemoryView":461
10004  *             tmp = PyMem_Malloc(self.view.itemsize)
10005  *             if tmp == NULL:
10006  *                 raise MemoryError             # <<<<<<<<<<<<<<
10007  *             item = tmp
10008  *         else:
10009  */
10010       PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
10011 
10012       /* "View.MemoryView":460
10013  *         if <size_t>self.view.itemsize > sizeof(array):
10014  *             tmp = PyMem_Malloc(self.view.itemsize)
10015  *             if tmp == NULL:             # <<<<<<<<<<<<<<
10016  *                 raise MemoryError
10017  *             item = tmp
10018  */
10019     }
10020 
10021     /* "View.MemoryView":462
10022  *             if tmp == NULL:
10023  *                 raise MemoryError
10024  *             item = tmp             # <<<<<<<<<<<<<<
10025  *         else:
10026  *             item = <void *> array
10027  */
10028     __pyx_v_item = __pyx_v_tmp;
10029 
10030     /* "View.MemoryView":458
10031  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
10032  *
10033  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
10034  *             tmp = PyMem_Malloc(self.view.itemsize)
10035  *             if tmp == NULL:
10036  */
10037     goto __pyx_L3;
10038   }
10039 
10040   /* "View.MemoryView":464
10041  *             item = tmp
10042  *         else:
10043  *             item = <void *> array             # <<<<<<<<<<<<<<
10044  *
10045  *         try:
10046  */
10047   /*else*/ {
10048     __pyx_v_item = ((void *)__pyx_v_array);
10049   }
10050   __pyx_L3:;
10051 
10052   /* "View.MemoryView":466
10053  *             item = <void *> array
10054  *
10055  *         try:             # <<<<<<<<<<<<<<
10056  *             if self.dtype_is_object:
10057  *                 (<PyObject **> item)[0] = <PyObject *> value
10058  */
10059   /*try:*/ {
10060 
10061     /* "View.MemoryView":467
10062  *
10063  *         try:
10064  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
10065  *                 (<PyObject **> item)[0] = <PyObject *> value
10066  *             else:
10067  */
10068     __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10069     if (__pyx_t_2) {
10070 
10071       /* "View.MemoryView":468
10072  *         try:
10073  *             if self.dtype_is_object:
10074  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
10075  *             else:
10076  *                 self.assign_item_from_object(<char *> item, value)
10077  */
10078       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10079 
10080       /* "View.MemoryView":467
10081  *
10082  *         try:
10083  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
10084  *                 (<PyObject **> item)[0] = <PyObject *> value
10085  *             else:
10086  */
10087       goto __pyx_L8;
10088     }
10089 
10090     /* "View.MemoryView":470
10091  *                 (<PyObject **> item)[0] = <PyObject *> value
10092  *             else:
10093  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
10094  *
10095  *
10096  */
10097     /*else*/ {
10098       __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 470, __pyx_L6_error)
10099       __Pyx_GOTREF(__pyx_t_3);
10100       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10101     }
10102     __pyx_L8:;
10103 
10104     /* "View.MemoryView":474
10105  *
10106  *
10107  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
10108  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10109  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10110  */
10111     __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10112     if (__pyx_t_2) {
10113 
10114       /* "View.MemoryView":475
10115  *
10116  *             if self.view.suboffsets != NULL:
10117  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
10118  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10119  *                                 item, self.dtype_is_object)
10120  */
10121       __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
10122       __Pyx_GOTREF(__pyx_t_3);
10123       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10124 
10125       /* "View.MemoryView":474
10126  *
10127  *
10128  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
10129  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10130  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10131  */
10132     }
10133 
10134     /* "View.MemoryView":476
10135  *             if self.view.suboffsets != NULL:
10136  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10137  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
10138  *                                 item, self.dtype_is_object)
10139  *         finally:
10140  */
10141     __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10142   }
10143 
10144   /* "View.MemoryView":479
10145  *                                 item, self.dtype_is_object)
10146  *         finally:
10147  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
10148  *
10149  *     cdef setitem_indexed(self, index, value):
10150  */
10151   /*finally:*/ {
10152     /*normal exit:*/{
10153       PyMem_Free(__pyx_v_tmp);
10154       goto __pyx_L7;
10155     }
10156     __pyx_L6_error:;
10157     /*exception exit:*/{
10158       __Pyx_PyThreadState_declare
10159       __Pyx_PyThreadState_assign
10160       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10161       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10162       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10163       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10164       __Pyx_XGOTREF(__pyx_t_7);
10165       __Pyx_XGOTREF(__pyx_t_8);
10166       __Pyx_XGOTREF(__pyx_t_9);
10167       __Pyx_XGOTREF(__pyx_t_10);
10168       __Pyx_XGOTREF(__pyx_t_11);
10169       __Pyx_XGOTREF(__pyx_t_12);
10170       __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10171       {
10172         PyMem_Free(__pyx_v_tmp);
10173       }
10174       if (PY_MAJOR_VERSION >= 3) {
10175         __Pyx_XGIVEREF(__pyx_t_10);
10176         __Pyx_XGIVEREF(__pyx_t_11);
10177         __Pyx_XGIVEREF(__pyx_t_12);
10178         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10179       }
10180       __Pyx_XGIVEREF(__pyx_t_7);
10181       __Pyx_XGIVEREF(__pyx_t_8);
10182       __Pyx_XGIVEREF(__pyx_t_9);
10183       __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10184       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10185       __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10186       goto __pyx_L1_error;
10187     }
10188     __pyx_L7:;
10189   }
10190 
10191   /* "View.MemoryView":449
10192  *                                  src.ndim, dst.ndim, self.dtype_is_object)
10193  *
10194  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
10195  *         cdef int array[128]
10196  *         cdef void *tmp = NULL
10197  */
10198 
10199   /* function exit code */
10200   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10201   goto __pyx_L0;
10202   __pyx_L1_error:;
10203   __Pyx_XDECREF(__pyx_t_3);
10204   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10205   __pyx_r = 0;
10206   __pyx_L0:;
10207   __Pyx_XGIVEREF(__pyx_r);
10208   __Pyx_RefNannyFinishContext();
10209   return __pyx_r;
10210 }
10211 
10212 /* "View.MemoryView":481
10213  *             PyMem_Free(tmp)
10214  *
10215  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
10216  *         cdef char *itemp = self.get_item_pointer(index)
10217  *         self.assign_item_from_object(itemp, value)
10218  */
10219 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)10220 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10221   char *__pyx_v_itemp;
10222   PyObject *__pyx_r = NULL;
10223   __Pyx_RefNannyDeclarations
10224   char *__pyx_t_1;
10225   PyObject *__pyx_t_2 = NULL;
10226   int __pyx_lineno = 0;
10227   const char *__pyx_filename = NULL;
10228   int __pyx_clineno = 0;
10229   __Pyx_RefNannySetupContext("setitem_indexed", 0);
10230 
10231   /* "View.MemoryView":482
10232  *
10233  *     cdef setitem_indexed(self, index, value):
10234  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
10235  *         self.assign_item_from_object(itemp, value)
10236  *
10237  */
10238   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error)
10239   __pyx_v_itemp = __pyx_t_1;
10240 
10241   /* "View.MemoryView":483
10242  *     cdef setitem_indexed(self, index, value):
10243  *         cdef char *itemp = self.get_item_pointer(index)
10244  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
10245  *
10246  *     cdef convert_item_to_object(self, char *itemp):
10247  */
10248   __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error)
10249   __Pyx_GOTREF(__pyx_t_2);
10250   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10251 
10252   /* "View.MemoryView":481
10253  *             PyMem_Free(tmp)
10254  *
10255  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
10256  *         cdef char *itemp = self.get_item_pointer(index)
10257  *         self.assign_item_from_object(itemp, value)
10258  */
10259 
10260   /* function exit code */
10261   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10262   goto __pyx_L0;
10263   __pyx_L1_error:;
10264   __Pyx_XDECREF(__pyx_t_2);
10265   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10266   __pyx_r = 0;
10267   __pyx_L0:;
10268   __Pyx_XGIVEREF(__pyx_r);
10269   __Pyx_RefNannyFinishContext();
10270   return __pyx_r;
10271 }
10272 
10273 /* "View.MemoryView":485
10274  *         self.assign_item_from_object(itemp, value)
10275  *
10276  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
10277  *         """Only used if instantiated manually by the user, or if Cython doesn't
10278  *         know how to convert the type"""
10279  */
10280 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)10281 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10282   PyObject *__pyx_v_struct = NULL;
10283   PyObject *__pyx_v_bytesitem = 0;
10284   PyObject *__pyx_v_result = NULL;
10285   PyObject *__pyx_r = NULL;
10286   __Pyx_RefNannyDeclarations
10287   PyObject *__pyx_t_1 = NULL;
10288   PyObject *__pyx_t_2 = NULL;
10289   PyObject *__pyx_t_3 = NULL;
10290   PyObject *__pyx_t_4 = NULL;
10291   PyObject *__pyx_t_5 = NULL;
10292   PyObject *__pyx_t_6 = NULL;
10293   PyObject *__pyx_t_7 = NULL;
10294   int __pyx_t_8;
10295   PyObject *__pyx_t_9 = NULL;
10296   size_t __pyx_t_10;
10297   int __pyx_t_11;
10298   int __pyx_lineno = 0;
10299   const char *__pyx_filename = NULL;
10300   int __pyx_clineno = 0;
10301   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
10302 
10303   /* "View.MemoryView":488
10304  *         """Only used if instantiated manually by the user, or if Cython doesn't
10305  *         know how to convert the type"""
10306  *         import struct             # <<<<<<<<<<<<<<
10307  *         cdef bytes bytesitem
10308  *
10309  */
10310   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
10311   __Pyx_GOTREF(__pyx_t_1);
10312   __pyx_v_struct = __pyx_t_1;
10313   __pyx_t_1 = 0;
10314 
10315   /* "View.MemoryView":491
10316  *         cdef bytes bytesitem
10317  *
10318  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
10319  *         try:
10320  *             result = struct.unpack(self.view.format, bytesitem)
10321  */
10322   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
10323   __Pyx_GOTREF(__pyx_t_1);
10324   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10325   __pyx_t_1 = 0;
10326 
10327   /* "View.MemoryView":492
10328  *
10329  *         bytesitem = itemp[:self.view.itemsize]
10330  *         try:             # <<<<<<<<<<<<<<
10331  *             result = struct.unpack(self.view.format, bytesitem)
10332  *         except struct.error:
10333  */
10334   {
10335     __Pyx_PyThreadState_declare
10336     __Pyx_PyThreadState_assign
10337     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10338     __Pyx_XGOTREF(__pyx_t_2);
10339     __Pyx_XGOTREF(__pyx_t_3);
10340     __Pyx_XGOTREF(__pyx_t_4);
10341     /*try:*/ {
10342 
10343       /* "View.MemoryView":493
10344  *         bytesitem = itemp[:self.view.itemsize]
10345  *         try:
10346  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
10347  *         except struct.error:
10348  *             raise ValueError("Unable to convert item to object")
10349  */
10350       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
10351       __Pyx_GOTREF(__pyx_t_5);
10352       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
10353       __Pyx_GOTREF(__pyx_t_6);
10354       __pyx_t_7 = NULL;
10355       __pyx_t_8 = 0;
10356       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10357         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10358         if (likely(__pyx_t_7)) {
10359           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10360           __Pyx_INCREF(__pyx_t_7);
10361           __Pyx_INCREF(function);
10362           __Pyx_DECREF_SET(__pyx_t_5, function);
10363           __pyx_t_8 = 1;
10364         }
10365       }
10366       #if CYTHON_FAST_PYCALL
10367       if (PyFunction_Check(__pyx_t_5)) {
10368         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10369         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
10370         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10371         __Pyx_GOTREF(__pyx_t_1);
10372         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10373       } else
10374       #endif
10375       #if CYTHON_FAST_PYCCALL
10376       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10377         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10378         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
10379         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10380         __Pyx_GOTREF(__pyx_t_1);
10381         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10382       } else
10383       #endif
10384       {
10385         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
10386         __Pyx_GOTREF(__pyx_t_9);
10387         if (__pyx_t_7) {
10388           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10389         }
10390         __Pyx_GIVEREF(__pyx_t_6);
10391         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10392         __Pyx_INCREF(__pyx_v_bytesitem);
10393         __Pyx_GIVEREF(__pyx_v_bytesitem);
10394         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10395         __pyx_t_6 = 0;
10396         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
10397         __Pyx_GOTREF(__pyx_t_1);
10398         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10399       }
10400       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10401       __pyx_v_result = __pyx_t_1;
10402       __pyx_t_1 = 0;
10403 
10404       /* "View.MemoryView":492
10405  *
10406  *         bytesitem = itemp[:self.view.itemsize]
10407  *         try:             # <<<<<<<<<<<<<<
10408  *             result = struct.unpack(self.view.format, bytesitem)
10409  *         except struct.error:
10410  */
10411     }
10412 
10413     /* "View.MemoryView":497
10414  *             raise ValueError("Unable to convert item to object")
10415  *         else:
10416  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
10417  *                 return result[0]
10418  *             return result
10419  */
10420     /*else:*/ {
10421       __pyx_t_10 = strlen(__pyx_v_self->view.format);
10422       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10423       if (__pyx_t_11) {
10424 
10425         /* "View.MemoryView":498
10426  *         else:
10427  *             if len(self.view.format) == 1:
10428  *                 return result[0]             # <<<<<<<<<<<<<<
10429  *             return result
10430  *
10431  */
10432         __Pyx_XDECREF(__pyx_r);
10433         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error)
10434         __Pyx_GOTREF(__pyx_t_1);
10435         __pyx_r = __pyx_t_1;
10436         __pyx_t_1 = 0;
10437         goto __pyx_L6_except_return;
10438 
10439         /* "View.MemoryView":497
10440  *             raise ValueError("Unable to convert item to object")
10441  *         else:
10442  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
10443  *                 return result[0]
10444  *             return result
10445  */
10446       }
10447 
10448       /* "View.MemoryView":499
10449  *             if len(self.view.format) == 1:
10450  *                 return result[0]
10451  *             return result             # <<<<<<<<<<<<<<
10452  *
10453  *     cdef assign_item_from_object(self, char *itemp, object value):
10454  */
10455       __Pyx_XDECREF(__pyx_r);
10456       __Pyx_INCREF(__pyx_v_result);
10457       __pyx_r = __pyx_v_result;
10458       goto __pyx_L6_except_return;
10459     }
10460     __pyx_L3_error:;
10461     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10462     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10463     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10464     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10465     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10466 
10467     /* "View.MemoryView":494
10468  *         try:
10469  *             result = struct.unpack(self.view.format, bytesitem)
10470  *         except struct.error:             # <<<<<<<<<<<<<<
10471  *             raise ValueError("Unable to convert item to object")
10472  *         else:
10473  */
10474     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10475     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
10476     __Pyx_GOTREF(__pyx_t_6);
10477     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10478     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10479     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10480     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10481     if (__pyx_t_8) {
10482       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10483       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
10484       __Pyx_GOTREF(__pyx_t_9);
10485       __Pyx_GOTREF(__pyx_t_5);
10486       __Pyx_GOTREF(__pyx_t_1);
10487 
10488       /* "View.MemoryView":495
10489  *             result = struct.unpack(self.view.format, bytesitem)
10490  *         except struct.error:
10491  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
10492  *         else:
10493  *             if len(self.view.format) == 1:
10494  */
10495       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
10496       __Pyx_GOTREF(__pyx_t_6);
10497       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10498       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10499       __PYX_ERR(2, 495, __pyx_L5_except_error)
10500     }
10501     goto __pyx_L5_except_error;
10502     __pyx_L5_except_error:;
10503 
10504     /* "View.MemoryView":492
10505  *
10506  *         bytesitem = itemp[:self.view.itemsize]
10507  *         try:             # <<<<<<<<<<<<<<
10508  *             result = struct.unpack(self.view.format, bytesitem)
10509  *         except struct.error:
10510  */
10511     __Pyx_XGIVEREF(__pyx_t_2);
10512     __Pyx_XGIVEREF(__pyx_t_3);
10513     __Pyx_XGIVEREF(__pyx_t_4);
10514     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10515     goto __pyx_L1_error;
10516     __pyx_L6_except_return:;
10517     __Pyx_XGIVEREF(__pyx_t_2);
10518     __Pyx_XGIVEREF(__pyx_t_3);
10519     __Pyx_XGIVEREF(__pyx_t_4);
10520     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10521     goto __pyx_L0;
10522   }
10523 
10524   /* "View.MemoryView":485
10525  *         self.assign_item_from_object(itemp, value)
10526  *
10527  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
10528  *         """Only used if instantiated manually by the user, or if Cython doesn't
10529  *         know how to convert the type"""
10530  */
10531 
10532   /* function exit code */
10533   __pyx_L1_error:;
10534   __Pyx_XDECREF(__pyx_t_1);
10535   __Pyx_XDECREF(__pyx_t_5);
10536   __Pyx_XDECREF(__pyx_t_6);
10537   __Pyx_XDECREF(__pyx_t_7);
10538   __Pyx_XDECREF(__pyx_t_9);
10539   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10540   __pyx_r = 0;
10541   __pyx_L0:;
10542   __Pyx_XDECREF(__pyx_v_struct);
10543   __Pyx_XDECREF(__pyx_v_bytesitem);
10544   __Pyx_XDECREF(__pyx_v_result);
10545   __Pyx_XGIVEREF(__pyx_r);
10546   __Pyx_RefNannyFinishContext();
10547   return __pyx_r;
10548 }
10549 
10550 /* "View.MemoryView":501
10551  *             return result
10552  *
10553  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
10554  *         """Only used if instantiated manually by the user, or if Cython doesn't
10555  *         know how to convert the type"""
10556  */
10557 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)10558 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10559   PyObject *__pyx_v_struct = NULL;
10560   char __pyx_v_c;
10561   PyObject *__pyx_v_bytesvalue = 0;
10562   Py_ssize_t __pyx_v_i;
10563   PyObject *__pyx_r = NULL;
10564   __Pyx_RefNannyDeclarations
10565   PyObject *__pyx_t_1 = NULL;
10566   int __pyx_t_2;
10567   int __pyx_t_3;
10568   PyObject *__pyx_t_4 = NULL;
10569   PyObject *__pyx_t_5 = NULL;
10570   PyObject *__pyx_t_6 = NULL;
10571   int __pyx_t_7;
10572   PyObject *__pyx_t_8 = NULL;
10573   Py_ssize_t __pyx_t_9;
10574   PyObject *__pyx_t_10 = NULL;
10575   char *__pyx_t_11;
10576   char *__pyx_t_12;
10577   char *__pyx_t_13;
10578   char *__pyx_t_14;
10579   int __pyx_lineno = 0;
10580   const char *__pyx_filename = NULL;
10581   int __pyx_clineno = 0;
10582   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10583 
10584   /* "View.MemoryView":504
10585  *         """Only used if instantiated manually by the user, or if Cython doesn't
10586  *         know how to convert the type"""
10587  *         import struct             # <<<<<<<<<<<<<<
10588  *         cdef char c
10589  *         cdef bytes bytesvalue
10590  */
10591   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
10592   __Pyx_GOTREF(__pyx_t_1);
10593   __pyx_v_struct = __pyx_t_1;
10594   __pyx_t_1 = 0;
10595 
10596   /* "View.MemoryView":509
10597  *         cdef Py_ssize_t i
10598  *
10599  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
10600  *             bytesvalue = struct.pack(self.view.format, *value)
10601  *         else:
10602  */
10603   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10604   __pyx_t_3 = (__pyx_t_2 != 0);
10605   if (__pyx_t_3) {
10606 
10607     /* "View.MemoryView":510
10608  *
10609  *         if isinstance(value, tuple):
10610  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
10611  *         else:
10612  *             bytesvalue = struct.pack(self.view.format, value)
10613  */
10614     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
10615     __Pyx_GOTREF(__pyx_t_1);
10616     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
10617     __Pyx_GOTREF(__pyx_t_4);
10618     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
10619     __Pyx_GOTREF(__pyx_t_5);
10620     __Pyx_GIVEREF(__pyx_t_4);
10621     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10622     __pyx_t_4 = 0;
10623     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
10624     __Pyx_GOTREF(__pyx_t_4);
10625     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
10626     __Pyx_GOTREF(__pyx_t_6);
10627     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10628     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10629     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
10630     __Pyx_GOTREF(__pyx_t_4);
10631     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10632     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10633     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 510, __pyx_L1_error)
10634     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10635     __pyx_t_4 = 0;
10636 
10637     /* "View.MemoryView":509
10638  *         cdef Py_ssize_t i
10639  *
10640  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
10641  *             bytesvalue = struct.pack(self.view.format, *value)
10642  *         else:
10643  */
10644     goto __pyx_L3;
10645   }
10646 
10647   /* "View.MemoryView":512
10648  *             bytesvalue = struct.pack(self.view.format, *value)
10649  *         else:
10650  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
10651  *
10652  *         for i, c in enumerate(bytesvalue):
10653  */
10654   /*else*/ {
10655     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
10656     __Pyx_GOTREF(__pyx_t_6);
10657     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
10658     __Pyx_GOTREF(__pyx_t_1);
10659     __pyx_t_5 = NULL;
10660     __pyx_t_7 = 0;
10661     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10662       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10663       if (likely(__pyx_t_5)) {
10664         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10665         __Pyx_INCREF(__pyx_t_5);
10666         __Pyx_INCREF(function);
10667         __Pyx_DECREF_SET(__pyx_t_6, function);
10668         __pyx_t_7 = 1;
10669       }
10670     }
10671     #if CYTHON_FAST_PYCALL
10672     if (PyFunction_Check(__pyx_t_6)) {
10673       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10674       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10675       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10676       __Pyx_GOTREF(__pyx_t_4);
10677       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10678     } else
10679     #endif
10680     #if CYTHON_FAST_PYCCALL
10681     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10682       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10683       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10684       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10685       __Pyx_GOTREF(__pyx_t_4);
10686       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10687     } else
10688     #endif
10689     {
10690       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
10691       __Pyx_GOTREF(__pyx_t_8);
10692       if (__pyx_t_5) {
10693         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
10694       }
10695       __Pyx_GIVEREF(__pyx_t_1);
10696       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
10697       __Pyx_INCREF(__pyx_v_value);
10698       __Pyx_GIVEREF(__pyx_v_value);
10699       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
10700       __pyx_t_1 = 0;
10701       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
10702       __Pyx_GOTREF(__pyx_t_4);
10703       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10704     }
10705     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10706     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 512, __pyx_L1_error)
10707     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10708     __pyx_t_4 = 0;
10709   }
10710   __pyx_L3:;
10711 
10712   /* "View.MemoryView":514
10713  *             bytesvalue = struct.pack(self.view.format, value)
10714  *
10715  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
10716  *             itemp[i] = c
10717  *
10718  */
10719   __pyx_t_9 = 0;
10720   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10721     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
10722     __PYX_ERR(2, 514, __pyx_L1_error)
10723   }
10724   __Pyx_INCREF(__pyx_v_bytesvalue);
10725   __pyx_t_10 = __pyx_v_bytesvalue;
10726   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
10727   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
10728   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10729     __pyx_t_11 = __pyx_t_14;
10730     __pyx_v_c = (__pyx_t_11[0]);
10731 
10732     /* "View.MemoryView":515
10733  *
10734  *         for i, c in enumerate(bytesvalue):
10735  *             itemp[i] = c             # <<<<<<<<<<<<<<
10736  *
10737  *     @cname('getbuffer')
10738  */
10739     __pyx_v_i = __pyx_t_9;
10740 
10741     /* "View.MemoryView":514
10742  *             bytesvalue = struct.pack(self.view.format, value)
10743  *
10744  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
10745  *             itemp[i] = c
10746  *
10747  */
10748     __pyx_t_9 = (__pyx_t_9 + 1);
10749 
10750     /* "View.MemoryView":515
10751  *
10752  *         for i, c in enumerate(bytesvalue):
10753  *             itemp[i] = c             # <<<<<<<<<<<<<<
10754  *
10755  *     @cname('getbuffer')
10756  */
10757     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10758   }
10759   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10760 
10761   /* "View.MemoryView":501
10762  *             return result
10763  *
10764  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
10765  *         """Only used if instantiated manually by the user, or if Cython doesn't
10766  *         know how to convert the type"""
10767  */
10768 
10769   /* function exit code */
10770   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10771   goto __pyx_L0;
10772   __pyx_L1_error:;
10773   __Pyx_XDECREF(__pyx_t_1);
10774   __Pyx_XDECREF(__pyx_t_4);
10775   __Pyx_XDECREF(__pyx_t_5);
10776   __Pyx_XDECREF(__pyx_t_6);
10777   __Pyx_XDECREF(__pyx_t_8);
10778   __Pyx_XDECREF(__pyx_t_10);
10779   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10780   __pyx_r = 0;
10781   __pyx_L0:;
10782   __Pyx_XDECREF(__pyx_v_struct);
10783   __Pyx_XDECREF(__pyx_v_bytesvalue);
10784   __Pyx_XGIVEREF(__pyx_r);
10785   __Pyx_RefNannyFinishContext();
10786   return __pyx_r;
10787 }
10788 
10789 /* "View.MemoryView":518
10790  *
10791  *     @cname('getbuffer')
10792  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
10793  *         if flags & PyBUF_WRITABLE and self.view.readonly:
10794  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10795  */
10796 
10797 /* Python wrapper */
10798 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_memoryview_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)10799 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10800   int __pyx_r;
10801   __Pyx_RefNannyDeclarations
10802   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10803   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10804 
10805   /* function exit code */
10806   __Pyx_RefNannyFinishContext();
10807   return __pyx_r;
10808 }
10809 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)10810 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10811   int __pyx_r;
10812   __Pyx_RefNannyDeclarations
10813   int __pyx_t_1;
10814   int __pyx_t_2;
10815   PyObject *__pyx_t_3 = NULL;
10816   Py_ssize_t *__pyx_t_4;
10817   char *__pyx_t_5;
10818   void *__pyx_t_6;
10819   int __pyx_t_7;
10820   Py_ssize_t __pyx_t_8;
10821   int __pyx_lineno = 0;
10822   const char *__pyx_filename = NULL;
10823   int __pyx_clineno = 0;
10824   if (__pyx_v_info == NULL) {
10825     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10826     return -1;
10827   }
10828   __Pyx_RefNannySetupContext("__getbuffer__", 0);
10829   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10830   __Pyx_GIVEREF(__pyx_v_info->obj);
10831 
10832   /* "View.MemoryView":519
10833  *     @cname('getbuffer')
10834  *     def __getbuffer__(self, Py_buffer *info, int flags):
10835  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
10836  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10837  *
10838  */
10839   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10840   if (__pyx_t_2) {
10841   } else {
10842     __pyx_t_1 = __pyx_t_2;
10843     goto __pyx_L4_bool_binop_done;
10844   }
10845   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
10846   __pyx_t_1 = __pyx_t_2;
10847   __pyx_L4_bool_binop_done:;
10848   if (unlikely(__pyx_t_1)) {
10849 
10850     /* "View.MemoryView":520
10851  *     def __getbuffer__(self, Py_buffer *info, int flags):
10852  *         if flags & PyBUF_WRITABLE and self.view.readonly:
10853  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
10854  *
10855  *         if flags & PyBUF_ND:
10856  */
10857     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
10858     __Pyx_GOTREF(__pyx_t_3);
10859     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10860     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10861     __PYX_ERR(2, 520, __pyx_L1_error)
10862 
10863     /* "View.MemoryView":519
10864  *     @cname('getbuffer')
10865  *     def __getbuffer__(self, Py_buffer *info, int flags):
10866  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
10867  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10868  *
10869  */
10870   }
10871 
10872   /* "View.MemoryView":522
10873  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10874  *
10875  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
10876  *             info.shape = self.view.shape
10877  *         else:
10878  */
10879   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10880   if (__pyx_t_1) {
10881 
10882     /* "View.MemoryView":523
10883  *
10884  *         if flags & PyBUF_ND:
10885  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
10886  *         else:
10887  *             info.shape = NULL
10888  */
10889     __pyx_t_4 = __pyx_v_self->view.shape;
10890     __pyx_v_info->shape = __pyx_t_4;
10891 
10892     /* "View.MemoryView":522
10893  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10894  *
10895  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
10896  *             info.shape = self.view.shape
10897  *         else:
10898  */
10899     goto __pyx_L6;
10900   }
10901 
10902   /* "View.MemoryView":525
10903  *             info.shape = self.view.shape
10904  *         else:
10905  *             info.shape = NULL             # <<<<<<<<<<<<<<
10906  *
10907  *         if flags & PyBUF_STRIDES:
10908  */
10909   /*else*/ {
10910     __pyx_v_info->shape = NULL;
10911   }
10912   __pyx_L6:;
10913 
10914   /* "View.MemoryView":527
10915  *             info.shape = NULL
10916  *
10917  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
10918  *             info.strides = self.view.strides
10919  *         else:
10920  */
10921   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10922   if (__pyx_t_1) {
10923 
10924     /* "View.MemoryView":528
10925  *
10926  *         if flags & PyBUF_STRIDES:
10927  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
10928  *         else:
10929  *             info.strides = NULL
10930  */
10931     __pyx_t_4 = __pyx_v_self->view.strides;
10932     __pyx_v_info->strides = __pyx_t_4;
10933 
10934     /* "View.MemoryView":527
10935  *             info.shape = NULL
10936  *
10937  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
10938  *             info.strides = self.view.strides
10939  *         else:
10940  */
10941     goto __pyx_L7;
10942   }
10943 
10944   /* "View.MemoryView":530
10945  *             info.strides = self.view.strides
10946  *         else:
10947  *             info.strides = NULL             # <<<<<<<<<<<<<<
10948  *
10949  *         if flags & PyBUF_INDIRECT:
10950  */
10951   /*else*/ {
10952     __pyx_v_info->strides = NULL;
10953   }
10954   __pyx_L7:;
10955 
10956   /* "View.MemoryView":532
10957  *             info.strides = NULL
10958  *
10959  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
10960  *             info.suboffsets = self.view.suboffsets
10961  *         else:
10962  */
10963   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10964   if (__pyx_t_1) {
10965 
10966     /* "View.MemoryView":533
10967  *
10968  *         if flags & PyBUF_INDIRECT:
10969  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
10970  *         else:
10971  *             info.suboffsets = NULL
10972  */
10973     __pyx_t_4 = __pyx_v_self->view.suboffsets;
10974     __pyx_v_info->suboffsets = __pyx_t_4;
10975 
10976     /* "View.MemoryView":532
10977  *             info.strides = NULL
10978  *
10979  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
10980  *             info.suboffsets = self.view.suboffsets
10981  *         else:
10982  */
10983     goto __pyx_L8;
10984   }
10985 
10986   /* "View.MemoryView":535
10987  *             info.suboffsets = self.view.suboffsets
10988  *         else:
10989  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
10990  *
10991  *         if flags & PyBUF_FORMAT:
10992  */
10993   /*else*/ {
10994     __pyx_v_info->suboffsets = NULL;
10995   }
10996   __pyx_L8:;
10997 
10998   /* "View.MemoryView":537
10999  *             info.suboffsets = NULL
11000  *
11001  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
11002  *             info.format = self.view.format
11003  *         else:
11004  */
11005   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11006   if (__pyx_t_1) {
11007 
11008     /* "View.MemoryView":538
11009  *
11010  *         if flags & PyBUF_FORMAT:
11011  *             info.format = self.view.format             # <<<<<<<<<<<<<<
11012  *         else:
11013  *             info.format = NULL
11014  */
11015     __pyx_t_5 = __pyx_v_self->view.format;
11016     __pyx_v_info->format = __pyx_t_5;
11017 
11018     /* "View.MemoryView":537
11019  *             info.suboffsets = NULL
11020  *
11021  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
11022  *             info.format = self.view.format
11023  *         else:
11024  */
11025     goto __pyx_L9;
11026   }
11027 
11028   /* "View.MemoryView":540
11029  *             info.format = self.view.format
11030  *         else:
11031  *             info.format = NULL             # <<<<<<<<<<<<<<
11032  *
11033  *         info.buf = self.view.buf
11034  */
11035   /*else*/ {
11036     __pyx_v_info->format = NULL;
11037   }
11038   __pyx_L9:;
11039 
11040   /* "View.MemoryView":542
11041  *             info.format = NULL
11042  *
11043  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
11044  *         info.ndim = self.view.ndim
11045  *         info.itemsize = self.view.itemsize
11046  */
11047   __pyx_t_6 = __pyx_v_self->view.buf;
11048   __pyx_v_info->buf = __pyx_t_6;
11049 
11050   /* "View.MemoryView":543
11051  *
11052  *         info.buf = self.view.buf
11053  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
11054  *         info.itemsize = self.view.itemsize
11055  *         info.len = self.view.len
11056  */
11057   __pyx_t_7 = __pyx_v_self->view.ndim;
11058   __pyx_v_info->ndim = __pyx_t_7;
11059 
11060   /* "View.MemoryView":544
11061  *         info.buf = self.view.buf
11062  *         info.ndim = self.view.ndim
11063  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
11064  *         info.len = self.view.len
11065  *         info.readonly = self.view.readonly
11066  */
11067   __pyx_t_8 = __pyx_v_self->view.itemsize;
11068   __pyx_v_info->itemsize = __pyx_t_8;
11069 
11070   /* "View.MemoryView":545
11071  *         info.ndim = self.view.ndim
11072  *         info.itemsize = self.view.itemsize
11073  *         info.len = self.view.len             # <<<<<<<<<<<<<<
11074  *         info.readonly = self.view.readonly
11075  *         info.obj = self
11076  */
11077   __pyx_t_8 = __pyx_v_self->view.len;
11078   __pyx_v_info->len = __pyx_t_8;
11079 
11080   /* "View.MemoryView":546
11081  *         info.itemsize = self.view.itemsize
11082  *         info.len = self.view.len
11083  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
11084  *         info.obj = self
11085  *
11086  */
11087   __pyx_t_1 = __pyx_v_self->view.readonly;
11088   __pyx_v_info->readonly = __pyx_t_1;
11089 
11090   /* "View.MemoryView":547
11091  *         info.len = self.view.len
11092  *         info.readonly = self.view.readonly
11093  *         info.obj = self             # <<<<<<<<<<<<<<
11094  *
11095  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
11096  */
11097   __Pyx_INCREF(((PyObject *)__pyx_v_self));
11098   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11099   __Pyx_GOTREF(__pyx_v_info->obj);
11100   __Pyx_DECREF(__pyx_v_info->obj);
11101   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11102 
11103   /* "View.MemoryView":518
11104  *
11105  *     @cname('getbuffer')
11106  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
11107  *         if flags & PyBUF_WRITABLE and self.view.readonly:
11108  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
11109  */
11110 
11111   /* function exit code */
11112   __pyx_r = 0;
11113   goto __pyx_L0;
11114   __pyx_L1_error:;
11115   __Pyx_XDECREF(__pyx_t_3);
11116   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11117   __pyx_r = -1;
11118   if (__pyx_v_info->obj != NULL) {
11119     __Pyx_GOTREF(__pyx_v_info->obj);
11120     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11121   }
11122   goto __pyx_L2;
11123   __pyx_L0:;
11124   if (__pyx_v_info->obj == Py_None) {
11125     __Pyx_GOTREF(__pyx_v_info->obj);
11126     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11127   }
11128   __pyx_L2:;
11129   __Pyx_RefNannyFinishContext();
11130   return __pyx_r;
11131 }
11132 
11133 /* "View.MemoryView":553
11134  *
11135  *     @property
11136  *     def T(self):             # <<<<<<<<<<<<<<
11137  *         cdef _memoryviewslice result = memoryview_copy(self)
11138  *         transpose_memslice(&result.from_slice)
11139  */
11140 
11141 /* Python wrapper */
11142 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject * __pyx_v_self)11143 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11144   PyObject *__pyx_r = 0;
11145   __Pyx_RefNannyDeclarations
11146   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11147   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11148 
11149   /* function exit code */
11150   __Pyx_RefNannyFinishContext();
11151   return __pyx_r;
11152 }
11153 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)11154 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11155   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11156   PyObject *__pyx_r = NULL;
11157   __Pyx_RefNannyDeclarations
11158   PyObject *__pyx_t_1 = NULL;
11159   int __pyx_t_2;
11160   int __pyx_lineno = 0;
11161   const char *__pyx_filename = NULL;
11162   int __pyx_clineno = 0;
11163   __Pyx_RefNannySetupContext("__get__", 0);
11164 
11165   /* "View.MemoryView":554
11166  *     @property
11167  *     def T(self):
11168  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
11169  *         transpose_memslice(&result.from_slice)
11170  *         return result
11171  */
11172   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
11173   __Pyx_GOTREF(__pyx_t_1);
11174   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
11175   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11176   __pyx_t_1 = 0;
11177 
11178   /* "View.MemoryView":555
11179  *     def T(self):
11180  *         cdef _memoryviewslice result = memoryview_copy(self)
11181  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
11182  *         return result
11183  *
11184  */
11185   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
11186 
11187   /* "View.MemoryView":556
11188  *         cdef _memoryviewslice result = memoryview_copy(self)
11189  *         transpose_memslice(&result.from_slice)
11190  *         return result             # <<<<<<<<<<<<<<
11191  *
11192  *     @property
11193  */
11194   __Pyx_XDECREF(__pyx_r);
11195   __Pyx_INCREF(((PyObject *)__pyx_v_result));
11196   __pyx_r = ((PyObject *)__pyx_v_result);
11197   goto __pyx_L0;
11198 
11199   /* "View.MemoryView":553
11200  *
11201  *     @property
11202  *     def T(self):             # <<<<<<<<<<<<<<
11203  *         cdef _memoryviewslice result = memoryview_copy(self)
11204  *         transpose_memslice(&result.from_slice)
11205  */
11206 
11207   /* function exit code */
11208   __pyx_L1_error:;
11209   __Pyx_XDECREF(__pyx_t_1);
11210   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11211   __pyx_r = NULL;
11212   __pyx_L0:;
11213   __Pyx_XDECREF((PyObject *)__pyx_v_result);
11214   __Pyx_XGIVEREF(__pyx_r);
11215   __Pyx_RefNannyFinishContext();
11216   return __pyx_r;
11217 }
11218 
11219 /* "View.MemoryView":559
11220  *
11221  *     @property
11222  *     def base(self):             # <<<<<<<<<<<<<<
11223  *         return self.obj
11224  *
11225  */
11226 
11227 /* Python wrapper */
11228 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject * __pyx_v_self)11229 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11230   PyObject *__pyx_r = 0;
11231   __Pyx_RefNannyDeclarations
11232   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11233   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11234 
11235   /* function exit code */
11236   __Pyx_RefNannyFinishContext();
11237   return __pyx_r;
11238 }
11239 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)11240 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11241   PyObject *__pyx_r = NULL;
11242   __Pyx_RefNannyDeclarations
11243   __Pyx_RefNannySetupContext("__get__", 0);
11244 
11245   /* "View.MemoryView":560
11246  *     @property
11247  *     def base(self):
11248  *         return self.obj             # <<<<<<<<<<<<<<
11249  *
11250  *     @property
11251  */
11252   __Pyx_XDECREF(__pyx_r);
11253   __Pyx_INCREF(__pyx_v_self->obj);
11254   __pyx_r = __pyx_v_self->obj;
11255   goto __pyx_L0;
11256 
11257   /* "View.MemoryView":559
11258  *
11259  *     @property
11260  *     def base(self):             # <<<<<<<<<<<<<<
11261  *         return self.obj
11262  *
11263  */
11264 
11265   /* function exit code */
11266   __pyx_L0:;
11267   __Pyx_XGIVEREF(__pyx_r);
11268   __Pyx_RefNannyFinishContext();
11269   return __pyx_r;
11270 }
11271 
11272 /* "View.MemoryView":563
11273  *
11274  *     @property
11275  *     def shape(self):             # <<<<<<<<<<<<<<
11276  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
11277  *
11278  */
11279 
11280 /* Python wrapper */
11281 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject * __pyx_v_self)11282 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11283   PyObject *__pyx_r = 0;
11284   __Pyx_RefNannyDeclarations
11285   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11286   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11287 
11288   /* function exit code */
11289   __Pyx_RefNannyFinishContext();
11290   return __pyx_r;
11291 }
11292 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)11293 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11294   Py_ssize_t __pyx_v_length;
11295   PyObject *__pyx_r = NULL;
11296   __Pyx_RefNannyDeclarations
11297   PyObject *__pyx_t_1 = NULL;
11298   Py_ssize_t *__pyx_t_2;
11299   Py_ssize_t *__pyx_t_3;
11300   Py_ssize_t *__pyx_t_4;
11301   PyObject *__pyx_t_5 = NULL;
11302   int __pyx_lineno = 0;
11303   const char *__pyx_filename = NULL;
11304   int __pyx_clineno = 0;
11305   __Pyx_RefNannySetupContext("__get__", 0);
11306 
11307   /* "View.MemoryView":564
11308  *     @property
11309  *     def shape(self):
11310  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
11311  *
11312  *     @property
11313  */
11314   __Pyx_XDECREF(__pyx_r);
11315   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
11316   __Pyx_GOTREF(__pyx_t_1);
11317   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11318   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11319     __pyx_t_2 = __pyx_t_4;
11320     __pyx_v_length = (__pyx_t_2[0]);
11321     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
11322     __Pyx_GOTREF(__pyx_t_5);
11323     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
11324     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11325   }
11326   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
11327   __Pyx_GOTREF(__pyx_t_5);
11328   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11329   __pyx_r = __pyx_t_5;
11330   __pyx_t_5 = 0;
11331   goto __pyx_L0;
11332 
11333   /* "View.MemoryView":563
11334  *
11335  *     @property
11336  *     def shape(self):             # <<<<<<<<<<<<<<
11337  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
11338  *
11339  */
11340 
11341   /* function exit code */
11342   __pyx_L1_error:;
11343   __Pyx_XDECREF(__pyx_t_1);
11344   __Pyx_XDECREF(__pyx_t_5);
11345   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11346   __pyx_r = NULL;
11347   __pyx_L0:;
11348   __Pyx_XGIVEREF(__pyx_r);
11349   __Pyx_RefNannyFinishContext();
11350   return __pyx_r;
11351 }
11352 
11353 /* "View.MemoryView":567
11354  *
11355  *     @property
11356  *     def strides(self):             # <<<<<<<<<<<<<<
11357  *         if self.view.strides == NULL:
11358  *
11359  */
11360 
11361 /* Python wrapper */
11362 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject * __pyx_v_self)11363 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11364   PyObject *__pyx_r = 0;
11365   __Pyx_RefNannyDeclarations
11366   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11367   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11368 
11369   /* function exit code */
11370   __Pyx_RefNannyFinishContext();
11371   return __pyx_r;
11372 }
11373 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)11374 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11375   Py_ssize_t __pyx_v_stride;
11376   PyObject *__pyx_r = NULL;
11377   __Pyx_RefNannyDeclarations
11378   int __pyx_t_1;
11379   PyObject *__pyx_t_2 = NULL;
11380   Py_ssize_t *__pyx_t_3;
11381   Py_ssize_t *__pyx_t_4;
11382   Py_ssize_t *__pyx_t_5;
11383   PyObject *__pyx_t_6 = NULL;
11384   int __pyx_lineno = 0;
11385   const char *__pyx_filename = NULL;
11386   int __pyx_clineno = 0;
11387   __Pyx_RefNannySetupContext("__get__", 0);
11388 
11389   /* "View.MemoryView":568
11390  *     @property
11391  *     def strides(self):
11392  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
11393  *
11394  *             raise ValueError("Buffer view does not expose strides")
11395  */
11396   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11397   if (unlikely(__pyx_t_1)) {
11398 
11399     /* "View.MemoryView":570
11400  *         if self.view.strides == NULL:
11401  *
11402  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
11403  *
11404  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11405  */
11406     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
11407     __Pyx_GOTREF(__pyx_t_2);
11408     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11409     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11410     __PYX_ERR(2, 570, __pyx_L1_error)
11411 
11412     /* "View.MemoryView":568
11413  *     @property
11414  *     def strides(self):
11415  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
11416  *
11417  *             raise ValueError("Buffer view does not expose strides")
11418  */
11419   }
11420 
11421   /* "View.MemoryView":572
11422  *             raise ValueError("Buffer view does not expose strides")
11423  *
11424  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
11425  *
11426  *     @property
11427  */
11428   __Pyx_XDECREF(__pyx_r);
11429   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
11430   __Pyx_GOTREF(__pyx_t_2);
11431   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11432   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11433     __pyx_t_3 = __pyx_t_5;
11434     __pyx_v_stride = (__pyx_t_3[0]);
11435     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
11436     __Pyx_GOTREF(__pyx_t_6);
11437     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
11438     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11439   }
11440   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
11441   __Pyx_GOTREF(__pyx_t_6);
11442   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11443   __pyx_r = __pyx_t_6;
11444   __pyx_t_6 = 0;
11445   goto __pyx_L0;
11446 
11447   /* "View.MemoryView":567
11448  *
11449  *     @property
11450  *     def strides(self):             # <<<<<<<<<<<<<<
11451  *         if self.view.strides == NULL:
11452  *
11453  */
11454 
11455   /* function exit code */
11456   __pyx_L1_error:;
11457   __Pyx_XDECREF(__pyx_t_2);
11458   __Pyx_XDECREF(__pyx_t_6);
11459   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11460   __pyx_r = NULL;
11461   __pyx_L0:;
11462   __Pyx_XGIVEREF(__pyx_r);
11463   __Pyx_RefNannyFinishContext();
11464   return __pyx_r;
11465 }
11466 
11467 /* "View.MemoryView":575
11468  *
11469  *     @property
11470  *     def suboffsets(self):             # <<<<<<<<<<<<<<
11471  *         if self.view.suboffsets == NULL:
11472  *             return (-1,) * self.view.ndim
11473  */
11474 
11475 /* Python wrapper */
11476 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject * __pyx_v_self)11477 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11478   PyObject *__pyx_r = 0;
11479   __Pyx_RefNannyDeclarations
11480   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11481   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11482 
11483   /* function exit code */
11484   __Pyx_RefNannyFinishContext();
11485   return __pyx_r;
11486 }
11487 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)11488 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11489   Py_ssize_t __pyx_v_suboffset;
11490   PyObject *__pyx_r = NULL;
11491   __Pyx_RefNannyDeclarations
11492   int __pyx_t_1;
11493   PyObject *__pyx_t_2 = NULL;
11494   PyObject *__pyx_t_3 = NULL;
11495   Py_ssize_t *__pyx_t_4;
11496   Py_ssize_t *__pyx_t_5;
11497   Py_ssize_t *__pyx_t_6;
11498   int __pyx_lineno = 0;
11499   const char *__pyx_filename = NULL;
11500   int __pyx_clineno = 0;
11501   __Pyx_RefNannySetupContext("__get__", 0);
11502 
11503   /* "View.MemoryView":576
11504  *     @property
11505  *     def suboffsets(self):
11506  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
11507  *             return (-1,) * self.view.ndim
11508  *
11509  */
11510   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11511   if (__pyx_t_1) {
11512 
11513     /* "View.MemoryView":577
11514  *     def suboffsets(self):
11515  *         if self.view.suboffsets == NULL:
11516  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
11517  *
11518  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11519  */
11520     __Pyx_XDECREF(__pyx_r);
11521     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
11522     __Pyx_GOTREF(__pyx_t_2);
11523     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
11524     __Pyx_GOTREF(__pyx_t_3);
11525     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11526     __pyx_r = __pyx_t_3;
11527     __pyx_t_3 = 0;
11528     goto __pyx_L0;
11529 
11530     /* "View.MemoryView":576
11531  *     @property
11532  *     def suboffsets(self):
11533  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
11534  *             return (-1,) * self.view.ndim
11535  *
11536  */
11537   }
11538 
11539   /* "View.MemoryView":579
11540  *             return (-1,) * self.view.ndim
11541  *
11542  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
11543  *
11544  *     @property
11545  */
11546   __Pyx_XDECREF(__pyx_r);
11547   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
11548   __Pyx_GOTREF(__pyx_t_3);
11549   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11550   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11551     __pyx_t_4 = __pyx_t_6;
11552     __pyx_v_suboffset = (__pyx_t_4[0]);
11553     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
11554     __Pyx_GOTREF(__pyx_t_2);
11555     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
11556     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11557   }
11558   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
11559   __Pyx_GOTREF(__pyx_t_2);
11560   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11561   __pyx_r = __pyx_t_2;
11562   __pyx_t_2 = 0;
11563   goto __pyx_L0;
11564 
11565   /* "View.MemoryView":575
11566  *
11567  *     @property
11568  *     def suboffsets(self):             # <<<<<<<<<<<<<<
11569  *         if self.view.suboffsets == NULL:
11570  *             return (-1,) * self.view.ndim
11571  */
11572 
11573   /* function exit code */
11574   __pyx_L1_error:;
11575   __Pyx_XDECREF(__pyx_t_2);
11576   __Pyx_XDECREF(__pyx_t_3);
11577   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11578   __pyx_r = NULL;
11579   __pyx_L0:;
11580   __Pyx_XGIVEREF(__pyx_r);
11581   __Pyx_RefNannyFinishContext();
11582   return __pyx_r;
11583 }
11584 
11585 /* "View.MemoryView":582
11586  *
11587  *     @property
11588  *     def ndim(self):             # <<<<<<<<<<<<<<
11589  *         return self.view.ndim
11590  *
11591  */
11592 
11593 /* Python wrapper */
11594 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject * __pyx_v_self)11595 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11596   PyObject *__pyx_r = 0;
11597   __Pyx_RefNannyDeclarations
11598   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11599   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11600 
11601   /* function exit code */
11602   __Pyx_RefNannyFinishContext();
11603   return __pyx_r;
11604 }
11605 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)11606 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11607   PyObject *__pyx_r = NULL;
11608   __Pyx_RefNannyDeclarations
11609   PyObject *__pyx_t_1 = NULL;
11610   int __pyx_lineno = 0;
11611   const char *__pyx_filename = NULL;
11612   int __pyx_clineno = 0;
11613   __Pyx_RefNannySetupContext("__get__", 0);
11614 
11615   /* "View.MemoryView":583
11616  *     @property
11617  *     def ndim(self):
11618  *         return self.view.ndim             # <<<<<<<<<<<<<<
11619  *
11620  *     @property
11621  */
11622   __Pyx_XDECREF(__pyx_r);
11623   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
11624   __Pyx_GOTREF(__pyx_t_1);
11625   __pyx_r = __pyx_t_1;
11626   __pyx_t_1 = 0;
11627   goto __pyx_L0;
11628 
11629   /* "View.MemoryView":582
11630  *
11631  *     @property
11632  *     def ndim(self):             # <<<<<<<<<<<<<<
11633  *         return self.view.ndim
11634  *
11635  */
11636 
11637   /* function exit code */
11638   __pyx_L1_error:;
11639   __Pyx_XDECREF(__pyx_t_1);
11640   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11641   __pyx_r = NULL;
11642   __pyx_L0:;
11643   __Pyx_XGIVEREF(__pyx_r);
11644   __Pyx_RefNannyFinishContext();
11645   return __pyx_r;
11646 }
11647 
11648 /* "View.MemoryView":586
11649  *
11650  *     @property
11651  *     def itemsize(self):             # <<<<<<<<<<<<<<
11652  *         return self.view.itemsize
11653  *
11654  */
11655 
11656 /* Python wrapper */
11657 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject * __pyx_v_self)11658 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11659   PyObject *__pyx_r = 0;
11660   __Pyx_RefNannyDeclarations
11661   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11662   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11663 
11664   /* function exit code */
11665   __Pyx_RefNannyFinishContext();
11666   return __pyx_r;
11667 }
11668 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)11669 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11670   PyObject *__pyx_r = NULL;
11671   __Pyx_RefNannyDeclarations
11672   PyObject *__pyx_t_1 = NULL;
11673   int __pyx_lineno = 0;
11674   const char *__pyx_filename = NULL;
11675   int __pyx_clineno = 0;
11676   __Pyx_RefNannySetupContext("__get__", 0);
11677 
11678   /* "View.MemoryView":587
11679  *     @property
11680  *     def itemsize(self):
11681  *         return self.view.itemsize             # <<<<<<<<<<<<<<
11682  *
11683  *     @property
11684  */
11685   __Pyx_XDECREF(__pyx_r);
11686   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
11687   __Pyx_GOTREF(__pyx_t_1);
11688   __pyx_r = __pyx_t_1;
11689   __pyx_t_1 = 0;
11690   goto __pyx_L0;
11691 
11692   /* "View.MemoryView":586
11693  *
11694  *     @property
11695  *     def itemsize(self):             # <<<<<<<<<<<<<<
11696  *         return self.view.itemsize
11697  *
11698  */
11699 
11700   /* function exit code */
11701   __pyx_L1_error:;
11702   __Pyx_XDECREF(__pyx_t_1);
11703   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11704   __pyx_r = NULL;
11705   __pyx_L0:;
11706   __Pyx_XGIVEREF(__pyx_r);
11707   __Pyx_RefNannyFinishContext();
11708   return __pyx_r;
11709 }
11710 
11711 /* "View.MemoryView":590
11712  *
11713  *     @property
11714  *     def nbytes(self):             # <<<<<<<<<<<<<<
11715  *         return self.size * self.view.itemsize
11716  *
11717  */
11718 
11719 /* Python wrapper */
11720 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject * __pyx_v_self)11721 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11722   PyObject *__pyx_r = 0;
11723   __Pyx_RefNannyDeclarations
11724   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11725   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11726 
11727   /* function exit code */
11728   __Pyx_RefNannyFinishContext();
11729   return __pyx_r;
11730 }
11731 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)11732 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11733   PyObject *__pyx_r = NULL;
11734   __Pyx_RefNannyDeclarations
11735   PyObject *__pyx_t_1 = NULL;
11736   PyObject *__pyx_t_2 = NULL;
11737   PyObject *__pyx_t_3 = NULL;
11738   int __pyx_lineno = 0;
11739   const char *__pyx_filename = NULL;
11740   int __pyx_clineno = 0;
11741   __Pyx_RefNannySetupContext("__get__", 0);
11742 
11743   /* "View.MemoryView":591
11744  *     @property
11745  *     def nbytes(self):
11746  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
11747  *
11748  *     @property
11749  */
11750   __Pyx_XDECREF(__pyx_r);
11751   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
11752   __Pyx_GOTREF(__pyx_t_1);
11753   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
11754   __Pyx_GOTREF(__pyx_t_2);
11755   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
11756   __Pyx_GOTREF(__pyx_t_3);
11757   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11758   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11759   __pyx_r = __pyx_t_3;
11760   __pyx_t_3 = 0;
11761   goto __pyx_L0;
11762 
11763   /* "View.MemoryView":590
11764  *
11765  *     @property
11766  *     def nbytes(self):             # <<<<<<<<<<<<<<
11767  *         return self.size * self.view.itemsize
11768  *
11769  */
11770 
11771   /* function exit code */
11772   __pyx_L1_error:;
11773   __Pyx_XDECREF(__pyx_t_1);
11774   __Pyx_XDECREF(__pyx_t_2);
11775   __Pyx_XDECREF(__pyx_t_3);
11776   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11777   __pyx_r = NULL;
11778   __pyx_L0:;
11779   __Pyx_XGIVEREF(__pyx_r);
11780   __Pyx_RefNannyFinishContext();
11781   return __pyx_r;
11782 }
11783 
11784 /* "View.MemoryView":594
11785  *
11786  *     @property
11787  *     def size(self):             # <<<<<<<<<<<<<<
11788  *         if self._size is None:
11789  *             result = 1
11790  */
11791 
11792 /* Python wrapper */
11793 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject * __pyx_v_self)11794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11795   PyObject *__pyx_r = 0;
11796   __Pyx_RefNannyDeclarations
11797   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11798   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11799 
11800   /* function exit code */
11801   __Pyx_RefNannyFinishContext();
11802   return __pyx_r;
11803 }
11804 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)11805 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11806   PyObject *__pyx_v_result = NULL;
11807   PyObject *__pyx_v_length = NULL;
11808   PyObject *__pyx_r = NULL;
11809   __Pyx_RefNannyDeclarations
11810   int __pyx_t_1;
11811   int __pyx_t_2;
11812   Py_ssize_t *__pyx_t_3;
11813   Py_ssize_t *__pyx_t_4;
11814   Py_ssize_t *__pyx_t_5;
11815   PyObject *__pyx_t_6 = NULL;
11816   int __pyx_lineno = 0;
11817   const char *__pyx_filename = NULL;
11818   int __pyx_clineno = 0;
11819   __Pyx_RefNannySetupContext("__get__", 0);
11820 
11821   /* "View.MemoryView":595
11822  *     @property
11823  *     def size(self):
11824  *         if self._size is None:             # <<<<<<<<<<<<<<
11825  *             result = 1
11826  *
11827  */
11828   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11829   __pyx_t_2 = (__pyx_t_1 != 0);
11830   if (__pyx_t_2) {
11831 
11832     /* "View.MemoryView":596
11833  *     def size(self):
11834  *         if self._size is None:
11835  *             result = 1             # <<<<<<<<<<<<<<
11836  *
11837  *             for length in self.view.shape[:self.view.ndim]:
11838  */
11839     __Pyx_INCREF(__pyx_int_1);
11840     __pyx_v_result = __pyx_int_1;
11841 
11842     /* "View.MemoryView":598
11843  *             result = 1
11844  *
11845  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
11846  *                 result *= length
11847  *
11848  */
11849     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11850     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11851       __pyx_t_3 = __pyx_t_5;
11852       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
11853       __Pyx_GOTREF(__pyx_t_6);
11854       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
11855       __pyx_t_6 = 0;
11856 
11857       /* "View.MemoryView":599
11858  *
11859  *             for length in self.view.shape[:self.view.ndim]:
11860  *                 result *= length             # <<<<<<<<<<<<<<
11861  *
11862  *             self._size = result
11863  */
11864       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
11865       __Pyx_GOTREF(__pyx_t_6);
11866       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
11867       __pyx_t_6 = 0;
11868     }
11869 
11870     /* "View.MemoryView":601
11871  *                 result *= length
11872  *
11873  *             self._size = result             # <<<<<<<<<<<<<<
11874  *
11875  *         return self._size
11876  */
11877     __Pyx_INCREF(__pyx_v_result);
11878     __Pyx_GIVEREF(__pyx_v_result);
11879     __Pyx_GOTREF(__pyx_v_self->_size);
11880     __Pyx_DECREF(__pyx_v_self->_size);
11881     __pyx_v_self->_size = __pyx_v_result;
11882 
11883     /* "View.MemoryView":595
11884  *     @property
11885  *     def size(self):
11886  *         if self._size is None:             # <<<<<<<<<<<<<<
11887  *             result = 1
11888  *
11889  */
11890   }
11891 
11892   /* "View.MemoryView":603
11893  *             self._size = result
11894  *
11895  *         return self._size             # <<<<<<<<<<<<<<
11896  *
11897  *     def __len__(self):
11898  */
11899   __Pyx_XDECREF(__pyx_r);
11900   __Pyx_INCREF(__pyx_v_self->_size);
11901   __pyx_r = __pyx_v_self->_size;
11902   goto __pyx_L0;
11903 
11904   /* "View.MemoryView":594
11905  *
11906  *     @property
11907  *     def size(self):             # <<<<<<<<<<<<<<
11908  *         if self._size is None:
11909  *             result = 1
11910  */
11911 
11912   /* function exit code */
11913   __pyx_L1_error:;
11914   __Pyx_XDECREF(__pyx_t_6);
11915   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11916   __pyx_r = NULL;
11917   __pyx_L0:;
11918   __Pyx_XDECREF(__pyx_v_result);
11919   __Pyx_XDECREF(__pyx_v_length);
11920   __Pyx_XGIVEREF(__pyx_r);
11921   __Pyx_RefNannyFinishContext();
11922   return __pyx_r;
11923 }
11924 
11925 /* "View.MemoryView":605
11926  *         return self._size
11927  *
11928  *     def __len__(self):             # <<<<<<<<<<<<<<
11929  *         if self.view.ndim >= 1:
11930  *             return self.view.shape[0]
11931  */
11932 
11933 /* Python wrapper */
11934 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)11935 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11936   Py_ssize_t __pyx_r;
11937   __Pyx_RefNannyDeclarations
11938   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11939   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11940 
11941   /* function exit code */
11942   __Pyx_RefNannyFinishContext();
11943   return __pyx_r;
11944 }
11945 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)11946 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11947   Py_ssize_t __pyx_r;
11948   __Pyx_RefNannyDeclarations
11949   int __pyx_t_1;
11950   __Pyx_RefNannySetupContext("__len__", 0);
11951 
11952   /* "View.MemoryView":606
11953  *
11954  *     def __len__(self):
11955  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
11956  *             return self.view.shape[0]
11957  *
11958  */
11959   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
11960   if (__pyx_t_1) {
11961 
11962     /* "View.MemoryView":607
11963  *     def __len__(self):
11964  *         if self.view.ndim >= 1:
11965  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
11966  *
11967  *         return 0
11968  */
11969     __pyx_r = (__pyx_v_self->view.shape[0]);
11970     goto __pyx_L0;
11971 
11972     /* "View.MemoryView":606
11973  *
11974  *     def __len__(self):
11975  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
11976  *             return self.view.shape[0]
11977  *
11978  */
11979   }
11980 
11981   /* "View.MemoryView":609
11982  *             return self.view.shape[0]
11983  *
11984  *         return 0             # <<<<<<<<<<<<<<
11985  *
11986  *     def __repr__(self):
11987  */
11988   __pyx_r = 0;
11989   goto __pyx_L0;
11990 
11991   /* "View.MemoryView":605
11992  *         return self._size
11993  *
11994  *     def __len__(self):             # <<<<<<<<<<<<<<
11995  *         if self.view.ndim >= 1:
11996  *             return self.view.shape[0]
11997  */
11998 
11999   /* function exit code */
12000   __pyx_L0:;
12001   __Pyx_RefNannyFinishContext();
12002   return __pyx_r;
12003 }
12004 
12005 /* "View.MemoryView":611
12006  *         return 0
12007  *
12008  *     def __repr__(self):             # <<<<<<<<<<<<<<
12009  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12010  *                                                id(self))
12011  */
12012 
12013 /* Python wrapper */
12014 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)12015 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12016   PyObject *__pyx_r = 0;
12017   __Pyx_RefNannyDeclarations
12018   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12019   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12020 
12021   /* function exit code */
12022   __Pyx_RefNannyFinishContext();
12023   return __pyx_r;
12024 }
12025 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)12026 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
12027   PyObject *__pyx_r = NULL;
12028   __Pyx_RefNannyDeclarations
12029   PyObject *__pyx_t_1 = NULL;
12030   PyObject *__pyx_t_2 = NULL;
12031   PyObject *__pyx_t_3 = NULL;
12032   int __pyx_lineno = 0;
12033   const char *__pyx_filename = NULL;
12034   int __pyx_clineno = 0;
12035   __Pyx_RefNannySetupContext("__repr__", 0);
12036 
12037   /* "View.MemoryView":612
12038  *
12039  *     def __repr__(self):
12040  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
12041  *                                                id(self))
12042  *
12043  */
12044   __Pyx_XDECREF(__pyx_r);
12045   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
12046   __Pyx_GOTREF(__pyx_t_1);
12047   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
12048   __Pyx_GOTREF(__pyx_t_2);
12049   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12050   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
12051   __Pyx_GOTREF(__pyx_t_1);
12052   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12053 
12054   /* "View.MemoryView":613
12055  *     def __repr__(self):
12056  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12057  *                                                id(self))             # <<<<<<<<<<<<<<
12058  *
12059  *     def __str__(self):
12060  */
12061   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
12062   __Pyx_GOTREF(__pyx_t_2);
12063 
12064   /* "View.MemoryView":612
12065  *
12066  *     def __repr__(self):
12067  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
12068  *                                                id(self))
12069  *
12070  */
12071   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
12072   __Pyx_GOTREF(__pyx_t_3);
12073   __Pyx_GIVEREF(__pyx_t_1);
12074   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12075   __Pyx_GIVEREF(__pyx_t_2);
12076   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12077   __pyx_t_1 = 0;
12078   __pyx_t_2 = 0;
12079   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
12080   __Pyx_GOTREF(__pyx_t_2);
12081   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12082   __pyx_r = __pyx_t_2;
12083   __pyx_t_2 = 0;
12084   goto __pyx_L0;
12085 
12086   /* "View.MemoryView":611
12087  *         return 0
12088  *
12089  *     def __repr__(self):             # <<<<<<<<<<<<<<
12090  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12091  *                                                id(self))
12092  */
12093 
12094   /* function exit code */
12095   __pyx_L1_error:;
12096   __Pyx_XDECREF(__pyx_t_1);
12097   __Pyx_XDECREF(__pyx_t_2);
12098   __Pyx_XDECREF(__pyx_t_3);
12099   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12100   __pyx_r = NULL;
12101   __pyx_L0:;
12102   __Pyx_XGIVEREF(__pyx_r);
12103   __Pyx_RefNannyFinishContext();
12104   return __pyx_r;
12105 }
12106 
12107 /* "View.MemoryView":615
12108  *                                                id(self))
12109  *
12110  *     def __str__(self):             # <<<<<<<<<<<<<<
12111  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12112  *
12113  */
12114 
12115 /* Python wrapper */
12116 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)12117 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12118   PyObject *__pyx_r = 0;
12119   __Pyx_RefNannyDeclarations
12120   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12121   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12122 
12123   /* function exit code */
12124   __Pyx_RefNannyFinishContext();
12125   return __pyx_r;
12126 }
12127 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)12128 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12129   PyObject *__pyx_r = NULL;
12130   __Pyx_RefNannyDeclarations
12131   PyObject *__pyx_t_1 = NULL;
12132   PyObject *__pyx_t_2 = NULL;
12133   int __pyx_lineno = 0;
12134   const char *__pyx_filename = NULL;
12135   int __pyx_clineno = 0;
12136   __Pyx_RefNannySetupContext("__str__", 0);
12137 
12138   /* "View.MemoryView":616
12139  *
12140  *     def __str__(self):
12141  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
12142  *
12143  *
12144  */
12145   __Pyx_XDECREF(__pyx_r);
12146   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
12147   __Pyx_GOTREF(__pyx_t_1);
12148   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
12149   __Pyx_GOTREF(__pyx_t_2);
12150   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12151   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
12152   __Pyx_GOTREF(__pyx_t_1);
12153   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12154   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
12155   __Pyx_GOTREF(__pyx_t_2);
12156   __Pyx_GIVEREF(__pyx_t_1);
12157   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12158   __pyx_t_1 = 0;
12159   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
12160   __Pyx_GOTREF(__pyx_t_1);
12161   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12162   __pyx_r = __pyx_t_1;
12163   __pyx_t_1 = 0;
12164   goto __pyx_L0;
12165 
12166   /* "View.MemoryView":615
12167  *                                                id(self))
12168  *
12169  *     def __str__(self):             # <<<<<<<<<<<<<<
12170  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12171  *
12172  */
12173 
12174   /* function exit code */
12175   __pyx_L1_error:;
12176   __Pyx_XDECREF(__pyx_t_1);
12177   __Pyx_XDECREF(__pyx_t_2);
12178   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12179   __pyx_r = NULL;
12180   __pyx_L0:;
12181   __Pyx_XGIVEREF(__pyx_r);
12182   __Pyx_RefNannyFinishContext();
12183   return __pyx_r;
12184 }
12185 
12186 /* "View.MemoryView":619
12187  *
12188  *
12189  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
12190  *         cdef __Pyx_memviewslice *mslice
12191  *         cdef __Pyx_memviewslice tmp
12192  */
12193 
12194 /* Python wrapper */
12195 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_c_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12196 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12197   PyObject *__pyx_r = 0;
12198   __Pyx_RefNannyDeclarations
12199   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12200   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12201 
12202   /* function exit code */
12203   __Pyx_RefNannyFinishContext();
12204   return __pyx_r;
12205 }
12206 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)12207 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12208   __Pyx_memviewslice *__pyx_v_mslice;
12209   __Pyx_memviewslice __pyx_v_tmp;
12210   PyObject *__pyx_r = NULL;
12211   __Pyx_RefNannyDeclarations
12212   __Pyx_memviewslice *__pyx_t_1;
12213   PyObject *__pyx_t_2 = NULL;
12214   int __pyx_lineno = 0;
12215   const char *__pyx_filename = NULL;
12216   int __pyx_clineno = 0;
12217   __Pyx_RefNannySetupContext("is_c_contig", 0);
12218 
12219   /* "View.MemoryView":622
12220  *         cdef __Pyx_memviewslice *mslice
12221  *         cdef __Pyx_memviewslice tmp
12222  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
12223  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
12224  *
12225  */
12226   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error)
12227   __pyx_v_mslice = __pyx_t_1;
12228 
12229   /* "View.MemoryView":623
12230  *         cdef __Pyx_memviewslice tmp
12231  *         mslice = get_slice_from_memview(self, &tmp)
12232  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
12233  *
12234  *     def is_f_contig(self):
12235  */
12236   __Pyx_XDECREF(__pyx_r);
12237   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 623, __pyx_L1_error)
12238   __Pyx_GOTREF(__pyx_t_2);
12239   __pyx_r = __pyx_t_2;
12240   __pyx_t_2 = 0;
12241   goto __pyx_L0;
12242 
12243   /* "View.MemoryView":619
12244  *
12245  *
12246  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
12247  *         cdef __Pyx_memviewslice *mslice
12248  *         cdef __Pyx_memviewslice tmp
12249  */
12250 
12251   /* function exit code */
12252   __pyx_L1_error:;
12253   __Pyx_XDECREF(__pyx_t_2);
12254   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12255   __pyx_r = NULL;
12256   __pyx_L0:;
12257   __Pyx_XGIVEREF(__pyx_r);
12258   __Pyx_RefNannyFinishContext();
12259   return __pyx_r;
12260 }
12261 
12262 /* "View.MemoryView":625
12263  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
12264  *
12265  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
12266  *         cdef __Pyx_memviewslice *mslice
12267  *         cdef __Pyx_memviewslice tmp
12268  */
12269 
12270 /* Python wrapper */
12271 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_f_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12272 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12273   PyObject *__pyx_r = 0;
12274   __Pyx_RefNannyDeclarations
12275   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12276   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12277 
12278   /* function exit code */
12279   __Pyx_RefNannyFinishContext();
12280   return __pyx_r;
12281 }
12282 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)12283 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12284   __Pyx_memviewslice *__pyx_v_mslice;
12285   __Pyx_memviewslice __pyx_v_tmp;
12286   PyObject *__pyx_r = NULL;
12287   __Pyx_RefNannyDeclarations
12288   __Pyx_memviewslice *__pyx_t_1;
12289   PyObject *__pyx_t_2 = NULL;
12290   int __pyx_lineno = 0;
12291   const char *__pyx_filename = NULL;
12292   int __pyx_clineno = 0;
12293   __Pyx_RefNannySetupContext("is_f_contig", 0);
12294 
12295   /* "View.MemoryView":628
12296  *         cdef __Pyx_memviewslice *mslice
12297  *         cdef __Pyx_memviewslice tmp
12298  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
12299  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
12300  *
12301  */
12302   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error)
12303   __pyx_v_mslice = __pyx_t_1;
12304 
12305   /* "View.MemoryView":629
12306  *         cdef __Pyx_memviewslice tmp
12307  *         mslice = get_slice_from_memview(self, &tmp)
12308  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
12309  *
12310  *     def copy(self):
12311  */
12312   __Pyx_XDECREF(__pyx_r);
12313   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 629, __pyx_L1_error)
12314   __Pyx_GOTREF(__pyx_t_2);
12315   __pyx_r = __pyx_t_2;
12316   __pyx_t_2 = 0;
12317   goto __pyx_L0;
12318 
12319   /* "View.MemoryView":625
12320  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
12321  *
12322  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
12323  *         cdef __Pyx_memviewslice *mslice
12324  *         cdef __Pyx_memviewslice tmp
12325  */
12326 
12327   /* function exit code */
12328   __pyx_L1_error:;
12329   __Pyx_XDECREF(__pyx_t_2);
12330   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12331   __pyx_r = NULL;
12332   __pyx_L0:;
12333   __Pyx_XGIVEREF(__pyx_r);
12334   __Pyx_RefNannyFinishContext();
12335   return __pyx_r;
12336 }
12337 
12338 /* "View.MemoryView":631
12339  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
12340  *
12341  *     def copy(self):             # <<<<<<<<<<<<<<
12342  *         cdef __Pyx_memviewslice mslice
12343  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12344  */
12345 
12346 /* Python wrapper */
12347 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12348 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12349   PyObject *__pyx_r = 0;
12350   __Pyx_RefNannyDeclarations
12351   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12352   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12353 
12354   /* function exit code */
12355   __Pyx_RefNannyFinishContext();
12356   return __pyx_r;
12357 }
12358 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)12359 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12360   __Pyx_memviewslice __pyx_v_mslice;
12361   int __pyx_v_flags;
12362   PyObject *__pyx_r = NULL;
12363   __Pyx_RefNannyDeclarations
12364   __Pyx_memviewslice __pyx_t_1;
12365   PyObject *__pyx_t_2 = NULL;
12366   int __pyx_lineno = 0;
12367   const char *__pyx_filename = NULL;
12368   int __pyx_clineno = 0;
12369   __Pyx_RefNannySetupContext("copy", 0);
12370 
12371   /* "View.MemoryView":633
12372  *     def copy(self):
12373  *         cdef __Pyx_memviewslice mslice
12374  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
12375  *
12376  *         slice_copy(self, &mslice)
12377  */
12378   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12379 
12380   /* "View.MemoryView":635
12381  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12382  *
12383  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
12384  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12385  *                                    self.view.itemsize,
12386  */
12387   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12388 
12389   /* "View.MemoryView":636
12390  *
12391  *         slice_copy(self, &mslice)
12392  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
12393  *                                    self.view.itemsize,
12394  *                                    flags|PyBUF_C_CONTIGUOUS,
12395  */
12396   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 636, __pyx_L1_error)
12397   __pyx_v_mslice = __pyx_t_1;
12398 
12399   /* "View.MemoryView":641
12400  *                                    self.dtype_is_object)
12401  *
12402  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
12403  *
12404  *     def copy_fortran(self):
12405  */
12406   __Pyx_XDECREF(__pyx_r);
12407   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
12408   __Pyx_GOTREF(__pyx_t_2);
12409   __pyx_r = __pyx_t_2;
12410   __pyx_t_2 = 0;
12411   goto __pyx_L0;
12412 
12413   /* "View.MemoryView":631
12414  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
12415  *
12416  *     def copy(self):             # <<<<<<<<<<<<<<
12417  *         cdef __Pyx_memviewslice mslice
12418  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12419  */
12420 
12421   /* function exit code */
12422   __pyx_L1_error:;
12423   __Pyx_XDECREF(__pyx_t_2);
12424   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12425   __pyx_r = NULL;
12426   __pyx_L0:;
12427   __Pyx_XGIVEREF(__pyx_r);
12428   __Pyx_RefNannyFinishContext();
12429   return __pyx_r;
12430 }
12431 
12432 /* "View.MemoryView":643
12433  *         return memoryview_copy_from_slice(self, &mslice)
12434  *
12435  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
12436  *         cdef __Pyx_memviewslice src, dst
12437  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12438  */
12439 
12440 /* Python wrapper */
12441 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy_fortran(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12442 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12443   PyObject *__pyx_r = 0;
12444   __Pyx_RefNannyDeclarations
12445   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12446   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12447 
12448   /* function exit code */
12449   __Pyx_RefNannyFinishContext();
12450   return __pyx_r;
12451 }
12452 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)12453 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12454   __Pyx_memviewslice __pyx_v_src;
12455   __Pyx_memviewslice __pyx_v_dst;
12456   int __pyx_v_flags;
12457   PyObject *__pyx_r = NULL;
12458   __Pyx_RefNannyDeclarations
12459   __Pyx_memviewslice __pyx_t_1;
12460   PyObject *__pyx_t_2 = NULL;
12461   int __pyx_lineno = 0;
12462   const char *__pyx_filename = NULL;
12463   int __pyx_clineno = 0;
12464   __Pyx_RefNannySetupContext("copy_fortran", 0);
12465 
12466   /* "View.MemoryView":645
12467  *     def copy_fortran(self):
12468  *         cdef __Pyx_memviewslice src, dst
12469  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
12470  *
12471  *         slice_copy(self, &src)
12472  */
12473   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12474 
12475   /* "View.MemoryView":647
12476  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12477  *
12478  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
12479  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12480  *                                 self.view.itemsize,
12481  */
12482   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12483 
12484   /* "View.MemoryView":648
12485  *
12486  *         slice_copy(self, &src)
12487  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
12488  *                                 self.view.itemsize,
12489  *                                 flags|PyBUF_F_CONTIGUOUS,
12490  */
12491   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 648, __pyx_L1_error)
12492   __pyx_v_dst = __pyx_t_1;
12493 
12494   /* "View.MemoryView":653
12495  *                                 self.dtype_is_object)
12496  *
12497  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
12498  *
12499  *
12500  */
12501   __Pyx_XDECREF(__pyx_r);
12502   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
12503   __Pyx_GOTREF(__pyx_t_2);
12504   __pyx_r = __pyx_t_2;
12505   __pyx_t_2 = 0;
12506   goto __pyx_L0;
12507 
12508   /* "View.MemoryView":643
12509  *         return memoryview_copy_from_slice(self, &mslice)
12510  *
12511  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
12512  *         cdef __Pyx_memviewslice src, dst
12513  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12514  */
12515 
12516   /* function exit code */
12517   __pyx_L1_error:;
12518   __Pyx_XDECREF(__pyx_t_2);
12519   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12520   __pyx_r = NULL;
12521   __pyx_L0:;
12522   __Pyx_XGIVEREF(__pyx_r);
12523   __Pyx_RefNannyFinishContext();
12524   return __pyx_r;
12525 }
12526 
12527 /* "(tree fragment)":1
12528  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12529  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12530  * def __setstate_cython__(self, __pyx_state):
12531  */
12532 
12533 /* Python wrapper */
12534 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12535 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12536   PyObject *__pyx_r = 0;
12537   __Pyx_RefNannyDeclarations
12538   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12539   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12540 
12541   /* function exit code */
12542   __Pyx_RefNannyFinishContext();
12543   return __pyx_r;
12544 }
12545 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)12546 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12547   PyObject *__pyx_r = NULL;
12548   __Pyx_RefNannyDeclarations
12549   PyObject *__pyx_t_1 = NULL;
12550   int __pyx_lineno = 0;
12551   const char *__pyx_filename = NULL;
12552   int __pyx_clineno = 0;
12553   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12554 
12555   /* "(tree fragment)":2
12556  * def __reduce_cython__(self):
12557  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
12558  * def __setstate_cython__(self, __pyx_state):
12559  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12560  */
12561   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
12562   __Pyx_GOTREF(__pyx_t_1);
12563   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12564   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12565   __PYX_ERR(2, 2, __pyx_L1_error)
12566 
12567   /* "(tree fragment)":1
12568  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12569  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12570  * def __setstate_cython__(self, __pyx_state):
12571  */
12572 
12573   /* function exit code */
12574   __pyx_L1_error:;
12575   __Pyx_XDECREF(__pyx_t_1);
12576   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12577   __pyx_r = NULL;
12578   __Pyx_XGIVEREF(__pyx_r);
12579   __Pyx_RefNannyFinishContext();
12580   return __pyx_r;
12581 }
12582 
12583 /* "(tree fragment)":3
12584  * def __reduce_cython__(self):
12585  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12586  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12587  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12588  */
12589 
12590 /* Python wrapper */
12591 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12592 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12593   PyObject *__pyx_r = 0;
12594   __Pyx_RefNannyDeclarations
12595   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12596   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12597 
12598   /* function exit code */
12599   __Pyx_RefNannyFinishContext();
12600   return __pyx_r;
12601 }
12602 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12603 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12604   PyObject *__pyx_r = NULL;
12605   __Pyx_RefNannyDeclarations
12606   PyObject *__pyx_t_1 = NULL;
12607   int __pyx_lineno = 0;
12608   const char *__pyx_filename = NULL;
12609   int __pyx_clineno = 0;
12610   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12611 
12612   /* "(tree fragment)":4
12613  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12614  * def __setstate_cython__(self, __pyx_state):
12615  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
12616  */
12617   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
12618   __Pyx_GOTREF(__pyx_t_1);
12619   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12620   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12621   __PYX_ERR(2, 4, __pyx_L1_error)
12622 
12623   /* "(tree fragment)":3
12624  * def __reduce_cython__(self):
12625  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12626  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12627  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12628  */
12629 
12630   /* function exit code */
12631   __pyx_L1_error:;
12632   __Pyx_XDECREF(__pyx_t_1);
12633   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12634   __pyx_r = NULL;
12635   __Pyx_XGIVEREF(__pyx_r);
12636   __Pyx_RefNannyFinishContext();
12637   return __pyx_r;
12638 }
12639 
12640 /* "View.MemoryView":657
12641  *
12642  * @cname('__pyx_memoryview_new')
12643  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
12644  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12645  *     result.typeinfo = typeinfo
12646  */
12647 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)12648 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12649   struct __pyx_memoryview_obj *__pyx_v_result = 0;
12650   PyObject *__pyx_r = NULL;
12651   __Pyx_RefNannyDeclarations
12652   PyObject *__pyx_t_1 = NULL;
12653   PyObject *__pyx_t_2 = NULL;
12654   PyObject *__pyx_t_3 = NULL;
12655   int __pyx_lineno = 0;
12656   const char *__pyx_filename = NULL;
12657   int __pyx_clineno = 0;
12658   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12659 
12660   /* "View.MemoryView":658
12661  * @cname('__pyx_memoryview_new')
12662  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12663  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
12664  *     result.typeinfo = typeinfo
12665  *     return result
12666  */
12667   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
12668   __Pyx_GOTREF(__pyx_t_1);
12669   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
12670   __Pyx_GOTREF(__pyx_t_2);
12671   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
12672   __Pyx_GOTREF(__pyx_t_3);
12673   __Pyx_INCREF(__pyx_v_o);
12674   __Pyx_GIVEREF(__pyx_v_o);
12675   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
12676   __Pyx_GIVEREF(__pyx_t_1);
12677   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12678   __Pyx_GIVEREF(__pyx_t_2);
12679   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12680   __pyx_t_1 = 0;
12681   __pyx_t_2 = 0;
12682   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
12683   __Pyx_GOTREF(__pyx_t_2);
12684   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12685   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12686   __pyx_t_2 = 0;
12687 
12688   /* "View.MemoryView":659
12689  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12690  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12691  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
12692  *     return result
12693  *
12694  */
12695   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12696 
12697   /* "View.MemoryView":660
12698  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12699  *     result.typeinfo = typeinfo
12700  *     return result             # <<<<<<<<<<<<<<
12701  *
12702  * @cname('__pyx_memoryview_check')
12703  */
12704   __Pyx_XDECREF(__pyx_r);
12705   __Pyx_INCREF(((PyObject *)__pyx_v_result));
12706   __pyx_r = ((PyObject *)__pyx_v_result);
12707   goto __pyx_L0;
12708 
12709   /* "View.MemoryView":657
12710  *
12711  * @cname('__pyx_memoryview_new')
12712  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
12713  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12714  *     result.typeinfo = typeinfo
12715  */
12716 
12717   /* function exit code */
12718   __pyx_L1_error:;
12719   __Pyx_XDECREF(__pyx_t_1);
12720   __Pyx_XDECREF(__pyx_t_2);
12721   __Pyx_XDECREF(__pyx_t_3);
12722   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12723   __pyx_r = 0;
12724   __pyx_L0:;
12725   __Pyx_XDECREF((PyObject *)__pyx_v_result);
12726   __Pyx_XGIVEREF(__pyx_r);
12727   __Pyx_RefNannyFinishContext();
12728   return __pyx_r;
12729 }
12730 
12731 /* "View.MemoryView":663
12732  *
12733  * @cname('__pyx_memoryview_check')
12734  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
12735  *     return isinstance(o, memoryview)
12736  *
12737  */
12738 
__pyx_memoryview_check(PyObject * __pyx_v_o)12739 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12740   int __pyx_r;
12741   __Pyx_RefNannyDeclarations
12742   int __pyx_t_1;
12743   __Pyx_RefNannySetupContext("memoryview_check", 0);
12744 
12745   /* "View.MemoryView":664
12746  * @cname('__pyx_memoryview_check')
12747  * cdef inline bint memoryview_check(object o):
12748  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
12749  *
12750  * cdef tuple _unellipsify(object index, int ndim):
12751  */
12752   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12753   __pyx_r = __pyx_t_1;
12754   goto __pyx_L0;
12755 
12756   /* "View.MemoryView":663
12757  *
12758  * @cname('__pyx_memoryview_check')
12759  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
12760  *     return isinstance(o, memoryview)
12761  *
12762  */
12763 
12764   /* function exit code */
12765   __pyx_L0:;
12766   __Pyx_RefNannyFinishContext();
12767   return __pyx_r;
12768 }
12769 
12770 /* "View.MemoryView":666
12771  *     return isinstance(o, memoryview)
12772  *
12773  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
12774  *     """
12775  *     Replace all ellipses with full slices and fill incomplete indices with
12776  */
12777 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)12778 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12779   PyObject *__pyx_v_tup = NULL;
12780   PyObject *__pyx_v_result = NULL;
12781   int __pyx_v_have_slices;
12782   int __pyx_v_seen_ellipsis;
12783   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
12784   PyObject *__pyx_v_item = NULL;
12785   Py_ssize_t __pyx_v_nslices;
12786   PyObject *__pyx_r = NULL;
12787   __Pyx_RefNannyDeclarations
12788   int __pyx_t_1;
12789   int __pyx_t_2;
12790   PyObject *__pyx_t_3 = NULL;
12791   PyObject *__pyx_t_4 = NULL;
12792   Py_ssize_t __pyx_t_5;
12793   PyObject *(*__pyx_t_6)(PyObject *);
12794   PyObject *__pyx_t_7 = NULL;
12795   Py_ssize_t __pyx_t_8;
12796   int __pyx_t_9;
12797   int __pyx_t_10;
12798   PyObject *__pyx_t_11 = NULL;
12799   int __pyx_lineno = 0;
12800   const char *__pyx_filename = NULL;
12801   int __pyx_clineno = 0;
12802   __Pyx_RefNannySetupContext("_unellipsify", 0);
12803 
12804   /* "View.MemoryView":671
12805  *     full slices.
12806  *     """
12807  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
12808  *         tup = (index,)
12809  *     else:
12810  */
12811   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12812   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12813   if (__pyx_t_2) {
12814 
12815     /* "View.MemoryView":672
12816  *     """
12817  *     if not isinstance(index, tuple):
12818  *         tup = (index,)             # <<<<<<<<<<<<<<
12819  *     else:
12820  *         tup = index
12821  */
12822     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
12823     __Pyx_GOTREF(__pyx_t_3);
12824     __Pyx_INCREF(__pyx_v_index);
12825     __Pyx_GIVEREF(__pyx_v_index);
12826     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
12827     __pyx_v_tup = __pyx_t_3;
12828     __pyx_t_3 = 0;
12829 
12830     /* "View.MemoryView":671
12831  *     full slices.
12832  *     """
12833  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
12834  *         tup = (index,)
12835  *     else:
12836  */
12837     goto __pyx_L3;
12838   }
12839 
12840   /* "View.MemoryView":674
12841  *         tup = (index,)
12842  *     else:
12843  *         tup = index             # <<<<<<<<<<<<<<
12844  *
12845  *     result = []
12846  */
12847   /*else*/ {
12848     __Pyx_INCREF(__pyx_v_index);
12849     __pyx_v_tup = __pyx_v_index;
12850   }
12851   __pyx_L3:;
12852 
12853   /* "View.MemoryView":676
12854  *         tup = index
12855  *
12856  *     result = []             # <<<<<<<<<<<<<<
12857  *     have_slices = False
12858  *     seen_ellipsis = False
12859  */
12860   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
12861   __Pyx_GOTREF(__pyx_t_3);
12862   __pyx_v_result = ((PyObject*)__pyx_t_3);
12863   __pyx_t_3 = 0;
12864 
12865   /* "View.MemoryView":677
12866  *
12867  *     result = []
12868  *     have_slices = False             # <<<<<<<<<<<<<<
12869  *     seen_ellipsis = False
12870  *     for idx, item in enumerate(tup):
12871  */
12872   __pyx_v_have_slices = 0;
12873 
12874   /* "View.MemoryView":678
12875  *     result = []
12876  *     have_slices = False
12877  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
12878  *     for idx, item in enumerate(tup):
12879  *         if item is Ellipsis:
12880  */
12881   __pyx_v_seen_ellipsis = 0;
12882 
12883   /* "View.MemoryView":679
12884  *     have_slices = False
12885  *     seen_ellipsis = False
12886  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
12887  *         if item is Ellipsis:
12888  *             if not seen_ellipsis:
12889  */
12890   __Pyx_INCREF(__pyx_int_0);
12891   __pyx_t_3 = __pyx_int_0;
12892   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
12893     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
12894     __pyx_t_6 = NULL;
12895   } else {
12896     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
12897     __Pyx_GOTREF(__pyx_t_4);
12898     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
12899   }
12900   for (;;) {
12901     if (likely(!__pyx_t_6)) {
12902       if (likely(PyList_CheckExact(__pyx_t_4))) {
12903         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
12904         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12905         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
12906         #else
12907         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
12908         __Pyx_GOTREF(__pyx_t_7);
12909         #endif
12910       } else {
12911         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
12912         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12913         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 679, __pyx_L1_error)
12914         #else
12915         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
12916         __Pyx_GOTREF(__pyx_t_7);
12917         #endif
12918       }
12919     } else {
12920       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
12921       if (unlikely(!__pyx_t_7)) {
12922         PyObject* exc_type = PyErr_Occurred();
12923         if (exc_type) {
12924           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12925           else __PYX_ERR(2, 679, __pyx_L1_error)
12926         }
12927         break;
12928       }
12929       __Pyx_GOTREF(__pyx_t_7);
12930     }
12931     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
12932     __pyx_t_7 = 0;
12933     __Pyx_INCREF(__pyx_t_3);
12934     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
12935     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
12936     __Pyx_GOTREF(__pyx_t_7);
12937     __Pyx_DECREF(__pyx_t_3);
12938     __pyx_t_3 = __pyx_t_7;
12939     __pyx_t_7 = 0;
12940 
12941     /* "View.MemoryView":680
12942  *     seen_ellipsis = False
12943  *     for idx, item in enumerate(tup):
12944  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
12945  *             if not seen_ellipsis:
12946  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12947  */
12948     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12949     __pyx_t_1 = (__pyx_t_2 != 0);
12950     if (__pyx_t_1) {
12951 
12952       /* "View.MemoryView":681
12953  *     for idx, item in enumerate(tup):
12954  *         if item is Ellipsis:
12955  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
12956  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12957  *                 seen_ellipsis = True
12958  */
12959       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
12960       if (__pyx_t_1) {
12961 
12962         /* "View.MemoryView":682
12963  *         if item is Ellipsis:
12964  *             if not seen_ellipsis:
12965  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
12966  *                 seen_ellipsis = True
12967  *             else:
12968  */
12969         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
12970         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 682, __pyx_L1_error)
12971         __Pyx_GOTREF(__pyx_t_7);
12972         { Py_ssize_t __pyx_temp;
12973           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
12974             __Pyx_INCREF(__pyx_slice__22);
12975             __Pyx_GIVEREF(__pyx_slice__22);
12976             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
12977           }
12978         }
12979         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
12980         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12981 
12982         /* "View.MemoryView":683
12983  *             if not seen_ellipsis:
12984  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12985  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
12986  *             else:
12987  *                 result.append(slice(None))
12988  */
12989         __pyx_v_seen_ellipsis = 1;
12990 
12991         /* "View.MemoryView":681
12992  *     for idx, item in enumerate(tup):
12993  *         if item is Ellipsis:
12994  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
12995  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12996  *                 seen_ellipsis = True
12997  */
12998         goto __pyx_L7;
12999       }
13000 
13001       /* "View.MemoryView":685
13002  *                 seen_ellipsis = True
13003  *             else:
13004  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
13005  *             have_slices = True
13006  *         else:
13007  */
13008       /*else*/ {
13009         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
13010       }
13011       __pyx_L7:;
13012 
13013       /* "View.MemoryView":686
13014  *             else:
13015  *                 result.append(slice(None))
13016  *             have_slices = True             # <<<<<<<<<<<<<<
13017  *         else:
13018  *             if not isinstance(item, slice) and not PyIndex_Check(item):
13019  */
13020       __pyx_v_have_slices = 1;
13021 
13022       /* "View.MemoryView":680
13023  *     seen_ellipsis = False
13024  *     for idx, item in enumerate(tup):
13025  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
13026  *             if not seen_ellipsis:
13027  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
13028  */
13029       goto __pyx_L6;
13030     }
13031 
13032     /* "View.MemoryView":688
13033  *             have_slices = True
13034  *         else:
13035  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
13036  *                 raise TypeError("Cannot index with type '%s'" % type(item))
13037  *
13038  */
13039     /*else*/ {
13040       __pyx_t_2 = PySlice_Check(__pyx_v_item);
13041       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13042       if (__pyx_t_10) {
13043       } else {
13044         __pyx_t_1 = __pyx_t_10;
13045         goto __pyx_L9_bool_binop_done;
13046       }
13047       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13048       __pyx_t_1 = __pyx_t_10;
13049       __pyx_L9_bool_binop_done:;
13050       if (unlikely(__pyx_t_1)) {
13051 
13052         /* "View.MemoryView":689
13053  *         else:
13054  *             if not isinstance(item, slice) and not PyIndex_Check(item):
13055  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
13056  *
13057  *             have_slices = have_slices or isinstance(item, slice)
13058  */
13059         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error)
13060         __Pyx_GOTREF(__pyx_t_7);
13061         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
13062         __Pyx_GOTREF(__pyx_t_11);
13063         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13064         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13065         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13066         __PYX_ERR(2, 689, __pyx_L1_error)
13067 
13068         /* "View.MemoryView":688
13069  *             have_slices = True
13070  *         else:
13071  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
13072  *                 raise TypeError("Cannot index with type '%s'" % type(item))
13073  *
13074  */
13075       }
13076 
13077       /* "View.MemoryView":691
13078  *                 raise TypeError("Cannot index with type '%s'" % type(item))
13079  *
13080  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
13081  *             result.append(item)
13082  *
13083  */
13084       __pyx_t_10 = (__pyx_v_have_slices != 0);
13085       if (!__pyx_t_10) {
13086       } else {
13087         __pyx_t_1 = __pyx_t_10;
13088         goto __pyx_L11_bool_binop_done;
13089       }
13090       __pyx_t_10 = PySlice_Check(__pyx_v_item);
13091       __pyx_t_2 = (__pyx_t_10 != 0);
13092       __pyx_t_1 = __pyx_t_2;
13093       __pyx_L11_bool_binop_done:;
13094       __pyx_v_have_slices = __pyx_t_1;
13095 
13096       /* "View.MemoryView":692
13097  *
13098  *             have_slices = have_slices or isinstance(item, slice)
13099  *             result.append(item)             # <<<<<<<<<<<<<<
13100  *
13101  *     nslices = ndim - len(result)
13102  */
13103       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
13104     }
13105     __pyx_L6:;
13106 
13107     /* "View.MemoryView":679
13108  *     have_slices = False
13109  *     seen_ellipsis = False
13110  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
13111  *         if item is Ellipsis:
13112  *             if not seen_ellipsis:
13113  */
13114   }
13115   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13116   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13117 
13118   /* "View.MemoryView":694
13119  *             result.append(item)
13120  *
13121  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
13122  *     if nslices:
13123  *         result.extend([slice(None)] * nslices)
13124  */
13125   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
13126   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13127 
13128   /* "View.MemoryView":695
13129  *
13130  *     nslices = ndim - len(result)
13131  *     if nslices:             # <<<<<<<<<<<<<<
13132  *         result.extend([slice(None)] * nslices)
13133  *
13134  */
13135   __pyx_t_1 = (__pyx_v_nslices != 0);
13136   if (__pyx_t_1) {
13137 
13138     /* "View.MemoryView":696
13139  *     nslices = ndim - len(result)
13140  *     if nslices:
13141  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
13142  *
13143  *     return have_slices or nslices, tuple(result)
13144  */
13145     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
13146     __Pyx_GOTREF(__pyx_t_3);
13147     { Py_ssize_t __pyx_temp;
13148       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13149         __Pyx_INCREF(__pyx_slice__22);
13150         __Pyx_GIVEREF(__pyx_slice__22);
13151         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
13152       }
13153     }
13154     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
13155     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13156 
13157     /* "View.MemoryView":695
13158  *
13159  *     nslices = ndim - len(result)
13160  *     if nslices:             # <<<<<<<<<<<<<<
13161  *         result.extend([slice(None)] * nslices)
13162  *
13163  */
13164   }
13165 
13166   /* "View.MemoryView":698
13167  *         result.extend([slice(None)] * nslices)
13168  *
13169  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
13170  *
13171  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13172  */
13173   __Pyx_XDECREF(__pyx_r);
13174   if (!__pyx_v_have_slices) {
13175   } else {
13176     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
13177     __Pyx_GOTREF(__pyx_t_4);
13178     __pyx_t_3 = __pyx_t_4;
13179     __pyx_t_4 = 0;
13180     goto __pyx_L14_bool_binop_done;
13181   }
13182   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
13183   __Pyx_GOTREF(__pyx_t_4);
13184   __pyx_t_3 = __pyx_t_4;
13185   __pyx_t_4 = 0;
13186   __pyx_L14_bool_binop_done:;
13187   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
13188   __Pyx_GOTREF(__pyx_t_4);
13189   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
13190   __Pyx_GOTREF(__pyx_t_11);
13191   __Pyx_GIVEREF(__pyx_t_3);
13192   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13193   __Pyx_GIVEREF(__pyx_t_4);
13194   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13195   __pyx_t_3 = 0;
13196   __pyx_t_4 = 0;
13197   __pyx_r = ((PyObject*)__pyx_t_11);
13198   __pyx_t_11 = 0;
13199   goto __pyx_L0;
13200 
13201   /* "View.MemoryView":666
13202  *     return isinstance(o, memoryview)
13203  *
13204  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
13205  *     """
13206  *     Replace all ellipses with full slices and fill incomplete indices with
13207  */
13208 
13209   /* function exit code */
13210   __pyx_L1_error:;
13211   __Pyx_XDECREF(__pyx_t_3);
13212   __Pyx_XDECREF(__pyx_t_4);
13213   __Pyx_XDECREF(__pyx_t_7);
13214   __Pyx_XDECREF(__pyx_t_11);
13215   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13216   __pyx_r = 0;
13217   __pyx_L0:;
13218   __Pyx_XDECREF(__pyx_v_tup);
13219   __Pyx_XDECREF(__pyx_v_result);
13220   __Pyx_XDECREF(__pyx_v_idx);
13221   __Pyx_XDECREF(__pyx_v_item);
13222   __Pyx_XGIVEREF(__pyx_r);
13223   __Pyx_RefNannyFinishContext();
13224   return __pyx_r;
13225 }
13226 
13227 /* "View.MemoryView":700
13228  *     return have_slices or nslices, tuple(result)
13229  *
13230  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
13231  *     for suboffset in suboffsets[:ndim]:
13232  *         if suboffset >= 0:
13233  */
13234 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)13235 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13236   Py_ssize_t __pyx_v_suboffset;
13237   PyObject *__pyx_r = NULL;
13238   __Pyx_RefNannyDeclarations
13239   Py_ssize_t *__pyx_t_1;
13240   Py_ssize_t *__pyx_t_2;
13241   Py_ssize_t *__pyx_t_3;
13242   int __pyx_t_4;
13243   PyObject *__pyx_t_5 = NULL;
13244   int __pyx_lineno = 0;
13245   const char *__pyx_filename = NULL;
13246   int __pyx_clineno = 0;
13247   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
13248 
13249   /* "View.MemoryView":701
13250  *
13251  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13252  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
13253  *         if suboffset >= 0:
13254  *             raise ValueError("Indirect dimensions not supported")
13255  */
13256   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13257   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13258     __pyx_t_1 = __pyx_t_3;
13259     __pyx_v_suboffset = (__pyx_t_1[0]);
13260 
13261     /* "View.MemoryView":702
13262  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13263  *     for suboffset in suboffsets[:ndim]:
13264  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
13265  *             raise ValueError("Indirect dimensions not supported")
13266  *
13267  */
13268     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
13269     if (unlikely(__pyx_t_4)) {
13270 
13271       /* "View.MemoryView":703
13272  *     for suboffset in suboffsets[:ndim]:
13273  *         if suboffset >= 0:
13274  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
13275  *
13276  *
13277  */
13278       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
13279       __Pyx_GOTREF(__pyx_t_5);
13280       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
13281       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13282       __PYX_ERR(2, 703, __pyx_L1_error)
13283 
13284       /* "View.MemoryView":702
13285  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13286  *     for suboffset in suboffsets[:ndim]:
13287  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
13288  *             raise ValueError("Indirect dimensions not supported")
13289  *
13290  */
13291     }
13292   }
13293 
13294   /* "View.MemoryView":700
13295  *     return have_slices or nslices, tuple(result)
13296  *
13297  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
13298  *     for suboffset in suboffsets[:ndim]:
13299  *         if suboffset >= 0:
13300  */
13301 
13302   /* function exit code */
13303   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13304   goto __pyx_L0;
13305   __pyx_L1_error:;
13306   __Pyx_XDECREF(__pyx_t_5);
13307   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13308   __pyx_r = 0;
13309   __pyx_L0:;
13310   __Pyx_XGIVEREF(__pyx_r);
13311   __Pyx_RefNannyFinishContext();
13312   return __pyx_r;
13313 }
13314 
13315 /* "View.MemoryView":710
13316  *
13317  * @cname('__pyx_memview_slice')
13318  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
13319  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
13320  *     cdef bint negative_step
13321  */
13322 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)13323 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13324   int __pyx_v_new_ndim;
13325   int __pyx_v_suboffset_dim;
13326   int __pyx_v_dim;
13327   __Pyx_memviewslice __pyx_v_src;
13328   __Pyx_memviewslice __pyx_v_dst;
13329   __Pyx_memviewslice *__pyx_v_p_src;
13330   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13331   __Pyx_memviewslice *__pyx_v_p_dst;
13332   int *__pyx_v_p_suboffset_dim;
13333   Py_ssize_t __pyx_v_start;
13334   Py_ssize_t __pyx_v_stop;
13335   Py_ssize_t __pyx_v_step;
13336   int __pyx_v_have_start;
13337   int __pyx_v_have_stop;
13338   int __pyx_v_have_step;
13339   PyObject *__pyx_v_index = NULL;
13340   struct __pyx_memoryview_obj *__pyx_r = NULL;
13341   __Pyx_RefNannyDeclarations
13342   int __pyx_t_1;
13343   int __pyx_t_2;
13344   PyObject *__pyx_t_3 = NULL;
13345   struct __pyx_memoryview_obj *__pyx_t_4;
13346   char *__pyx_t_5;
13347   int __pyx_t_6;
13348   Py_ssize_t __pyx_t_7;
13349   PyObject *(*__pyx_t_8)(PyObject *);
13350   PyObject *__pyx_t_9 = NULL;
13351   Py_ssize_t __pyx_t_10;
13352   int __pyx_t_11;
13353   Py_ssize_t __pyx_t_12;
13354   int __pyx_lineno = 0;
13355   const char *__pyx_filename = NULL;
13356   int __pyx_clineno = 0;
13357   __Pyx_RefNannySetupContext("memview_slice", 0);
13358 
13359   /* "View.MemoryView":711
13360  * @cname('__pyx_memview_slice')
13361  * cdef memoryview memview_slice(memoryview memview, object indices):
13362  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
13363  *     cdef bint negative_step
13364  *     cdef __Pyx_memviewslice src, dst
13365  */
13366   __pyx_v_new_ndim = 0;
13367   __pyx_v_suboffset_dim = -1;
13368 
13369   /* "View.MemoryView":718
13370  *
13371  *
13372  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
13373  *
13374  *     cdef _memoryviewslice memviewsliceobj
13375  */
13376   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13377 
13378   /* "View.MemoryView":722
13379  *     cdef _memoryviewslice memviewsliceobj
13380  *
13381  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
13382  *
13383  *     if isinstance(memview, _memoryviewslice):
13384  */
13385   #ifndef CYTHON_WITHOUT_ASSERTIONS
13386   if (unlikely(!Py_OptimizeFlag)) {
13387     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
13388       PyErr_SetNone(PyExc_AssertionError);
13389       __PYX_ERR(2, 722, __pyx_L1_error)
13390     }
13391   }
13392   #endif
13393 
13394   /* "View.MemoryView":724
13395  *     assert memview.view.ndim > 0
13396  *
13397  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13398  *         memviewsliceobj = memview
13399  *         p_src = &memviewsliceobj.from_slice
13400  */
13401   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13402   __pyx_t_2 = (__pyx_t_1 != 0);
13403   if (__pyx_t_2) {
13404 
13405     /* "View.MemoryView":725
13406  *
13407  *     if isinstance(memview, _memoryviewslice):
13408  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
13409  *         p_src = &memviewsliceobj.from_slice
13410  *     else:
13411  */
13412     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
13413     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13414     __Pyx_INCREF(__pyx_t_3);
13415     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13416     __pyx_t_3 = 0;
13417 
13418     /* "View.MemoryView":726
13419  *     if isinstance(memview, _memoryviewslice):
13420  *         memviewsliceobj = memview
13421  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
13422  *     else:
13423  *         slice_copy(memview, &src)
13424  */
13425     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13426 
13427     /* "View.MemoryView":724
13428  *     assert memview.view.ndim > 0
13429  *
13430  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13431  *         memviewsliceobj = memview
13432  *         p_src = &memviewsliceobj.from_slice
13433  */
13434     goto __pyx_L3;
13435   }
13436 
13437   /* "View.MemoryView":728
13438  *         p_src = &memviewsliceobj.from_slice
13439  *     else:
13440  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
13441  *         p_src = &src
13442  *
13443  */
13444   /*else*/ {
13445     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13446 
13447     /* "View.MemoryView":729
13448  *     else:
13449  *         slice_copy(memview, &src)
13450  *         p_src = &src             # <<<<<<<<<<<<<<
13451  *
13452  *
13453  */
13454     __pyx_v_p_src = (&__pyx_v_src);
13455   }
13456   __pyx_L3:;
13457 
13458   /* "View.MemoryView":735
13459  *
13460  *
13461  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
13462  *     dst.data = p_src.data
13463  *
13464  */
13465   __pyx_t_4 = __pyx_v_p_src->memview;
13466   __pyx_v_dst.memview = __pyx_t_4;
13467 
13468   /* "View.MemoryView":736
13469  *
13470  *     dst.memview = p_src.memview
13471  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
13472  *
13473  *
13474  */
13475   __pyx_t_5 = __pyx_v_p_src->data;
13476   __pyx_v_dst.data = __pyx_t_5;
13477 
13478   /* "View.MemoryView":741
13479  *
13480  *
13481  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
13482  *     cdef int *p_suboffset_dim = &suboffset_dim
13483  *     cdef Py_ssize_t start, stop, step
13484  */
13485   __pyx_v_p_dst = (&__pyx_v_dst);
13486 
13487   /* "View.MemoryView":742
13488  *
13489  *     cdef __Pyx_memviewslice *p_dst = &dst
13490  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
13491  *     cdef Py_ssize_t start, stop, step
13492  *     cdef bint have_start, have_stop, have_step
13493  */
13494   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13495 
13496   /* "View.MemoryView":746
13497  *     cdef bint have_start, have_stop, have_step
13498  *
13499  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
13500  *         if PyIndex_Check(index):
13501  *             slice_memviewslice(
13502  */
13503   __pyx_t_6 = 0;
13504   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13505     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
13506     __pyx_t_8 = NULL;
13507   } else {
13508     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
13509     __Pyx_GOTREF(__pyx_t_3);
13510     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
13511   }
13512   for (;;) {
13513     if (likely(!__pyx_t_8)) {
13514       if (likely(PyList_CheckExact(__pyx_t_3))) {
13515         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
13516         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13517         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
13518         #else
13519         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
13520         __Pyx_GOTREF(__pyx_t_9);
13521         #endif
13522       } else {
13523         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13524         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13525         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 746, __pyx_L1_error)
13526         #else
13527         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
13528         __Pyx_GOTREF(__pyx_t_9);
13529         #endif
13530       }
13531     } else {
13532       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
13533       if (unlikely(!__pyx_t_9)) {
13534         PyObject* exc_type = PyErr_Occurred();
13535         if (exc_type) {
13536           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13537           else __PYX_ERR(2, 746, __pyx_L1_error)
13538         }
13539         break;
13540       }
13541       __Pyx_GOTREF(__pyx_t_9);
13542     }
13543     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
13544     __pyx_t_9 = 0;
13545     __pyx_v_dim = __pyx_t_6;
13546     __pyx_t_6 = (__pyx_t_6 + 1);
13547 
13548     /* "View.MemoryView":747
13549  *
13550  *     for dim, index in enumerate(indices):
13551  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
13552  *             slice_memviewslice(
13553  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13554  */
13555     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
13556     if (__pyx_t_2) {
13557 
13558       /* "View.MemoryView":751
13559  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13560  *                 dim, new_ndim, p_suboffset_dim,
13561  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
13562  *                 0, 0, 0, # have_{start,stop,step}
13563  *                 False)
13564  */
13565       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
13566 
13567       /* "View.MemoryView":748
13568  *     for dim, index in enumerate(indices):
13569  *         if PyIndex_Check(index):
13570  *             slice_memviewslice(             # <<<<<<<<<<<<<<
13571  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13572  *                 dim, new_ndim, p_suboffset_dim,
13573  */
13574       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error)
13575 
13576       /* "View.MemoryView":747
13577  *
13578  *     for dim, index in enumerate(indices):
13579  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
13580  *             slice_memviewslice(
13581  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13582  */
13583       goto __pyx_L6;
13584     }
13585 
13586     /* "View.MemoryView":754
13587  *                 0, 0, 0, # have_{start,stop,step}
13588  *                 False)
13589  *         elif index is None:             # <<<<<<<<<<<<<<
13590  *             p_dst.shape[new_ndim] = 1
13591  *             p_dst.strides[new_ndim] = 0
13592  */
13593     __pyx_t_2 = (__pyx_v_index == Py_None);
13594     __pyx_t_1 = (__pyx_t_2 != 0);
13595     if (__pyx_t_1) {
13596 
13597       /* "View.MemoryView":755
13598  *                 False)
13599  *         elif index is None:
13600  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
13601  *             p_dst.strides[new_ndim] = 0
13602  *             p_dst.suboffsets[new_ndim] = -1
13603  */
13604       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13605 
13606       /* "View.MemoryView":756
13607  *         elif index is None:
13608  *             p_dst.shape[new_ndim] = 1
13609  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
13610  *             p_dst.suboffsets[new_ndim] = -1
13611  *             new_ndim += 1
13612  */
13613       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13614 
13615       /* "View.MemoryView":757
13616  *             p_dst.shape[new_ndim] = 1
13617  *             p_dst.strides[new_ndim] = 0
13618  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
13619  *             new_ndim += 1
13620  *         else:
13621  */
13622       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13623 
13624       /* "View.MemoryView":758
13625  *             p_dst.strides[new_ndim] = 0
13626  *             p_dst.suboffsets[new_ndim] = -1
13627  *             new_ndim += 1             # <<<<<<<<<<<<<<
13628  *         else:
13629  *             start = index.start or 0
13630  */
13631       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13632 
13633       /* "View.MemoryView":754
13634  *                 0, 0, 0, # have_{start,stop,step}
13635  *                 False)
13636  *         elif index is None:             # <<<<<<<<<<<<<<
13637  *             p_dst.shape[new_ndim] = 1
13638  *             p_dst.strides[new_ndim] = 0
13639  */
13640       goto __pyx_L6;
13641     }
13642 
13643     /* "View.MemoryView":760
13644  *             new_ndim += 1
13645  *         else:
13646  *             start = index.start or 0             # <<<<<<<<<<<<<<
13647  *             stop = index.stop or 0
13648  *             step = index.step or 0
13649  */
13650     /*else*/ {
13651       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
13652       __Pyx_GOTREF(__pyx_t_9);
13653       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
13654       if (!__pyx_t_1) {
13655         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13656       } else {
13657         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
13658         __pyx_t_10 = __pyx_t_12;
13659         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13660         goto __pyx_L7_bool_binop_done;
13661       }
13662       __pyx_t_10 = 0;
13663       __pyx_L7_bool_binop_done:;
13664       __pyx_v_start = __pyx_t_10;
13665 
13666       /* "View.MemoryView":761
13667  *         else:
13668  *             start = index.start or 0
13669  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
13670  *             step = index.step or 0
13671  *
13672  */
13673       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
13674       __Pyx_GOTREF(__pyx_t_9);
13675       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
13676       if (!__pyx_t_1) {
13677         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13678       } else {
13679         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
13680         __pyx_t_10 = __pyx_t_12;
13681         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13682         goto __pyx_L9_bool_binop_done;
13683       }
13684       __pyx_t_10 = 0;
13685       __pyx_L9_bool_binop_done:;
13686       __pyx_v_stop = __pyx_t_10;
13687 
13688       /* "View.MemoryView":762
13689  *             start = index.start or 0
13690  *             stop = index.stop or 0
13691  *             step = index.step or 0             # <<<<<<<<<<<<<<
13692  *
13693  *             have_start = index.start is not None
13694  */
13695       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
13696       __Pyx_GOTREF(__pyx_t_9);
13697       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
13698       if (!__pyx_t_1) {
13699         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13700       } else {
13701         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
13702         __pyx_t_10 = __pyx_t_12;
13703         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13704         goto __pyx_L11_bool_binop_done;
13705       }
13706       __pyx_t_10 = 0;
13707       __pyx_L11_bool_binop_done:;
13708       __pyx_v_step = __pyx_t_10;
13709 
13710       /* "View.MemoryView":764
13711  *             step = index.step or 0
13712  *
13713  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
13714  *             have_stop = index.stop is not None
13715  *             have_step = index.step is not None
13716  */
13717       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
13718       __Pyx_GOTREF(__pyx_t_9);
13719       __pyx_t_1 = (__pyx_t_9 != Py_None);
13720       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13721       __pyx_v_have_start = __pyx_t_1;
13722 
13723       /* "View.MemoryView":765
13724  *
13725  *             have_start = index.start is not None
13726  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
13727  *             have_step = index.step is not None
13728  *
13729  */
13730       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
13731       __Pyx_GOTREF(__pyx_t_9);
13732       __pyx_t_1 = (__pyx_t_9 != Py_None);
13733       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13734       __pyx_v_have_stop = __pyx_t_1;
13735 
13736       /* "View.MemoryView":766
13737  *             have_start = index.start is not None
13738  *             have_stop = index.stop is not None
13739  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
13740  *
13741  *             slice_memviewslice(
13742  */
13743       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
13744       __Pyx_GOTREF(__pyx_t_9);
13745       __pyx_t_1 = (__pyx_t_9 != Py_None);
13746       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13747       __pyx_v_have_step = __pyx_t_1;
13748 
13749       /* "View.MemoryView":768
13750  *             have_step = index.step is not None
13751  *
13752  *             slice_memviewslice(             # <<<<<<<<<<<<<<
13753  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13754  *                 dim, new_ndim, p_suboffset_dim,
13755  */
13756       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 768, __pyx_L1_error)
13757 
13758       /* "View.MemoryView":774
13759  *                 have_start, have_stop, have_step,
13760  *                 True)
13761  *             new_ndim += 1             # <<<<<<<<<<<<<<
13762  *
13763  *     if isinstance(memview, _memoryviewslice):
13764  */
13765       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13766     }
13767     __pyx_L6:;
13768 
13769     /* "View.MemoryView":746
13770  *     cdef bint have_start, have_stop, have_step
13771  *
13772  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
13773  *         if PyIndex_Check(index):
13774  *             slice_memviewslice(
13775  */
13776   }
13777   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13778 
13779   /* "View.MemoryView":776
13780  *             new_ndim += 1
13781  *
13782  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13783  *         return memoryview_fromslice(dst, new_ndim,
13784  *                                     memviewsliceobj.to_object_func,
13785  */
13786   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13787   __pyx_t_2 = (__pyx_t_1 != 0);
13788   if (__pyx_t_2) {
13789 
13790     /* "View.MemoryView":777
13791  *
13792  *     if isinstance(memview, _memoryviewslice):
13793  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
13794  *                                     memviewsliceobj.to_object_func,
13795  *                                     memviewsliceobj.to_dtype_func,
13796  */
13797     __Pyx_XDECREF(((PyObject *)__pyx_r));
13798 
13799     /* "View.MemoryView":778
13800  *     if isinstance(memview, _memoryviewslice):
13801  *         return memoryview_fromslice(dst, new_ndim,
13802  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
13803  *                                     memviewsliceobj.to_dtype_func,
13804  *                                     memview.dtype_is_object)
13805  */
13806     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
13807 
13808     /* "View.MemoryView":779
13809  *         return memoryview_fromslice(dst, new_ndim,
13810  *                                     memviewsliceobj.to_object_func,
13811  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
13812  *                                     memview.dtype_is_object)
13813  *     else:
13814  */
13815     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
13816 
13817     /* "View.MemoryView":777
13818  *
13819  *     if isinstance(memview, _memoryviewslice):
13820  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
13821  *                                     memviewsliceobj.to_object_func,
13822  *                                     memviewsliceobj.to_dtype_func,
13823  */
13824     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 777, __pyx_L1_error)
13825     __Pyx_GOTREF(__pyx_t_3);
13826     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
13827     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
13828     __pyx_t_3 = 0;
13829     goto __pyx_L0;
13830 
13831     /* "View.MemoryView":776
13832  *             new_ndim += 1
13833  *
13834  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13835  *         return memoryview_fromslice(dst, new_ndim,
13836  *                                     memviewsliceobj.to_object_func,
13837  */
13838   }
13839 
13840   /* "View.MemoryView":782
13841  *                                     memview.dtype_is_object)
13842  *     else:
13843  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
13844  *                                     memview.dtype_is_object)
13845  *
13846  */
13847   /*else*/ {
13848     __Pyx_XDECREF(((PyObject *)__pyx_r));
13849 
13850     /* "View.MemoryView":783
13851  *     else:
13852  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13853  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
13854  *
13855  *
13856  */
13857     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 782, __pyx_L1_error)
13858     __Pyx_GOTREF(__pyx_t_3);
13859 
13860     /* "View.MemoryView":782
13861  *                                     memview.dtype_is_object)
13862  *     else:
13863  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
13864  *                                     memview.dtype_is_object)
13865  *
13866  */
13867     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
13868     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
13869     __pyx_t_3 = 0;
13870     goto __pyx_L0;
13871   }
13872 
13873   /* "View.MemoryView":710
13874  *
13875  * @cname('__pyx_memview_slice')
13876  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
13877  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
13878  *     cdef bint negative_step
13879  */
13880 
13881   /* function exit code */
13882   __pyx_L1_error:;
13883   __Pyx_XDECREF(__pyx_t_3);
13884   __Pyx_XDECREF(__pyx_t_9);
13885   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13886   __pyx_r = 0;
13887   __pyx_L0:;
13888   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13889   __Pyx_XDECREF(__pyx_v_index);
13890   __Pyx_XGIVEREF((PyObject *)__pyx_r);
13891   __Pyx_RefNannyFinishContext();
13892   return __pyx_r;
13893 }
13894 
13895 /* "View.MemoryView":807
13896  *
13897  * @cname('__pyx_memoryview_slice_memviewslice')
13898  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
13899  *         __Pyx_memviewslice *dst,
13900  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13901  */
13902 
__pyx_memoryview_slice_memviewslice(__Pyx_memviewslice * __pyx_v_dst,Py_ssize_t __pyx_v_shape,Py_ssize_t __pyx_v_stride,Py_ssize_t __pyx_v_suboffset,int __pyx_v_dim,int __pyx_v_new_ndim,int * __pyx_v_suboffset_dim,Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop,Py_ssize_t __pyx_v_step,int __pyx_v_have_start,int __pyx_v_have_stop,int __pyx_v_have_step,int __pyx_v_is_slice)13903 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13904   Py_ssize_t __pyx_v_new_shape;
13905   int __pyx_v_negative_step;
13906   int __pyx_r;
13907   int __pyx_t_1;
13908   int __pyx_t_2;
13909   int __pyx_t_3;
13910   int __pyx_lineno = 0;
13911   const char *__pyx_filename = NULL;
13912   int __pyx_clineno = 0;
13913 
13914   /* "View.MemoryView":827
13915  *     cdef bint negative_step
13916  *
13917  *     if not is_slice:             # <<<<<<<<<<<<<<
13918  *
13919  *         if start < 0:
13920  */
13921   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
13922   if (__pyx_t_1) {
13923 
13924     /* "View.MemoryView":829
13925  *     if not is_slice:
13926  *
13927  *         if start < 0:             # <<<<<<<<<<<<<<
13928  *             start += shape
13929  *         if not 0 <= start < shape:
13930  */
13931     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
13932     if (__pyx_t_1) {
13933 
13934       /* "View.MemoryView":830
13935  *
13936  *         if start < 0:
13937  *             start += shape             # <<<<<<<<<<<<<<
13938  *         if not 0 <= start < shape:
13939  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13940  */
13941       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13942 
13943       /* "View.MemoryView":829
13944  *     if not is_slice:
13945  *
13946  *         if start < 0:             # <<<<<<<<<<<<<<
13947  *             start += shape
13948  *         if not 0 <= start < shape:
13949  */
13950     }
13951 
13952     /* "View.MemoryView":831
13953  *         if start < 0:
13954  *             start += shape
13955  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
13956  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13957  *     else:
13958  */
13959     __pyx_t_1 = (0 <= __pyx_v_start);
13960     if (__pyx_t_1) {
13961       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13962     }
13963     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13964     if (__pyx_t_2) {
13965 
13966       /* "View.MemoryView":832
13967  *             start += shape
13968  *         if not 0 <= start < shape:
13969  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
13970  *     else:
13971  *
13972  */
13973       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error)
13974 
13975       /* "View.MemoryView":831
13976  *         if start < 0:
13977  *             start += shape
13978  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
13979  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13980  *     else:
13981  */
13982     }
13983 
13984     /* "View.MemoryView":827
13985  *     cdef bint negative_step
13986  *
13987  *     if not is_slice:             # <<<<<<<<<<<<<<
13988  *
13989  *         if start < 0:
13990  */
13991     goto __pyx_L3;
13992   }
13993 
13994   /* "View.MemoryView":835
13995  *     else:
13996  *
13997  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
13998  *
13999  *         if have_step and step == 0:
14000  */
14001   /*else*/ {
14002     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14003     if (__pyx_t_1) {
14004     } else {
14005       __pyx_t_2 = __pyx_t_1;
14006       goto __pyx_L6_bool_binop_done;
14007     }
14008     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14009     __pyx_t_2 = __pyx_t_1;
14010     __pyx_L6_bool_binop_done:;
14011     __pyx_v_negative_step = __pyx_t_2;
14012 
14013     /* "View.MemoryView":837
14014  *         negative_step = have_step != 0 and step < 0
14015  *
14016  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
14017  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14018  *
14019  */
14020     __pyx_t_1 = (__pyx_v_have_step != 0);
14021     if (__pyx_t_1) {
14022     } else {
14023       __pyx_t_2 = __pyx_t_1;
14024       goto __pyx_L9_bool_binop_done;
14025     }
14026     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14027     __pyx_t_2 = __pyx_t_1;
14028     __pyx_L9_bool_binop_done:;
14029     if (__pyx_t_2) {
14030 
14031       /* "View.MemoryView":838
14032  *
14033  *         if have_step and step == 0:
14034  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
14035  *
14036  *
14037  */
14038       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error)
14039 
14040       /* "View.MemoryView":837
14041  *         negative_step = have_step != 0 and step < 0
14042  *
14043  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
14044  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14045  *
14046  */
14047     }
14048 
14049     /* "View.MemoryView":841
14050  *
14051  *
14052  *         if have_start:             # <<<<<<<<<<<<<<
14053  *             if start < 0:
14054  *                 start += shape
14055  */
14056     __pyx_t_2 = (__pyx_v_have_start != 0);
14057     if (__pyx_t_2) {
14058 
14059       /* "View.MemoryView":842
14060  *
14061  *         if have_start:
14062  *             if start < 0:             # <<<<<<<<<<<<<<
14063  *                 start += shape
14064  *                 if start < 0:
14065  */
14066       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14067       if (__pyx_t_2) {
14068 
14069         /* "View.MemoryView":843
14070  *         if have_start:
14071  *             if start < 0:
14072  *                 start += shape             # <<<<<<<<<<<<<<
14073  *                 if start < 0:
14074  *                     start = 0
14075  */
14076         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14077 
14078         /* "View.MemoryView":844
14079  *             if start < 0:
14080  *                 start += shape
14081  *                 if start < 0:             # <<<<<<<<<<<<<<
14082  *                     start = 0
14083  *             elif start >= shape:
14084  */
14085         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14086         if (__pyx_t_2) {
14087 
14088           /* "View.MemoryView":845
14089  *                 start += shape
14090  *                 if start < 0:
14091  *                     start = 0             # <<<<<<<<<<<<<<
14092  *             elif start >= shape:
14093  *                 if negative_step:
14094  */
14095           __pyx_v_start = 0;
14096 
14097           /* "View.MemoryView":844
14098  *             if start < 0:
14099  *                 start += shape
14100  *                 if start < 0:             # <<<<<<<<<<<<<<
14101  *                     start = 0
14102  *             elif start >= shape:
14103  */
14104         }
14105 
14106         /* "View.MemoryView":842
14107  *
14108  *         if have_start:
14109  *             if start < 0:             # <<<<<<<<<<<<<<
14110  *                 start += shape
14111  *                 if start < 0:
14112  */
14113         goto __pyx_L12;
14114       }
14115 
14116       /* "View.MemoryView":846
14117  *                 if start < 0:
14118  *                     start = 0
14119  *             elif start >= shape:             # <<<<<<<<<<<<<<
14120  *                 if negative_step:
14121  *                     start = shape - 1
14122  */
14123       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14124       if (__pyx_t_2) {
14125 
14126         /* "View.MemoryView":847
14127  *                     start = 0
14128  *             elif start >= shape:
14129  *                 if negative_step:             # <<<<<<<<<<<<<<
14130  *                     start = shape - 1
14131  *                 else:
14132  */
14133         __pyx_t_2 = (__pyx_v_negative_step != 0);
14134         if (__pyx_t_2) {
14135 
14136           /* "View.MemoryView":848
14137  *             elif start >= shape:
14138  *                 if negative_step:
14139  *                     start = shape - 1             # <<<<<<<<<<<<<<
14140  *                 else:
14141  *                     start = shape
14142  */
14143           __pyx_v_start = (__pyx_v_shape - 1);
14144 
14145           /* "View.MemoryView":847
14146  *                     start = 0
14147  *             elif start >= shape:
14148  *                 if negative_step:             # <<<<<<<<<<<<<<
14149  *                     start = shape - 1
14150  *                 else:
14151  */
14152           goto __pyx_L14;
14153         }
14154 
14155         /* "View.MemoryView":850
14156  *                     start = shape - 1
14157  *                 else:
14158  *                     start = shape             # <<<<<<<<<<<<<<
14159  *         else:
14160  *             if negative_step:
14161  */
14162         /*else*/ {
14163           __pyx_v_start = __pyx_v_shape;
14164         }
14165         __pyx_L14:;
14166 
14167         /* "View.MemoryView":846
14168  *                 if start < 0:
14169  *                     start = 0
14170  *             elif start >= shape:             # <<<<<<<<<<<<<<
14171  *                 if negative_step:
14172  *                     start = shape - 1
14173  */
14174       }
14175       __pyx_L12:;
14176 
14177       /* "View.MemoryView":841
14178  *
14179  *
14180  *         if have_start:             # <<<<<<<<<<<<<<
14181  *             if start < 0:
14182  *                 start += shape
14183  */
14184       goto __pyx_L11;
14185     }
14186 
14187     /* "View.MemoryView":852
14188  *                     start = shape
14189  *         else:
14190  *             if negative_step:             # <<<<<<<<<<<<<<
14191  *                 start = shape - 1
14192  *             else:
14193  */
14194     /*else*/ {
14195       __pyx_t_2 = (__pyx_v_negative_step != 0);
14196       if (__pyx_t_2) {
14197 
14198         /* "View.MemoryView":853
14199  *         else:
14200  *             if negative_step:
14201  *                 start = shape - 1             # <<<<<<<<<<<<<<
14202  *             else:
14203  *                 start = 0
14204  */
14205         __pyx_v_start = (__pyx_v_shape - 1);
14206 
14207         /* "View.MemoryView":852
14208  *                     start = shape
14209  *         else:
14210  *             if negative_step:             # <<<<<<<<<<<<<<
14211  *                 start = shape - 1
14212  *             else:
14213  */
14214         goto __pyx_L15;
14215       }
14216 
14217       /* "View.MemoryView":855
14218  *                 start = shape - 1
14219  *             else:
14220  *                 start = 0             # <<<<<<<<<<<<<<
14221  *
14222  *         if have_stop:
14223  */
14224       /*else*/ {
14225         __pyx_v_start = 0;
14226       }
14227       __pyx_L15:;
14228     }
14229     __pyx_L11:;
14230 
14231     /* "View.MemoryView":857
14232  *                 start = 0
14233  *
14234  *         if have_stop:             # <<<<<<<<<<<<<<
14235  *             if stop < 0:
14236  *                 stop += shape
14237  */
14238     __pyx_t_2 = (__pyx_v_have_stop != 0);
14239     if (__pyx_t_2) {
14240 
14241       /* "View.MemoryView":858
14242  *
14243  *         if have_stop:
14244  *             if stop < 0:             # <<<<<<<<<<<<<<
14245  *                 stop += shape
14246  *                 if stop < 0:
14247  */
14248       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14249       if (__pyx_t_2) {
14250 
14251         /* "View.MemoryView":859
14252  *         if have_stop:
14253  *             if stop < 0:
14254  *                 stop += shape             # <<<<<<<<<<<<<<
14255  *                 if stop < 0:
14256  *                     stop = 0
14257  */
14258         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14259 
14260         /* "View.MemoryView":860
14261  *             if stop < 0:
14262  *                 stop += shape
14263  *                 if stop < 0:             # <<<<<<<<<<<<<<
14264  *                     stop = 0
14265  *             elif stop > shape:
14266  */
14267         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14268         if (__pyx_t_2) {
14269 
14270           /* "View.MemoryView":861
14271  *                 stop += shape
14272  *                 if stop < 0:
14273  *                     stop = 0             # <<<<<<<<<<<<<<
14274  *             elif stop > shape:
14275  *                 stop = shape
14276  */
14277           __pyx_v_stop = 0;
14278 
14279           /* "View.MemoryView":860
14280  *             if stop < 0:
14281  *                 stop += shape
14282  *                 if stop < 0:             # <<<<<<<<<<<<<<
14283  *                     stop = 0
14284  *             elif stop > shape:
14285  */
14286         }
14287 
14288         /* "View.MemoryView":858
14289  *
14290  *         if have_stop:
14291  *             if stop < 0:             # <<<<<<<<<<<<<<
14292  *                 stop += shape
14293  *                 if stop < 0:
14294  */
14295         goto __pyx_L17;
14296       }
14297 
14298       /* "View.MemoryView":862
14299  *                 if stop < 0:
14300  *                     stop = 0
14301  *             elif stop > shape:             # <<<<<<<<<<<<<<
14302  *                 stop = shape
14303  *         else:
14304  */
14305       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
14306       if (__pyx_t_2) {
14307 
14308         /* "View.MemoryView":863
14309  *                     stop = 0
14310  *             elif stop > shape:
14311  *                 stop = shape             # <<<<<<<<<<<<<<
14312  *         else:
14313  *             if negative_step:
14314  */
14315         __pyx_v_stop = __pyx_v_shape;
14316 
14317         /* "View.MemoryView":862
14318  *                 if stop < 0:
14319  *                     stop = 0
14320  *             elif stop > shape:             # <<<<<<<<<<<<<<
14321  *                 stop = shape
14322  *         else:
14323  */
14324       }
14325       __pyx_L17:;
14326 
14327       /* "View.MemoryView":857
14328  *                 start = 0
14329  *
14330  *         if have_stop:             # <<<<<<<<<<<<<<
14331  *             if stop < 0:
14332  *                 stop += shape
14333  */
14334       goto __pyx_L16;
14335     }
14336 
14337     /* "View.MemoryView":865
14338  *                 stop = shape
14339  *         else:
14340  *             if negative_step:             # <<<<<<<<<<<<<<
14341  *                 stop = -1
14342  *             else:
14343  */
14344     /*else*/ {
14345       __pyx_t_2 = (__pyx_v_negative_step != 0);
14346       if (__pyx_t_2) {
14347 
14348         /* "View.MemoryView":866
14349  *         else:
14350  *             if negative_step:
14351  *                 stop = -1             # <<<<<<<<<<<<<<
14352  *             else:
14353  *                 stop = shape
14354  */
14355         __pyx_v_stop = -1L;
14356 
14357         /* "View.MemoryView":865
14358  *                 stop = shape
14359  *         else:
14360  *             if negative_step:             # <<<<<<<<<<<<<<
14361  *                 stop = -1
14362  *             else:
14363  */
14364         goto __pyx_L19;
14365       }
14366 
14367       /* "View.MemoryView":868
14368  *                 stop = -1
14369  *             else:
14370  *                 stop = shape             # <<<<<<<<<<<<<<
14371  *
14372  *         if not have_step:
14373  */
14374       /*else*/ {
14375         __pyx_v_stop = __pyx_v_shape;
14376       }
14377       __pyx_L19:;
14378     }
14379     __pyx_L16:;
14380 
14381     /* "View.MemoryView":870
14382  *                 stop = shape
14383  *
14384  *         if not have_step:             # <<<<<<<<<<<<<<
14385  *             step = 1
14386  *
14387  */
14388     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
14389     if (__pyx_t_2) {
14390 
14391       /* "View.MemoryView":871
14392  *
14393  *         if not have_step:
14394  *             step = 1             # <<<<<<<<<<<<<<
14395  *
14396  *
14397  */
14398       __pyx_v_step = 1;
14399 
14400       /* "View.MemoryView":870
14401  *                 stop = shape
14402  *
14403  *         if not have_step:             # <<<<<<<<<<<<<<
14404  *             step = 1
14405  *
14406  */
14407     }
14408 
14409     /* "View.MemoryView":875
14410  *
14411  *         with cython.cdivision(True):
14412  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
14413  *
14414  *             if (stop - start) - step * new_shape:
14415  */
14416     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14417 
14418     /* "View.MemoryView":877
14419  *             new_shape = (stop - start) // step
14420  *
14421  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
14422  *                 new_shape += 1
14423  *
14424  */
14425     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14426     if (__pyx_t_2) {
14427 
14428       /* "View.MemoryView":878
14429  *
14430  *             if (stop - start) - step * new_shape:
14431  *                 new_shape += 1             # <<<<<<<<<<<<<<
14432  *
14433  *         if new_shape < 0:
14434  */
14435       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14436 
14437       /* "View.MemoryView":877
14438  *             new_shape = (stop - start) // step
14439  *
14440  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
14441  *                 new_shape += 1
14442  *
14443  */
14444     }
14445 
14446     /* "View.MemoryView":880
14447  *                 new_shape += 1
14448  *
14449  *         if new_shape < 0:             # <<<<<<<<<<<<<<
14450  *             new_shape = 0
14451  *
14452  */
14453     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
14454     if (__pyx_t_2) {
14455 
14456       /* "View.MemoryView":881
14457  *
14458  *         if new_shape < 0:
14459  *             new_shape = 0             # <<<<<<<<<<<<<<
14460  *
14461  *
14462  */
14463       __pyx_v_new_shape = 0;
14464 
14465       /* "View.MemoryView":880
14466  *                 new_shape += 1
14467  *
14468  *         if new_shape < 0:             # <<<<<<<<<<<<<<
14469  *             new_shape = 0
14470  *
14471  */
14472     }
14473 
14474     /* "View.MemoryView":884
14475  *
14476  *
14477  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
14478  *         dst.shape[new_ndim] = new_shape
14479  *         dst.suboffsets[new_ndim] = suboffset
14480  */
14481     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14482 
14483     /* "View.MemoryView":885
14484  *
14485  *         dst.strides[new_ndim] = stride * step
14486  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
14487  *         dst.suboffsets[new_ndim] = suboffset
14488  *
14489  */
14490     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14491 
14492     /* "View.MemoryView":886
14493  *         dst.strides[new_ndim] = stride * step
14494  *         dst.shape[new_ndim] = new_shape
14495  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
14496  *
14497  *
14498  */
14499     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14500   }
14501   __pyx_L3:;
14502 
14503   /* "View.MemoryView":889
14504  *
14505  *
14506  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
14507  *         dst.data += start * stride
14508  *     else:
14509  */
14510   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
14511   if (__pyx_t_2) {
14512 
14513     /* "View.MemoryView":890
14514  *
14515  *     if suboffset_dim[0] < 0:
14516  *         dst.data += start * stride             # <<<<<<<<<<<<<<
14517  *     else:
14518  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14519  */
14520     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14521 
14522     /* "View.MemoryView":889
14523  *
14524  *
14525  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
14526  *         dst.data += start * stride
14527  *     else:
14528  */
14529     goto __pyx_L23;
14530   }
14531 
14532   /* "View.MemoryView":892
14533  *         dst.data += start * stride
14534  *     else:
14535  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
14536  *
14537  *     if suboffset >= 0:
14538  */
14539   /*else*/ {
14540     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14541     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14542   }
14543   __pyx_L23:;
14544 
14545   /* "View.MemoryView":894
14546  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14547  *
14548  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14549  *         if not is_slice:
14550  *             if new_ndim == 0:
14551  */
14552   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14553   if (__pyx_t_2) {
14554 
14555     /* "View.MemoryView":895
14556  *
14557  *     if suboffset >= 0:
14558  *         if not is_slice:             # <<<<<<<<<<<<<<
14559  *             if new_ndim == 0:
14560  *                 dst.data = (<char **> dst.data)[0] + suboffset
14561  */
14562     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
14563     if (__pyx_t_2) {
14564 
14565       /* "View.MemoryView":896
14566  *     if suboffset >= 0:
14567  *         if not is_slice:
14568  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
14569  *                 dst.data = (<char **> dst.data)[0] + suboffset
14570  *             else:
14571  */
14572       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
14573       if (__pyx_t_2) {
14574 
14575         /* "View.MemoryView":897
14576  *         if not is_slice:
14577  *             if new_ndim == 0:
14578  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
14579  *             else:
14580  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
14581  */
14582         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14583 
14584         /* "View.MemoryView":896
14585  *     if suboffset >= 0:
14586  *         if not is_slice:
14587  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
14588  *                 dst.data = (<char **> dst.data)[0] + suboffset
14589  *             else:
14590  */
14591         goto __pyx_L26;
14592       }
14593 
14594       /* "View.MemoryView":899
14595  *                 dst.data = (<char **> dst.data)[0] + suboffset
14596  *             else:
14597  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
14598  *                                      "must be indexed and not sliced", dim)
14599  *         else:
14600  */
14601       /*else*/ {
14602 
14603         /* "View.MemoryView":900
14604  *             else:
14605  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
14606  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
14607  *         else:
14608  *             suboffset_dim[0] = new_ndim
14609  */
14610         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 899, __pyx_L1_error)
14611       }
14612       __pyx_L26:;
14613 
14614       /* "View.MemoryView":895
14615  *
14616  *     if suboffset >= 0:
14617  *         if not is_slice:             # <<<<<<<<<<<<<<
14618  *             if new_ndim == 0:
14619  *                 dst.data = (<char **> dst.data)[0] + suboffset
14620  */
14621       goto __pyx_L25;
14622     }
14623 
14624     /* "View.MemoryView":902
14625  *                                      "must be indexed and not sliced", dim)
14626  *         else:
14627  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
14628  *
14629  *     return 0
14630  */
14631     /*else*/ {
14632       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14633     }
14634     __pyx_L25:;
14635 
14636     /* "View.MemoryView":894
14637  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14638  *
14639  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14640  *         if not is_slice:
14641  *             if new_ndim == 0:
14642  */
14643   }
14644 
14645   /* "View.MemoryView":904
14646  *             suboffset_dim[0] = new_ndim
14647  *
14648  *     return 0             # <<<<<<<<<<<<<<
14649  *
14650  *
14651  */
14652   __pyx_r = 0;
14653   goto __pyx_L0;
14654 
14655   /* "View.MemoryView":807
14656  *
14657  * @cname('__pyx_memoryview_slice_memviewslice')
14658  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
14659  *         __Pyx_memviewslice *dst,
14660  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14661  */
14662 
14663   /* function exit code */
14664   __pyx_L1_error:;
14665   {
14666     #ifdef WITH_THREAD
14667     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14668     #endif
14669     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14670     #ifdef WITH_THREAD
14671     __Pyx_PyGILState_Release(__pyx_gilstate_save);
14672     #endif
14673   }
14674   __pyx_r = -1;
14675   __pyx_L0:;
14676   return __pyx_r;
14677 }
14678 
14679 /* "View.MemoryView":910
14680  *
14681  * @cname('__pyx_pybuffer_index')
14682  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
14683  *                           Py_ssize_t dim) except NULL:
14684  *     cdef Py_ssize_t shape, stride, suboffset = -1
14685  */
14686 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)14687 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14688   Py_ssize_t __pyx_v_shape;
14689   Py_ssize_t __pyx_v_stride;
14690   Py_ssize_t __pyx_v_suboffset;
14691   Py_ssize_t __pyx_v_itemsize;
14692   char *__pyx_v_resultp;
14693   char *__pyx_r;
14694   __Pyx_RefNannyDeclarations
14695   Py_ssize_t __pyx_t_1;
14696   int __pyx_t_2;
14697   PyObject *__pyx_t_3 = NULL;
14698   PyObject *__pyx_t_4 = NULL;
14699   int __pyx_lineno = 0;
14700   const char *__pyx_filename = NULL;
14701   int __pyx_clineno = 0;
14702   __Pyx_RefNannySetupContext("pybuffer_index", 0);
14703 
14704   /* "View.MemoryView":912
14705  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14706  *                           Py_ssize_t dim) except NULL:
14707  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
14708  *     cdef Py_ssize_t itemsize = view.itemsize
14709  *     cdef char *resultp
14710  */
14711   __pyx_v_suboffset = -1L;
14712 
14713   /* "View.MemoryView":913
14714  *                           Py_ssize_t dim) except NULL:
14715  *     cdef Py_ssize_t shape, stride, suboffset = -1
14716  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
14717  *     cdef char *resultp
14718  *
14719  */
14720   __pyx_t_1 = __pyx_v_view->itemsize;
14721   __pyx_v_itemsize = __pyx_t_1;
14722 
14723   /* "View.MemoryView":916
14724  *     cdef char *resultp
14725  *
14726  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
14727  *         shape = view.len / itemsize
14728  *         stride = itemsize
14729  */
14730   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
14731   if (__pyx_t_2) {
14732 
14733     /* "View.MemoryView":917
14734  *
14735  *     if view.ndim == 0:
14736  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
14737  *         stride = itemsize
14738  *     else:
14739  */
14740     if (unlikely(__pyx_v_itemsize == 0)) {
14741       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14742       __PYX_ERR(2, 917, __pyx_L1_error)
14743     }
14744     else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14745       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14746       __PYX_ERR(2, 917, __pyx_L1_error)
14747     }
14748     __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
14749 
14750     /* "View.MemoryView":918
14751  *     if view.ndim == 0:
14752  *         shape = view.len / itemsize
14753  *         stride = itemsize             # <<<<<<<<<<<<<<
14754  *     else:
14755  *         shape = view.shape[dim]
14756  */
14757     __pyx_v_stride = __pyx_v_itemsize;
14758 
14759     /* "View.MemoryView":916
14760  *     cdef char *resultp
14761  *
14762  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
14763  *         shape = view.len / itemsize
14764  *         stride = itemsize
14765  */
14766     goto __pyx_L3;
14767   }
14768 
14769   /* "View.MemoryView":920
14770  *         stride = itemsize
14771  *     else:
14772  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
14773  *         stride = view.strides[dim]
14774  *         if view.suboffsets != NULL:
14775  */
14776   /*else*/ {
14777     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14778 
14779     /* "View.MemoryView":921
14780  *     else:
14781  *         shape = view.shape[dim]
14782  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
14783  *         if view.suboffsets != NULL:
14784  *             suboffset = view.suboffsets[dim]
14785  */
14786     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14787 
14788     /* "View.MemoryView":922
14789  *         shape = view.shape[dim]
14790  *         stride = view.strides[dim]
14791  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
14792  *             suboffset = view.suboffsets[dim]
14793  *
14794  */
14795     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
14796     if (__pyx_t_2) {
14797 
14798       /* "View.MemoryView":923
14799  *         stride = view.strides[dim]
14800  *         if view.suboffsets != NULL:
14801  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
14802  *
14803  *     if index < 0:
14804  */
14805       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14806 
14807       /* "View.MemoryView":922
14808  *         shape = view.shape[dim]
14809  *         stride = view.strides[dim]
14810  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
14811  *             suboffset = view.suboffsets[dim]
14812  *
14813  */
14814     }
14815   }
14816   __pyx_L3:;
14817 
14818   /* "View.MemoryView":925
14819  *             suboffset = view.suboffsets[dim]
14820  *
14821  *     if index < 0:             # <<<<<<<<<<<<<<
14822  *         index += view.shape[dim]
14823  *         if index < 0:
14824  */
14825   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14826   if (__pyx_t_2) {
14827 
14828     /* "View.MemoryView":926
14829  *
14830  *     if index < 0:
14831  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
14832  *         if index < 0:
14833  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14834  */
14835     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14836 
14837     /* "View.MemoryView":927
14838  *     if index < 0:
14839  *         index += view.shape[dim]
14840  *         if index < 0:             # <<<<<<<<<<<<<<
14841  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14842  *
14843  */
14844     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14845     if (unlikely(__pyx_t_2)) {
14846 
14847       /* "View.MemoryView":928
14848  *         index += view.shape[dim]
14849  *         if index < 0:
14850  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
14851  *
14852  *     if index >= shape:
14853  */
14854       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
14855       __Pyx_GOTREF(__pyx_t_3);
14856       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 928, __pyx_L1_error)
14857       __Pyx_GOTREF(__pyx_t_4);
14858       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14859       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
14860       __Pyx_GOTREF(__pyx_t_3);
14861       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14862       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14863       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14864       __PYX_ERR(2, 928, __pyx_L1_error)
14865 
14866       /* "View.MemoryView":927
14867  *     if index < 0:
14868  *         index += view.shape[dim]
14869  *         if index < 0:             # <<<<<<<<<<<<<<
14870  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14871  *
14872  */
14873     }
14874 
14875     /* "View.MemoryView":925
14876  *             suboffset = view.suboffsets[dim]
14877  *
14878  *     if index < 0:             # <<<<<<<<<<<<<<
14879  *         index += view.shape[dim]
14880  *         if index < 0:
14881  */
14882   }
14883 
14884   /* "View.MemoryView":930
14885  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14886  *
14887  *     if index >= shape:             # <<<<<<<<<<<<<<
14888  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14889  *
14890  */
14891   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
14892   if (unlikely(__pyx_t_2)) {
14893 
14894     /* "View.MemoryView":931
14895  *
14896  *     if index >= shape:
14897  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
14898  *
14899  *     resultp = bufp + index * stride
14900  */
14901     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
14902     __Pyx_GOTREF(__pyx_t_3);
14903     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 931, __pyx_L1_error)
14904     __Pyx_GOTREF(__pyx_t_4);
14905     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14906     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
14907     __Pyx_GOTREF(__pyx_t_3);
14908     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14909     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14910     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14911     __PYX_ERR(2, 931, __pyx_L1_error)
14912 
14913     /* "View.MemoryView":930
14914  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14915  *
14916  *     if index >= shape:             # <<<<<<<<<<<<<<
14917  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14918  *
14919  */
14920   }
14921 
14922   /* "View.MemoryView":933
14923  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14924  *
14925  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
14926  *     if suboffset >= 0:
14927  *         resultp = (<char **> resultp)[0] + suboffset
14928  */
14929   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14930 
14931   /* "View.MemoryView":934
14932  *
14933  *     resultp = bufp + index * stride
14934  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14935  *         resultp = (<char **> resultp)[0] + suboffset
14936  *
14937  */
14938   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14939   if (__pyx_t_2) {
14940 
14941     /* "View.MemoryView":935
14942  *     resultp = bufp + index * stride
14943  *     if suboffset >= 0:
14944  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
14945  *
14946  *     return resultp
14947  */
14948     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14949 
14950     /* "View.MemoryView":934
14951  *
14952  *     resultp = bufp + index * stride
14953  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14954  *         resultp = (<char **> resultp)[0] + suboffset
14955  *
14956  */
14957   }
14958 
14959   /* "View.MemoryView":937
14960  *         resultp = (<char **> resultp)[0] + suboffset
14961  *
14962  *     return resultp             # <<<<<<<<<<<<<<
14963  *
14964  *
14965  */
14966   __pyx_r = __pyx_v_resultp;
14967   goto __pyx_L0;
14968 
14969   /* "View.MemoryView":910
14970  *
14971  * @cname('__pyx_pybuffer_index')
14972  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
14973  *                           Py_ssize_t dim) except NULL:
14974  *     cdef Py_ssize_t shape, stride, suboffset = -1
14975  */
14976 
14977   /* function exit code */
14978   __pyx_L1_error:;
14979   __Pyx_XDECREF(__pyx_t_3);
14980   __Pyx_XDECREF(__pyx_t_4);
14981   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14982   __pyx_r = NULL;
14983   __pyx_L0:;
14984   __Pyx_RefNannyFinishContext();
14985   return __pyx_r;
14986 }
14987 
14988 /* "View.MemoryView":943
14989  *
14990  * @cname('__pyx_memslice_transpose')
14991  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
14992  *     cdef int ndim = memslice.memview.view.ndim
14993  *
14994  */
14995 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)14996 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14997   int __pyx_v_ndim;
14998   Py_ssize_t *__pyx_v_shape;
14999   Py_ssize_t *__pyx_v_strides;
15000   int __pyx_v_i;
15001   int __pyx_v_j;
15002   int __pyx_r;
15003   int __pyx_t_1;
15004   Py_ssize_t *__pyx_t_2;
15005   long __pyx_t_3;
15006   long __pyx_t_4;
15007   Py_ssize_t __pyx_t_5;
15008   Py_ssize_t __pyx_t_6;
15009   int __pyx_t_7;
15010   int __pyx_t_8;
15011   int __pyx_t_9;
15012   int __pyx_lineno = 0;
15013   const char *__pyx_filename = NULL;
15014   int __pyx_clineno = 0;
15015 
15016   /* "View.MemoryView":944
15017  * @cname('__pyx_memslice_transpose')
15018  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
15019  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
15020  *
15021  *     cdef Py_ssize_t *shape = memslice.shape
15022  */
15023   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15024   __pyx_v_ndim = __pyx_t_1;
15025 
15026   /* "View.MemoryView":946
15027  *     cdef int ndim = memslice.memview.view.ndim
15028  *
15029  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
15030  *     cdef Py_ssize_t *strides = memslice.strides
15031  *
15032  */
15033   __pyx_t_2 = __pyx_v_memslice->shape;
15034   __pyx_v_shape = __pyx_t_2;
15035 
15036   /* "View.MemoryView":947
15037  *
15038  *     cdef Py_ssize_t *shape = memslice.shape
15039  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
15040  *
15041  *
15042  */
15043   __pyx_t_2 = __pyx_v_memslice->strides;
15044   __pyx_v_strides = __pyx_t_2;
15045 
15046   /* "View.MemoryView":951
15047  *
15048  *     cdef int i, j
15049  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
15050  *         j = ndim - 1 - i
15051  *         strides[i], strides[j] = strides[j], strides[i]
15052  */
15053   __pyx_t_3 = (__pyx_v_ndim / 2);
15054   __pyx_t_4 = __pyx_t_3;
15055   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15056     __pyx_v_i = __pyx_t_1;
15057 
15058     /* "View.MemoryView":952
15059  *     cdef int i, j
15060  *     for i in range(ndim / 2):
15061  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
15062  *         strides[i], strides[j] = strides[j], strides[i]
15063  *         shape[i], shape[j] = shape[j], shape[i]
15064  */
15065     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15066 
15067     /* "View.MemoryView":953
15068  *     for i in range(ndim / 2):
15069  *         j = ndim - 1 - i
15070  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
15071  *         shape[i], shape[j] = shape[j], shape[i]
15072  *
15073  */
15074     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15075     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15076     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15077     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15078 
15079     /* "View.MemoryView":954
15080  *         j = ndim - 1 - i
15081  *         strides[i], strides[j] = strides[j], strides[i]
15082  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
15083  *
15084  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15085  */
15086     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15087     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15088     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15089     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15090 
15091     /* "View.MemoryView":956
15092  *         shape[i], shape[j] = shape[j], shape[i]
15093  *
15094  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
15095  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15096  *
15097  */
15098     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15099     if (!__pyx_t_8) {
15100     } else {
15101       __pyx_t_7 = __pyx_t_8;
15102       goto __pyx_L6_bool_binop_done;
15103     }
15104     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
15105     __pyx_t_7 = __pyx_t_8;
15106     __pyx_L6_bool_binop_done:;
15107     if (__pyx_t_7) {
15108 
15109       /* "View.MemoryView":957
15110  *
15111  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15112  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
15113  *
15114  *     return 1
15115  */
15116       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error)
15117 
15118       /* "View.MemoryView":956
15119  *         shape[i], shape[j] = shape[j], shape[i]
15120  *
15121  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
15122  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15123  *
15124  */
15125     }
15126   }
15127 
15128   /* "View.MemoryView":959
15129  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15130  *
15131  *     return 1             # <<<<<<<<<<<<<<
15132  *
15133  *
15134  */
15135   __pyx_r = 1;
15136   goto __pyx_L0;
15137 
15138   /* "View.MemoryView":943
15139  *
15140  * @cname('__pyx_memslice_transpose')
15141  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
15142  *     cdef int ndim = memslice.memview.view.ndim
15143  *
15144  */
15145 
15146   /* function exit code */
15147   __pyx_L1_error:;
15148   {
15149     #ifdef WITH_THREAD
15150     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15151     #endif
15152     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15153     #ifdef WITH_THREAD
15154     __Pyx_PyGILState_Release(__pyx_gilstate_save);
15155     #endif
15156   }
15157   __pyx_r = 0;
15158   __pyx_L0:;
15159   return __pyx_r;
15160 }
15161 
15162 /* "View.MemoryView":976
15163  *     cdef int (*to_dtype_func)(char *, object) except 0
15164  *
15165  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
15166  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15167  *
15168  */
15169 
15170 /* Python wrapper */
15171 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)15172 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15173   __Pyx_RefNannyDeclarations
15174   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15175   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15176 
15177   /* function exit code */
15178   __Pyx_RefNannyFinishContext();
15179 }
15180 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)15181 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15182   __Pyx_RefNannyDeclarations
15183   __Pyx_RefNannySetupContext("__dealloc__", 0);
15184 
15185   /* "View.MemoryView":977
15186  *
15187  *     def __dealloc__(self):
15188  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
15189  *
15190  *     cdef convert_item_to_object(self, char *itemp):
15191  */
15192   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
15193 
15194   /* "View.MemoryView":976
15195  *     cdef int (*to_dtype_func)(char *, object) except 0
15196  *
15197  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
15198  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15199  *
15200  */
15201 
15202   /* function exit code */
15203   __Pyx_RefNannyFinishContext();
15204 }
15205 
15206 /* "View.MemoryView":979
15207  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15208  *
15209  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
15210  *         if self.to_object_func != NULL:
15211  *             return self.to_object_func(itemp)
15212  */
15213 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)15214 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15215   PyObject *__pyx_r = NULL;
15216   __Pyx_RefNannyDeclarations
15217   int __pyx_t_1;
15218   PyObject *__pyx_t_2 = NULL;
15219   int __pyx_lineno = 0;
15220   const char *__pyx_filename = NULL;
15221   int __pyx_clineno = 0;
15222   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15223 
15224   /* "View.MemoryView":980
15225  *
15226  *     cdef convert_item_to_object(self, char *itemp):
15227  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
15228  *             return self.to_object_func(itemp)
15229  *         else:
15230  */
15231   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
15232   if (__pyx_t_1) {
15233 
15234     /* "View.MemoryView":981
15235  *     cdef convert_item_to_object(self, char *itemp):
15236  *         if self.to_object_func != NULL:
15237  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
15238  *         else:
15239  *             return memoryview.convert_item_to_object(self, itemp)
15240  */
15241     __Pyx_XDECREF(__pyx_r);
15242     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
15243     __Pyx_GOTREF(__pyx_t_2);
15244     __pyx_r = __pyx_t_2;
15245     __pyx_t_2 = 0;
15246     goto __pyx_L0;
15247 
15248     /* "View.MemoryView":980
15249  *
15250  *     cdef convert_item_to_object(self, char *itemp):
15251  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
15252  *             return self.to_object_func(itemp)
15253  *         else:
15254  */
15255   }
15256 
15257   /* "View.MemoryView":983
15258  *             return self.to_object_func(itemp)
15259  *         else:
15260  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
15261  *
15262  *     cdef assign_item_from_object(self, char *itemp, object value):
15263  */
15264   /*else*/ {
15265     __Pyx_XDECREF(__pyx_r);
15266     __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 983, __pyx_L1_error)
15267     __Pyx_GOTREF(__pyx_t_2);
15268     __pyx_r = __pyx_t_2;
15269     __pyx_t_2 = 0;
15270     goto __pyx_L0;
15271   }
15272 
15273   /* "View.MemoryView":979
15274  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15275  *
15276  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
15277  *         if self.to_object_func != NULL:
15278  *             return self.to_object_func(itemp)
15279  */
15280 
15281   /* function exit code */
15282   __pyx_L1_error:;
15283   __Pyx_XDECREF(__pyx_t_2);
15284   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15285   __pyx_r = 0;
15286   __pyx_L0:;
15287   __Pyx_XGIVEREF(__pyx_r);
15288   __Pyx_RefNannyFinishContext();
15289   return __pyx_r;
15290 }
15291 
15292 /* "View.MemoryView":985
15293  *             return memoryview.convert_item_to_object(self, itemp)
15294  *
15295  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
15296  *         if self.to_dtype_func != NULL:
15297  *             self.to_dtype_func(itemp, value)
15298  */
15299 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)15300 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15301   PyObject *__pyx_r = NULL;
15302   __Pyx_RefNannyDeclarations
15303   int __pyx_t_1;
15304   int __pyx_t_2;
15305   PyObject *__pyx_t_3 = NULL;
15306   int __pyx_lineno = 0;
15307   const char *__pyx_filename = NULL;
15308   int __pyx_clineno = 0;
15309   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
15310 
15311   /* "View.MemoryView":986
15312  *
15313  *     cdef assign_item_from_object(self, char *itemp, object value):
15314  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
15315  *             self.to_dtype_func(itemp, value)
15316  *         else:
15317  */
15318   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
15319   if (__pyx_t_1) {
15320 
15321     /* "View.MemoryView":987
15322  *     cdef assign_item_from_object(self, char *itemp, object value):
15323  *         if self.to_dtype_func != NULL:
15324  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
15325  *         else:
15326  *             memoryview.assign_item_from_object(self, itemp, value)
15327  */
15328     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
15329 
15330     /* "View.MemoryView":986
15331  *
15332  *     cdef assign_item_from_object(self, char *itemp, object value):
15333  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
15334  *             self.to_dtype_func(itemp, value)
15335  *         else:
15336  */
15337     goto __pyx_L3;
15338   }
15339 
15340   /* "View.MemoryView":989
15341  *             self.to_dtype_func(itemp, value)
15342  *         else:
15343  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
15344  *
15345  *     @property
15346  */
15347   /*else*/ {
15348     __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 989, __pyx_L1_error)
15349     __Pyx_GOTREF(__pyx_t_3);
15350     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15351   }
15352   __pyx_L3:;
15353 
15354   /* "View.MemoryView":985
15355  *             return memoryview.convert_item_to_object(self, itemp)
15356  *
15357  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
15358  *         if self.to_dtype_func != NULL:
15359  *             self.to_dtype_func(itemp, value)
15360  */
15361 
15362   /* function exit code */
15363   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15364   goto __pyx_L0;
15365   __pyx_L1_error:;
15366   __Pyx_XDECREF(__pyx_t_3);
15367   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15368   __pyx_r = 0;
15369   __pyx_L0:;
15370   __Pyx_XGIVEREF(__pyx_r);
15371   __Pyx_RefNannyFinishContext();
15372   return __pyx_r;
15373 }
15374 
15375 /* "View.MemoryView":992
15376  *
15377  *     @property
15378  *     def base(self):             # <<<<<<<<<<<<<<
15379  *         return self.from_object
15380  *
15381  */
15382 
15383 /* Python wrapper */
15384 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject * __pyx_v_self)15385 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
15386   PyObject *__pyx_r = 0;
15387   __Pyx_RefNannyDeclarations
15388   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15389   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15390 
15391   /* function exit code */
15392   __Pyx_RefNannyFinishContext();
15393   return __pyx_r;
15394 }
15395 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)15396 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15397   PyObject *__pyx_r = NULL;
15398   __Pyx_RefNannyDeclarations
15399   __Pyx_RefNannySetupContext("__get__", 0);
15400 
15401   /* "View.MemoryView":993
15402  *     @property
15403  *     def base(self):
15404  *         return self.from_object             # <<<<<<<<<<<<<<
15405  *
15406  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
15407  */
15408   __Pyx_XDECREF(__pyx_r);
15409   __Pyx_INCREF(__pyx_v_self->from_object);
15410   __pyx_r = __pyx_v_self->from_object;
15411   goto __pyx_L0;
15412 
15413   /* "View.MemoryView":992
15414  *
15415  *     @property
15416  *     def base(self):             # <<<<<<<<<<<<<<
15417  *         return self.from_object
15418  *
15419  */
15420 
15421   /* function exit code */
15422   __pyx_L0:;
15423   __Pyx_XGIVEREF(__pyx_r);
15424   __Pyx_RefNannyFinishContext();
15425   return __pyx_r;
15426 }
15427 
15428 /* "(tree fragment)":1
15429  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15430  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15431  * def __setstate_cython__(self, __pyx_state):
15432  */
15433 
15434 /* Python wrapper */
15435 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)15436 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15437   PyObject *__pyx_r = 0;
15438   __Pyx_RefNannyDeclarations
15439   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15440   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15441 
15442   /* function exit code */
15443   __Pyx_RefNannyFinishContext();
15444   return __pyx_r;
15445 }
15446 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)15447 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15448   PyObject *__pyx_r = NULL;
15449   __Pyx_RefNannyDeclarations
15450   PyObject *__pyx_t_1 = NULL;
15451   int __pyx_lineno = 0;
15452   const char *__pyx_filename = NULL;
15453   int __pyx_clineno = 0;
15454   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15455 
15456   /* "(tree fragment)":2
15457  * def __reduce_cython__(self):
15458  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15459  * def __setstate_cython__(self, __pyx_state):
15460  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15461  */
15462   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
15463   __Pyx_GOTREF(__pyx_t_1);
15464   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15465   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15466   __PYX_ERR(2, 2, __pyx_L1_error)
15467 
15468   /* "(tree fragment)":1
15469  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15470  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15471  * def __setstate_cython__(self, __pyx_state):
15472  */
15473 
15474   /* function exit code */
15475   __pyx_L1_error:;
15476   __Pyx_XDECREF(__pyx_t_1);
15477   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15478   __pyx_r = NULL;
15479   __Pyx_XGIVEREF(__pyx_r);
15480   __Pyx_RefNannyFinishContext();
15481   return __pyx_r;
15482 }
15483 
15484 /* "(tree fragment)":3
15485  * def __reduce_cython__(self):
15486  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15487  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15488  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15489  */
15490 
15491 /* Python wrapper */
15492 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)15493 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15494   PyObject *__pyx_r = 0;
15495   __Pyx_RefNannyDeclarations
15496   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15497   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15498 
15499   /* function exit code */
15500   __Pyx_RefNannyFinishContext();
15501   return __pyx_r;
15502 }
15503 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)15504 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15505   PyObject *__pyx_r = NULL;
15506   __Pyx_RefNannyDeclarations
15507   PyObject *__pyx_t_1 = NULL;
15508   int __pyx_lineno = 0;
15509   const char *__pyx_filename = NULL;
15510   int __pyx_clineno = 0;
15511   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15512 
15513   /* "(tree fragment)":4
15514  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15515  * def __setstate_cython__(self, __pyx_state):
15516  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15517  */
15518   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
15519   __Pyx_GOTREF(__pyx_t_1);
15520   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15521   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15522   __PYX_ERR(2, 4, __pyx_L1_error)
15523 
15524   /* "(tree fragment)":3
15525  * def __reduce_cython__(self):
15526  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15527  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15528  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15529  */
15530 
15531   /* function exit code */
15532   __pyx_L1_error:;
15533   __Pyx_XDECREF(__pyx_t_1);
15534   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15535   __pyx_r = NULL;
15536   __Pyx_XGIVEREF(__pyx_r);
15537   __Pyx_RefNannyFinishContext();
15538   return __pyx_r;
15539 }
15540 
15541 /* "View.MemoryView":999
15542  *
15543  * @cname('__pyx_memoryview_fromslice')
15544  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
15545  *                           int ndim,
15546  *                           object (*to_object_func)(char *),
15547  */
15548 
__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,int __pyx_v_ndim,PyObject * (* __pyx_v_to_object_func)(char *),int (* __pyx_v_to_dtype_func)(char *,PyObject *),int __pyx_v_dtype_is_object)15549 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
15550   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15551   Py_ssize_t __pyx_v_suboffset;
15552   PyObject *__pyx_v_length = NULL;
15553   PyObject *__pyx_r = NULL;
15554   __Pyx_RefNannyDeclarations
15555   int __pyx_t_1;
15556   PyObject *__pyx_t_2 = NULL;
15557   PyObject *__pyx_t_3 = NULL;
15558   __Pyx_TypeInfo *__pyx_t_4;
15559   Py_buffer __pyx_t_5;
15560   Py_ssize_t *__pyx_t_6;
15561   Py_ssize_t *__pyx_t_7;
15562   Py_ssize_t *__pyx_t_8;
15563   Py_ssize_t __pyx_t_9;
15564   int __pyx_lineno = 0;
15565   const char *__pyx_filename = NULL;
15566   int __pyx_clineno = 0;
15567   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15568 
15569   /* "View.MemoryView":1007
15570  *     cdef _memoryviewslice result
15571  *
15572  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
15573  *         return None
15574  *
15575  */
15576   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
15577   if (__pyx_t_1) {
15578 
15579     /* "View.MemoryView":1008
15580  *
15581  *     if <PyObject *> memviewslice.memview == Py_None:
15582  *         return None             # <<<<<<<<<<<<<<
15583  *
15584  *
15585  */
15586     __Pyx_XDECREF(__pyx_r);
15587     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15588     goto __pyx_L0;
15589 
15590     /* "View.MemoryView":1007
15591  *     cdef _memoryviewslice result
15592  *
15593  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
15594  *         return None
15595  *
15596  */
15597   }
15598 
15599   /* "View.MemoryView":1013
15600  *
15601  *
15602  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
15603  *
15604  *     result.from_slice = memviewslice
15605  */
15606   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
15607   __Pyx_GOTREF(__pyx_t_2);
15608   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
15609   __Pyx_GOTREF(__pyx_t_3);
15610   __Pyx_INCREF(Py_None);
15611   __Pyx_GIVEREF(Py_None);
15612   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
15613   __Pyx_INCREF(__pyx_int_0);
15614   __Pyx_GIVEREF(__pyx_int_0);
15615   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
15616   __Pyx_GIVEREF(__pyx_t_2);
15617   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15618   __pyx_t_2 = 0;
15619   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
15620   __Pyx_GOTREF(__pyx_t_2);
15621   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15622   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15623   __pyx_t_2 = 0;
15624 
15625   /* "View.MemoryView":1015
15626  *     result = _memoryviewslice(None, 0, dtype_is_object)
15627  *
15628  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
15629  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
15630  *
15631  */
15632   __pyx_v_result->from_slice = __pyx_v_memviewslice;
15633 
15634   /* "View.MemoryView":1016
15635  *
15636  *     result.from_slice = memviewslice
15637  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
15638  *
15639  *     result.from_object = (<memoryview> memviewslice.memview).base
15640  */
15641   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15642 
15643   /* "View.MemoryView":1018
15644  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
15645  *
15646  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
15647  *     result.typeinfo = memviewslice.memview.typeinfo
15648  *
15649  */
15650   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
15651   __Pyx_GOTREF(__pyx_t_2);
15652   __Pyx_GIVEREF(__pyx_t_2);
15653   __Pyx_GOTREF(__pyx_v_result->from_object);
15654   __Pyx_DECREF(__pyx_v_result->from_object);
15655   __pyx_v_result->from_object = __pyx_t_2;
15656   __pyx_t_2 = 0;
15657 
15658   /* "View.MemoryView":1019
15659  *
15660  *     result.from_object = (<memoryview> memviewslice.memview).base
15661  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
15662  *
15663  *     result.view = memviewslice.memview.view
15664  */
15665   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15666   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15667 
15668   /* "View.MemoryView":1021
15669  *     result.typeinfo = memviewslice.memview.typeinfo
15670  *
15671  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
15672  *     result.view.buf = <void *> memviewslice.data
15673  *     result.view.ndim = ndim
15674  */
15675   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15676   __pyx_v_result->__pyx_base.view = __pyx_t_5;
15677 
15678   /* "View.MemoryView":1022
15679  *
15680  *     result.view = memviewslice.memview.view
15681  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
15682  *     result.view.ndim = ndim
15683  *     (<__pyx_buffer *> &result.view).obj = Py_None
15684  */
15685   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15686 
15687   /* "View.MemoryView":1023
15688  *     result.view = memviewslice.memview.view
15689  *     result.view.buf = <void *> memviewslice.data
15690  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
15691  *     (<__pyx_buffer *> &result.view).obj = Py_None
15692  *     Py_INCREF(Py_None)
15693  */
15694   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15695 
15696   /* "View.MemoryView":1024
15697  *     result.view.buf = <void *> memviewslice.data
15698  *     result.view.ndim = ndim
15699  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
15700  *     Py_INCREF(Py_None)
15701  *
15702  */
15703   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15704 
15705   /* "View.MemoryView":1025
15706  *     result.view.ndim = ndim
15707  *     (<__pyx_buffer *> &result.view).obj = Py_None
15708  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
15709  *
15710  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15711  */
15712   Py_INCREF(Py_None);
15713 
15714   /* "View.MemoryView":1027
15715  *     Py_INCREF(Py_None)
15716  *
15717  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
15718  *         result.flags = PyBUF_RECORDS
15719  *     else:
15720  */
15721   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15722   if (__pyx_t_1) {
15723 
15724     /* "View.MemoryView":1028
15725  *
15726  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15727  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
15728  *     else:
15729  *         result.flags = PyBUF_RECORDS_RO
15730  */
15731     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15732 
15733     /* "View.MemoryView":1027
15734  *     Py_INCREF(Py_None)
15735  *
15736  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
15737  *         result.flags = PyBUF_RECORDS
15738  *     else:
15739  */
15740     goto __pyx_L4;
15741   }
15742 
15743   /* "View.MemoryView":1030
15744  *         result.flags = PyBUF_RECORDS
15745  *     else:
15746  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
15747  *
15748  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
15749  */
15750   /*else*/ {
15751     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15752   }
15753   __pyx_L4:;
15754 
15755   /* "View.MemoryView":1032
15756  *         result.flags = PyBUF_RECORDS_RO
15757  *
15758  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
15759  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
15760  *
15761  */
15762   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15763 
15764   /* "View.MemoryView":1033
15765  *
15766  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
15767  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
15768  *
15769  *
15770  */
15771   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15772 
15773   /* "View.MemoryView":1036
15774  *
15775  *
15776  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
15777  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15778  *         if suboffset >= 0:
15779  */
15780   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15781 
15782   /* "View.MemoryView":1037
15783  *
15784  *     result.view.suboffsets = NULL
15785  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
15786  *         if suboffset >= 0:
15787  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15788  */
15789   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15790   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15791     __pyx_t_6 = __pyx_t_8;
15792     __pyx_v_suboffset = (__pyx_t_6[0]);
15793 
15794     /* "View.MemoryView":1038
15795  *     result.view.suboffsets = NULL
15796  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15797  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
15798  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15799  *             break
15800  */
15801     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
15802     if (__pyx_t_1) {
15803 
15804       /* "View.MemoryView":1039
15805  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15806  *         if suboffset >= 0:
15807  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
15808  *             break
15809  *
15810  */
15811       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15812 
15813       /* "View.MemoryView":1040
15814  *         if suboffset >= 0:
15815  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15816  *             break             # <<<<<<<<<<<<<<
15817  *
15818  *     result.view.len = result.view.itemsize
15819  */
15820       goto __pyx_L6_break;
15821 
15822       /* "View.MemoryView":1038
15823  *     result.view.suboffsets = NULL
15824  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15825  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
15826  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15827  *             break
15828  */
15829     }
15830   }
15831   __pyx_L6_break:;
15832 
15833   /* "View.MemoryView":1042
15834  *             break
15835  *
15836  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
15837  *     for length in result.view.shape[:ndim]:
15838  *         result.view.len *= length
15839  */
15840   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15841   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15842 
15843   /* "View.MemoryView":1043
15844  *
15845  *     result.view.len = result.view.itemsize
15846  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
15847  *         result.view.len *= length
15848  *
15849  */
15850   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15851   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15852     __pyx_t_6 = __pyx_t_8;
15853     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
15854     __Pyx_GOTREF(__pyx_t_2);
15855     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15856     __pyx_t_2 = 0;
15857 
15858     /* "View.MemoryView":1044
15859  *     result.view.len = result.view.itemsize
15860  *     for length in result.view.shape[:ndim]:
15861  *         result.view.len *= length             # <<<<<<<<<<<<<<
15862  *
15863  *     result.to_object_func = to_object_func
15864  */
15865     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
15866     __Pyx_GOTREF(__pyx_t_2);
15867     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
15868     __Pyx_GOTREF(__pyx_t_3);
15869     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15870     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
15871     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15872     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15873   }
15874 
15875   /* "View.MemoryView":1046
15876  *         result.view.len *= length
15877  *
15878  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
15879  *     result.to_dtype_func = to_dtype_func
15880  *
15881  */
15882   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15883 
15884   /* "View.MemoryView":1047
15885  *
15886  *     result.to_object_func = to_object_func
15887  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
15888  *
15889  *     return result
15890  */
15891   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15892 
15893   /* "View.MemoryView":1049
15894  *     result.to_dtype_func = to_dtype_func
15895  *
15896  *     return result             # <<<<<<<<<<<<<<
15897  *
15898  * @cname('__pyx_memoryview_get_slice_from_memoryview')
15899  */
15900   __Pyx_XDECREF(__pyx_r);
15901   __Pyx_INCREF(((PyObject *)__pyx_v_result));
15902   __pyx_r = ((PyObject *)__pyx_v_result);
15903   goto __pyx_L0;
15904 
15905   /* "View.MemoryView":999
15906  *
15907  * @cname('__pyx_memoryview_fromslice')
15908  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
15909  *                           int ndim,
15910  *                           object (*to_object_func)(char *),
15911  */
15912 
15913   /* function exit code */
15914   __pyx_L1_error:;
15915   __Pyx_XDECREF(__pyx_t_2);
15916   __Pyx_XDECREF(__pyx_t_3);
15917   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15918   __pyx_r = 0;
15919   __pyx_L0:;
15920   __Pyx_XDECREF((PyObject *)__pyx_v_result);
15921   __Pyx_XDECREF(__pyx_v_length);
15922   __Pyx_XGIVEREF(__pyx_r);
15923   __Pyx_RefNannyFinishContext();
15924   return __pyx_r;
15925 }
15926 
15927 /* "View.MemoryView":1052
15928  *
15929  * @cname('__pyx_memoryview_get_slice_from_memoryview')
15930  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
15931  *                                                    __Pyx_memviewslice *mslice) except NULL:
15932  *     cdef _memoryviewslice obj
15933  */
15934 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)15935 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15936   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15937   __Pyx_memviewslice *__pyx_r;
15938   __Pyx_RefNannyDeclarations
15939   int __pyx_t_1;
15940   int __pyx_t_2;
15941   PyObject *__pyx_t_3 = NULL;
15942   int __pyx_lineno = 0;
15943   const char *__pyx_filename = NULL;
15944   int __pyx_clineno = 0;
15945   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15946 
15947   /* "View.MemoryView":1055
15948  *                                                    __Pyx_memviewslice *mslice) except NULL:
15949  *     cdef _memoryviewslice obj
15950  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15951  *         obj = memview
15952  *         return &obj.from_slice
15953  */
15954   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15955   __pyx_t_2 = (__pyx_t_1 != 0);
15956   if (__pyx_t_2) {
15957 
15958     /* "View.MemoryView":1056
15959  *     cdef _memoryviewslice obj
15960  *     if isinstance(memview, _memoryviewslice):
15961  *         obj = memview             # <<<<<<<<<<<<<<
15962  *         return &obj.from_slice
15963  *     else:
15964  */
15965     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
15966     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15967     __Pyx_INCREF(__pyx_t_3);
15968     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15969     __pyx_t_3 = 0;
15970 
15971     /* "View.MemoryView":1057
15972  *     if isinstance(memview, _memoryviewslice):
15973  *         obj = memview
15974  *         return &obj.from_slice             # <<<<<<<<<<<<<<
15975  *     else:
15976  *         slice_copy(memview, mslice)
15977  */
15978     __pyx_r = (&__pyx_v_obj->from_slice);
15979     goto __pyx_L0;
15980 
15981     /* "View.MemoryView":1055
15982  *                                                    __Pyx_memviewslice *mslice) except NULL:
15983  *     cdef _memoryviewslice obj
15984  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15985  *         obj = memview
15986  *         return &obj.from_slice
15987  */
15988   }
15989 
15990   /* "View.MemoryView":1059
15991  *         return &obj.from_slice
15992  *     else:
15993  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
15994  *         return mslice
15995  *
15996  */
15997   /*else*/ {
15998     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15999 
16000     /* "View.MemoryView":1060
16001  *     else:
16002  *         slice_copy(memview, mslice)
16003  *         return mslice             # <<<<<<<<<<<<<<
16004  *
16005  * @cname('__pyx_memoryview_slice_copy')
16006  */
16007     __pyx_r = __pyx_v_mslice;
16008     goto __pyx_L0;
16009   }
16010 
16011   /* "View.MemoryView":1052
16012  *
16013  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16014  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
16015  *                                                    __Pyx_memviewslice *mslice) except NULL:
16016  *     cdef _memoryviewslice obj
16017  */
16018 
16019   /* function exit code */
16020   __pyx_L1_error:;
16021   __Pyx_XDECREF(__pyx_t_3);
16022   __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16023   __pyx_r = NULL;
16024   __pyx_L0:;
16025   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16026   __Pyx_RefNannyFinishContext();
16027   return __pyx_r;
16028 }
16029 
16030 /* "View.MemoryView":1063
16031  *
16032  * @cname('__pyx_memoryview_slice_copy')
16033  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
16034  *     cdef int dim
16035  *     cdef (Py_ssize_t*) shape, strides, suboffsets
16036  */
16037 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)16038 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16039   int __pyx_v_dim;
16040   Py_ssize_t *__pyx_v_shape;
16041   Py_ssize_t *__pyx_v_strides;
16042   Py_ssize_t *__pyx_v_suboffsets;
16043   __Pyx_RefNannyDeclarations
16044   Py_ssize_t *__pyx_t_1;
16045   int __pyx_t_2;
16046   int __pyx_t_3;
16047   int __pyx_t_4;
16048   Py_ssize_t __pyx_t_5;
16049   __Pyx_RefNannySetupContext("slice_copy", 0);
16050 
16051   /* "View.MemoryView":1067
16052  *     cdef (Py_ssize_t*) shape, strides, suboffsets
16053  *
16054  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
16055  *     strides = memview.view.strides
16056  *     suboffsets = memview.view.suboffsets
16057  */
16058   __pyx_t_1 = __pyx_v_memview->view.shape;
16059   __pyx_v_shape = __pyx_t_1;
16060 
16061   /* "View.MemoryView":1068
16062  *
16063  *     shape = memview.view.shape
16064  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
16065  *     suboffsets = memview.view.suboffsets
16066  *
16067  */
16068   __pyx_t_1 = __pyx_v_memview->view.strides;
16069   __pyx_v_strides = __pyx_t_1;
16070 
16071   /* "View.MemoryView":1069
16072  *     shape = memview.view.shape
16073  *     strides = memview.view.strides
16074  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
16075  *
16076  *     dst.memview = <__pyx_memoryview *> memview
16077  */
16078   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16079   __pyx_v_suboffsets = __pyx_t_1;
16080 
16081   /* "View.MemoryView":1071
16082  *     suboffsets = memview.view.suboffsets
16083  *
16084  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
16085  *     dst.data = <char *> memview.view.buf
16086  *
16087  */
16088   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16089 
16090   /* "View.MemoryView":1072
16091  *
16092  *     dst.memview = <__pyx_memoryview *> memview
16093  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
16094  *
16095  *     for dim in range(memview.view.ndim):
16096  */
16097   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16098 
16099   /* "View.MemoryView":1074
16100  *     dst.data = <char *> memview.view.buf
16101  *
16102  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
16103  *         dst.shape[dim] = shape[dim]
16104  *         dst.strides[dim] = strides[dim]
16105  */
16106   __pyx_t_2 = __pyx_v_memview->view.ndim;
16107   __pyx_t_3 = __pyx_t_2;
16108   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16109     __pyx_v_dim = __pyx_t_4;
16110 
16111     /* "View.MemoryView":1075
16112  *
16113  *     for dim in range(memview.view.ndim):
16114  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
16115  *         dst.strides[dim] = strides[dim]
16116  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16117  */
16118     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16119 
16120     /* "View.MemoryView":1076
16121  *     for dim in range(memview.view.ndim):
16122  *         dst.shape[dim] = shape[dim]
16123  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
16124  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16125  *
16126  */
16127     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16128 
16129     /* "View.MemoryView":1077
16130  *         dst.shape[dim] = shape[dim]
16131  *         dst.strides[dim] = strides[dim]
16132  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
16133  *
16134  * @cname('__pyx_memoryview_copy_object')
16135  */
16136     if ((__pyx_v_suboffsets != 0)) {
16137       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16138     } else {
16139       __pyx_t_5 = -1L;
16140     }
16141     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16142   }
16143 
16144   /* "View.MemoryView":1063
16145  *
16146  * @cname('__pyx_memoryview_slice_copy')
16147  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
16148  *     cdef int dim
16149  *     cdef (Py_ssize_t*) shape, strides, suboffsets
16150  */
16151 
16152   /* function exit code */
16153   __Pyx_RefNannyFinishContext();
16154 }
16155 
16156 /* "View.MemoryView":1080
16157  *
16158  * @cname('__pyx_memoryview_copy_object')
16159  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
16160  *     "Create a new memoryview object"
16161  *     cdef __Pyx_memviewslice memviewslice
16162  */
16163 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)16164 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16165   __Pyx_memviewslice __pyx_v_memviewslice;
16166   PyObject *__pyx_r = NULL;
16167   __Pyx_RefNannyDeclarations
16168   PyObject *__pyx_t_1 = NULL;
16169   int __pyx_lineno = 0;
16170   const char *__pyx_filename = NULL;
16171   int __pyx_clineno = 0;
16172   __Pyx_RefNannySetupContext("memoryview_copy", 0);
16173 
16174   /* "View.MemoryView":1083
16175  *     "Create a new memoryview object"
16176  *     cdef __Pyx_memviewslice memviewslice
16177  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
16178  *     return memoryview_copy_from_slice(memview, &memviewslice)
16179  *
16180  */
16181   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16182 
16183   /* "View.MemoryView":1084
16184  *     cdef __Pyx_memviewslice memviewslice
16185  *     slice_copy(memview, &memviewslice)
16186  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
16187  *
16188  * @cname('__pyx_memoryview_copy_object_from_slice')
16189  */
16190   __Pyx_XDECREF(__pyx_r);
16191   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
16192   __Pyx_GOTREF(__pyx_t_1);
16193   __pyx_r = __pyx_t_1;
16194   __pyx_t_1 = 0;
16195   goto __pyx_L0;
16196 
16197   /* "View.MemoryView":1080
16198  *
16199  * @cname('__pyx_memoryview_copy_object')
16200  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
16201  *     "Create a new memoryview object"
16202  *     cdef __Pyx_memviewslice memviewslice
16203  */
16204 
16205   /* function exit code */
16206   __pyx_L1_error:;
16207   __Pyx_XDECREF(__pyx_t_1);
16208   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16209   __pyx_r = 0;
16210   __pyx_L0:;
16211   __Pyx_XGIVEREF(__pyx_r);
16212   __Pyx_RefNannyFinishContext();
16213   return __pyx_r;
16214 }
16215 
16216 /* "View.MemoryView":1087
16217  *
16218  * @cname('__pyx_memoryview_copy_object_from_slice')
16219  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
16220  *     """
16221  *     Create a new memoryview object from a given memoryview object and slice.
16222  */
16223 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)16224 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16225   PyObject *(*__pyx_v_to_object_func)(char *);
16226   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16227   PyObject *__pyx_r = NULL;
16228   __Pyx_RefNannyDeclarations
16229   int __pyx_t_1;
16230   int __pyx_t_2;
16231   PyObject *(*__pyx_t_3)(char *);
16232   int (*__pyx_t_4)(char *, PyObject *);
16233   PyObject *__pyx_t_5 = NULL;
16234   int __pyx_lineno = 0;
16235   const char *__pyx_filename = NULL;
16236   int __pyx_clineno = 0;
16237   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
16238 
16239   /* "View.MemoryView":1094
16240  *     cdef int (*to_dtype_func)(char *, object) except 0
16241  *
16242  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
16243  *         to_object_func = (<_memoryviewslice> memview).to_object_func
16244  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16245  */
16246   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16247   __pyx_t_2 = (__pyx_t_1 != 0);
16248   if (__pyx_t_2) {
16249 
16250     /* "View.MemoryView":1095
16251  *
16252  *     if isinstance(memview, _memoryviewslice):
16253  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
16254  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16255  *     else:
16256  */
16257     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16258     __pyx_v_to_object_func = __pyx_t_3;
16259 
16260     /* "View.MemoryView":1096
16261  *     if isinstance(memview, _memoryviewslice):
16262  *         to_object_func = (<_memoryviewslice> memview).to_object_func
16263  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
16264  *     else:
16265  *         to_object_func = NULL
16266  */
16267     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16268     __pyx_v_to_dtype_func = __pyx_t_4;
16269 
16270     /* "View.MemoryView":1094
16271  *     cdef int (*to_dtype_func)(char *, object) except 0
16272  *
16273  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
16274  *         to_object_func = (<_memoryviewslice> memview).to_object_func
16275  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16276  */
16277     goto __pyx_L3;
16278   }
16279 
16280   /* "View.MemoryView":1098
16281  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16282  *     else:
16283  *         to_object_func = NULL             # <<<<<<<<<<<<<<
16284  *         to_dtype_func = NULL
16285  *
16286  */
16287   /*else*/ {
16288     __pyx_v_to_object_func = NULL;
16289 
16290     /* "View.MemoryView":1099
16291  *     else:
16292  *         to_object_func = NULL
16293  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
16294  *
16295  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16296  */
16297     __pyx_v_to_dtype_func = NULL;
16298   }
16299   __pyx_L3:;
16300 
16301   /* "View.MemoryView":1101
16302  *         to_dtype_func = NULL
16303  *
16304  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
16305  *                                 to_object_func, to_dtype_func,
16306  *                                 memview.dtype_is_object)
16307  */
16308   __Pyx_XDECREF(__pyx_r);
16309 
16310   /* "View.MemoryView":1103
16311  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16312  *                                 to_object_func, to_dtype_func,
16313  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
16314  *
16315  *
16316  */
16317   __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1101, __pyx_L1_error)
16318   __Pyx_GOTREF(__pyx_t_5);
16319   __pyx_r = __pyx_t_5;
16320   __pyx_t_5 = 0;
16321   goto __pyx_L0;
16322 
16323   /* "View.MemoryView":1087
16324  *
16325  * @cname('__pyx_memoryview_copy_object_from_slice')
16326  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
16327  *     """
16328  *     Create a new memoryview object from a given memoryview object and slice.
16329  */
16330 
16331   /* function exit code */
16332   __pyx_L1_error:;
16333   __Pyx_XDECREF(__pyx_t_5);
16334   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16335   __pyx_r = 0;
16336   __pyx_L0:;
16337   __Pyx_XGIVEREF(__pyx_r);
16338   __Pyx_RefNannyFinishContext();
16339   return __pyx_r;
16340 }
16341 
16342 /* "View.MemoryView":1109
16343  *
16344  *
16345  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
16346  *     if arg < 0:
16347  *         return -arg
16348  */
16349 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)16350 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16351   Py_ssize_t __pyx_r;
16352   int __pyx_t_1;
16353 
16354   /* "View.MemoryView":1110
16355  *
16356  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16357  *     if arg < 0:             # <<<<<<<<<<<<<<
16358  *         return -arg
16359  *     else:
16360  */
16361   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
16362   if (__pyx_t_1) {
16363 
16364     /* "View.MemoryView":1111
16365  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16366  *     if arg < 0:
16367  *         return -arg             # <<<<<<<<<<<<<<
16368  *     else:
16369  *         return arg
16370  */
16371     __pyx_r = (-__pyx_v_arg);
16372     goto __pyx_L0;
16373 
16374     /* "View.MemoryView":1110
16375  *
16376  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16377  *     if arg < 0:             # <<<<<<<<<<<<<<
16378  *         return -arg
16379  *     else:
16380  */
16381   }
16382 
16383   /* "View.MemoryView":1113
16384  *         return -arg
16385  *     else:
16386  *         return arg             # <<<<<<<<<<<<<<
16387  *
16388  * @cname('__pyx_get_best_slice_order')
16389  */
16390   /*else*/ {
16391     __pyx_r = __pyx_v_arg;
16392     goto __pyx_L0;
16393   }
16394 
16395   /* "View.MemoryView":1109
16396  *
16397  *
16398  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
16399  *     if arg < 0:
16400  *         return -arg
16401  */
16402 
16403   /* function exit code */
16404   __pyx_L0:;
16405   return __pyx_r;
16406 }
16407 
16408 /* "View.MemoryView":1116
16409  *
16410  * @cname('__pyx_get_best_slice_order')
16411  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
16412  *     """
16413  *     Figure out the best memory access order for a given slice.
16414  */
16415 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)16416 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16417   int __pyx_v_i;
16418   Py_ssize_t __pyx_v_c_stride;
16419   Py_ssize_t __pyx_v_f_stride;
16420   char __pyx_r;
16421   int __pyx_t_1;
16422   int __pyx_t_2;
16423   int __pyx_t_3;
16424   int __pyx_t_4;
16425 
16426   /* "View.MemoryView":1121
16427  *     """
16428  *     cdef int i
16429  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
16430  *     cdef Py_ssize_t f_stride = 0
16431  *
16432  */
16433   __pyx_v_c_stride = 0;
16434 
16435   /* "View.MemoryView":1122
16436  *     cdef int i
16437  *     cdef Py_ssize_t c_stride = 0
16438  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
16439  *
16440  *     for i in range(ndim - 1, -1, -1):
16441  */
16442   __pyx_v_f_stride = 0;
16443 
16444   /* "View.MemoryView":1124
16445  *     cdef Py_ssize_t f_stride = 0
16446  *
16447  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
16448  *         if mslice.shape[i] > 1:
16449  *             c_stride = mslice.strides[i]
16450  */
16451   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16452     __pyx_v_i = __pyx_t_1;
16453 
16454     /* "View.MemoryView":1125
16455  *
16456  *     for i in range(ndim - 1, -1, -1):
16457  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16458  *             c_stride = mslice.strides[i]
16459  *             break
16460  */
16461     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16462     if (__pyx_t_2) {
16463 
16464       /* "View.MemoryView":1126
16465  *     for i in range(ndim - 1, -1, -1):
16466  *         if mslice.shape[i] > 1:
16467  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
16468  *             break
16469  *
16470  */
16471       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16472 
16473       /* "View.MemoryView":1127
16474  *         if mslice.shape[i] > 1:
16475  *             c_stride = mslice.strides[i]
16476  *             break             # <<<<<<<<<<<<<<
16477  *
16478  *     for i in range(ndim):
16479  */
16480       goto __pyx_L4_break;
16481 
16482       /* "View.MemoryView":1125
16483  *
16484  *     for i in range(ndim - 1, -1, -1):
16485  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16486  *             c_stride = mslice.strides[i]
16487  *             break
16488  */
16489     }
16490   }
16491   __pyx_L4_break:;
16492 
16493   /* "View.MemoryView":1129
16494  *             break
16495  *
16496  *     for i in range(ndim):             # <<<<<<<<<<<<<<
16497  *         if mslice.shape[i] > 1:
16498  *             f_stride = mslice.strides[i]
16499  */
16500   __pyx_t_1 = __pyx_v_ndim;
16501   __pyx_t_3 = __pyx_t_1;
16502   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16503     __pyx_v_i = __pyx_t_4;
16504 
16505     /* "View.MemoryView":1130
16506  *
16507  *     for i in range(ndim):
16508  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16509  *             f_stride = mslice.strides[i]
16510  *             break
16511  */
16512     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16513     if (__pyx_t_2) {
16514 
16515       /* "View.MemoryView":1131
16516  *     for i in range(ndim):
16517  *         if mslice.shape[i] > 1:
16518  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
16519  *             break
16520  *
16521  */
16522       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16523 
16524       /* "View.MemoryView":1132
16525  *         if mslice.shape[i] > 1:
16526  *             f_stride = mslice.strides[i]
16527  *             break             # <<<<<<<<<<<<<<
16528  *
16529  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16530  */
16531       goto __pyx_L7_break;
16532 
16533       /* "View.MemoryView":1130
16534  *
16535  *     for i in range(ndim):
16536  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16537  *             f_stride = mslice.strides[i]
16538  *             break
16539  */
16540     }
16541   }
16542   __pyx_L7_break:;
16543 
16544   /* "View.MemoryView":1134
16545  *             break
16546  *
16547  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
16548  *         return 'C'
16549  *     else:
16550  */
16551   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
16552   if (__pyx_t_2) {
16553 
16554     /* "View.MemoryView":1135
16555  *
16556  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16557  *         return 'C'             # <<<<<<<<<<<<<<
16558  *     else:
16559  *         return 'F'
16560  */
16561     __pyx_r = 'C';
16562     goto __pyx_L0;
16563 
16564     /* "View.MemoryView":1134
16565  *             break
16566  *
16567  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
16568  *         return 'C'
16569  *     else:
16570  */
16571   }
16572 
16573   /* "View.MemoryView":1137
16574  *         return 'C'
16575  *     else:
16576  *         return 'F'             # <<<<<<<<<<<<<<
16577  *
16578  * @cython.cdivision(True)
16579  */
16580   /*else*/ {
16581     __pyx_r = 'F';
16582     goto __pyx_L0;
16583   }
16584 
16585   /* "View.MemoryView":1116
16586  *
16587  * @cname('__pyx_get_best_slice_order')
16588  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
16589  *     """
16590  *     Figure out the best memory access order for a given slice.
16591  */
16592 
16593   /* function exit code */
16594   __pyx_L0:;
16595   return __pyx_r;
16596 }
16597 
16598 /* "View.MemoryView":1140
16599  *
16600  * @cython.cdivision(True)
16601  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
16602  *                                    char *dst_data, Py_ssize_t *dst_strides,
16603  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16604  */
16605 
_copy_strided_to_strided(char * __pyx_v_src_data,Py_ssize_t * __pyx_v_src_strides,char * __pyx_v_dst_data,Py_ssize_t * __pyx_v_dst_strides,Py_ssize_t * __pyx_v_src_shape,Py_ssize_t * __pyx_v_dst_shape,int __pyx_v_ndim,size_t __pyx_v_itemsize)16606 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16607   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16608   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16609   Py_ssize_t __pyx_v_dst_extent;
16610   Py_ssize_t __pyx_v_src_stride;
16611   Py_ssize_t __pyx_v_dst_stride;
16612   int __pyx_t_1;
16613   int __pyx_t_2;
16614   int __pyx_t_3;
16615   Py_ssize_t __pyx_t_4;
16616   Py_ssize_t __pyx_t_5;
16617   Py_ssize_t __pyx_t_6;
16618 
16619   /* "View.MemoryView":1147
16620  *
16621  *     cdef Py_ssize_t i
16622  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
16623  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16624  *     cdef Py_ssize_t src_stride = src_strides[0]
16625  */
16626   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16627 
16628   /* "View.MemoryView":1148
16629  *     cdef Py_ssize_t i
16630  *     cdef Py_ssize_t src_extent = src_shape[0]
16631  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
16632  *     cdef Py_ssize_t src_stride = src_strides[0]
16633  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16634  */
16635   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16636 
16637   /* "View.MemoryView":1149
16638  *     cdef Py_ssize_t src_extent = src_shape[0]
16639  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16640  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
16641  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16642  *
16643  */
16644   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16645 
16646   /* "View.MemoryView":1150
16647  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16648  *     cdef Py_ssize_t src_stride = src_strides[0]
16649  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
16650  *
16651  *     if ndim == 1:
16652  */
16653   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16654 
16655   /* "View.MemoryView":1152
16656  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16657  *
16658  *     if ndim == 1:             # <<<<<<<<<<<<<<
16659  *        if (src_stride > 0 and dst_stride > 0 and
16660  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16661  */
16662   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
16663   if (__pyx_t_1) {
16664 
16665     /* "View.MemoryView":1153
16666  *
16667  *     if ndim == 1:
16668  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16669  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16670  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16671  */
16672     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
16673     if (__pyx_t_2) {
16674     } else {
16675       __pyx_t_1 = __pyx_t_2;
16676       goto __pyx_L5_bool_binop_done;
16677     }
16678     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
16679     if (__pyx_t_2) {
16680     } else {
16681       __pyx_t_1 = __pyx_t_2;
16682       goto __pyx_L5_bool_binop_done;
16683     }
16684 
16685     /* "View.MemoryView":1154
16686  *     if ndim == 1:
16687  *        if (src_stride > 0 and dst_stride > 0 and
16688  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
16689  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16690  *        else:
16691  */
16692     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16693     if (__pyx_t_2) {
16694       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16695     }
16696     __pyx_t_3 = (__pyx_t_2 != 0);
16697     __pyx_t_1 = __pyx_t_3;
16698     __pyx_L5_bool_binop_done:;
16699 
16700     /* "View.MemoryView":1153
16701  *
16702  *     if ndim == 1:
16703  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16704  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16705  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16706  */
16707     if (__pyx_t_1) {
16708 
16709       /* "View.MemoryView":1155
16710  *        if (src_stride > 0 and dst_stride > 0 and
16711  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16712  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
16713  *        else:
16714  *            for i in range(dst_extent):
16715  */
16716       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16717 
16718       /* "View.MemoryView":1153
16719  *
16720  *     if ndim == 1:
16721  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16722  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16723  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16724  */
16725       goto __pyx_L4;
16726     }
16727 
16728     /* "View.MemoryView":1157
16729  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16730  *        else:
16731  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
16732  *                memcpy(dst_data, src_data, itemsize)
16733  *                src_data += src_stride
16734  */
16735     /*else*/ {
16736       __pyx_t_4 = __pyx_v_dst_extent;
16737       __pyx_t_5 = __pyx_t_4;
16738       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16739         __pyx_v_i = __pyx_t_6;
16740 
16741         /* "View.MemoryView":1158
16742  *        else:
16743  *            for i in range(dst_extent):
16744  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
16745  *                src_data += src_stride
16746  *                dst_data += dst_stride
16747  */
16748         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16749 
16750         /* "View.MemoryView":1159
16751  *            for i in range(dst_extent):
16752  *                memcpy(dst_data, src_data, itemsize)
16753  *                src_data += src_stride             # <<<<<<<<<<<<<<
16754  *                dst_data += dst_stride
16755  *     else:
16756  */
16757         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16758 
16759         /* "View.MemoryView":1160
16760  *                memcpy(dst_data, src_data, itemsize)
16761  *                src_data += src_stride
16762  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
16763  *     else:
16764  *         for i in range(dst_extent):
16765  */
16766         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16767       }
16768     }
16769     __pyx_L4:;
16770 
16771     /* "View.MemoryView":1152
16772  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16773  *
16774  *     if ndim == 1:             # <<<<<<<<<<<<<<
16775  *        if (src_stride > 0 and dst_stride > 0 and
16776  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16777  */
16778     goto __pyx_L3;
16779   }
16780 
16781   /* "View.MemoryView":1162
16782  *                dst_data += dst_stride
16783  *     else:
16784  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
16785  *             _copy_strided_to_strided(src_data, src_strides + 1,
16786  *                                      dst_data, dst_strides + 1,
16787  */
16788   /*else*/ {
16789     __pyx_t_4 = __pyx_v_dst_extent;
16790     __pyx_t_5 = __pyx_t_4;
16791     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16792       __pyx_v_i = __pyx_t_6;
16793 
16794       /* "View.MemoryView":1163
16795  *     else:
16796  *         for i in range(dst_extent):
16797  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
16798  *                                      dst_data, dst_strides + 1,
16799  *                                      src_shape + 1, dst_shape + 1,
16800  */
16801       _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16802 
16803       /* "View.MemoryView":1167
16804  *                                      src_shape + 1, dst_shape + 1,
16805  *                                      ndim - 1, itemsize)
16806  *             src_data += src_stride             # <<<<<<<<<<<<<<
16807  *             dst_data += dst_stride
16808  *
16809  */
16810       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16811 
16812       /* "View.MemoryView":1168
16813  *                                      ndim - 1, itemsize)
16814  *             src_data += src_stride
16815  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
16816  *
16817  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16818  */
16819       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16820     }
16821   }
16822   __pyx_L3:;
16823 
16824   /* "View.MemoryView":1140
16825  *
16826  * @cython.cdivision(True)
16827  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
16828  *                                    char *dst_data, Py_ssize_t *dst_strides,
16829  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16830  */
16831 
16832   /* function exit code */
16833 }
16834 
16835 /* "View.MemoryView":1170
16836  *             dst_data += dst_stride
16837  *
16838  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16839  *                                   __Pyx_memviewslice *dst,
16840  *                                   int ndim, size_t itemsize) nogil:
16841  */
16842 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)16843 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16844 
16845   /* "View.MemoryView":1173
16846  *                                   __Pyx_memviewslice *dst,
16847  *                                   int ndim, size_t itemsize) nogil:
16848  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
16849  *                              src.shape, dst.shape, ndim, itemsize)
16850  *
16851  */
16852   _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16853 
16854   /* "View.MemoryView":1170
16855  *             dst_data += dst_stride
16856  *
16857  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16858  *                                   __Pyx_memviewslice *dst,
16859  *                                   int ndim, size_t itemsize) nogil:
16860  */
16861 
16862   /* function exit code */
16863 }
16864 
16865 /* "View.MemoryView":1177
16866  *
16867  * @cname('__pyx_memoryview_slice_get_size')
16868  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
16869  *     "Return the size of the memory occupied by the slice in number of bytes"
16870  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
16871  */
16872 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)16873 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16874   Py_ssize_t __pyx_v_shape;
16875   Py_ssize_t __pyx_v_size;
16876   Py_ssize_t __pyx_r;
16877   Py_ssize_t __pyx_t_1;
16878   Py_ssize_t *__pyx_t_2;
16879   Py_ssize_t *__pyx_t_3;
16880   Py_ssize_t *__pyx_t_4;
16881 
16882   /* "View.MemoryView":1179
16883  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
16884  *     "Return the size of the memory occupied by the slice in number of bytes"
16885  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
16886  *
16887  *     for shape in src.shape[:ndim]:
16888  */
16889   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16890   __pyx_v_size = __pyx_t_1;
16891 
16892   /* "View.MemoryView":1181
16893  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
16894  *
16895  *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
16896  *         size *= shape
16897  *
16898  */
16899   __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16900   for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16901     __pyx_t_2 = __pyx_t_4;
16902     __pyx_v_shape = (__pyx_t_2[0]);
16903 
16904     /* "View.MemoryView":1182
16905  *
16906  *     for shape in src.shape[:ndim]:
16907  *         size *= shape             # <<<<<<<<<<<<<<
16908  *
16909  *     return size
16910  */
16911     __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16912   }
16913 
16914   /* "View.MemoryView":1184
16915  *         size *= shape
16916  *
16917  *     return size             # <<<<<<<<<<<<<<
16918  *
16919  * @cname('__pyx_fill_contig_strides_array')
16920  */
16921   __pyx_r = __pyx_v_size;
16922   goto __pyx_L0;
16923 
16924   /* "View.MemoryView":1177
16925  *
16926  * @cname('__pyx_memoryview_slice_get_size')
16927  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
16928  *     "Return the size of the memory occupied by the slice in number of bytes"
16929  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
16930  */
16931 
16932   /* function exit code */
16933   __pyx_L0:;
16934   return __pyx_r;
16935 }
16936 
16937 /* "View.MemoryView":1187
16938  *
16939  * @cname('__pyx_fill_contig_strides_array')
16940  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
16941  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16942  *                 int ndim, char order) nogil:
16943  */
16944 
__pyx_fill_contig_strides_array(Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,Py_ssize_t __pyx_v_stride,int __pyx_v_ndim,char __pyx_v_order)16945 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16946   int __pyx_v_idx;
16947   Py_ssize_t __pyx_r;
16948   int __pyx_t_1;
16949   int __pyx_t_2;
16950   int __pyx_t_3;
16951   int __pyx_t_4;
16952 
16953   /* "View.MemoryView":1196
16954  *     cdef int idx
16955  *
16956  *     if order == 'F':             # <<<<<<<<<<<<<<
16957  *         for idx in range(ndim):
16958  *             strides[idx] = stride
16959  */
16960   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
16961   if (__pyx_t_1) {
16962 
16963     /* "View.MemoryView":1197
16964  *
16965  *     if order == 'F':
16966  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
16967  *             strides[idx] = stride
16968  *             stride *= shape[idx]
16969  */
16970     __pyx_t_2 = __pyx_v_ndim;
16971     __pyx_t_3 = __pyx_t_2;
16972     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16973       __pyx_v_idx = __pyx_t_4;
16974 
16975       /* "View.MemoryView":1198
16976  *     if order == 'F':
16977  *         for idx in range(ndim):
16978  *             strides[idx] = stride             # <<<<<<<<<<<<<<
16979  *             stride *= shape[idx]
16980  *     else:
16981  */
16982       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16983 
16984       /* "View.MemoryView":1199
16985  *         for idx in range(ndim):
16986  *             strides[idx] = stride
16987  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
16988  *     else:
16989  *         for idx in range(ndim - 1, -1, -1):
16990  */
16991       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16992     }
16993 
16994     /* "View.MemoryView":1196
16995  *     cdef int idx
16996  *
16997  *     if order == 'F':             # <<<<<<<<<<<<<<
16998  *         for idx in range(ndim):
16999  *             strides[idx] = stride
17000  */
17001     goto __pyx_L3;
17002   }
17003 
17004   /* "View.MemoryView":1201
17005  *             stride *= shape[idx]
17006  *     else:
17007  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
17008  *             strides[idx] = stride
17009  *             stride *= shape[idx]
17010  */
17011   /*else*/ {
17012     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17013       __pyx_v_idx = __pyx_t_2;
17014 
17015       /* "View.MemoryView":1202
17016  *     else:
17017  *         for idx in range(ndim - 1, -1, -1):
17018  *             strides[idx] = stride             # <<<<<<<<<<<<<<
17019  *             stride *= shape[idx]
17020  *
17021  */
17022       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17023 
17024       /* "View.MemoryView":1203
17025  *         for idx in range(ndim - 1, -1, -1):
17026  *             strides[idx] = stride
17027  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
17028  *
17029  *     return stride
17030  */
17031       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17032     }
17033   }
17034   __pyx_L3:;
17035 
17036   /* "View.MemoryView":1205
17037  *             stride *= shape[idx]
17038  *
17039  *     return stride             # <<<<<<<<<<<<<<
17040  *
17041  * @cname('__pyx_memoryview_copy_data_to_temp')
17042  */
17043   __pyx_r = __pyx_v_stride;
17044   goto __pyx_L0;
17045 
17046   /* "View.MemoryView":1187
17047  *
17048  * @cname('__pyx_fill_contig_strides_array')
17049  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
17050  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17051  *                 int ndim, char order) nogil:
17052  */
17053 
17054   /* function exit code */
17055   __pyx_L0:;
17056   return __pyx_r;
17057 }
17058 
17059 /* "View.MemoryView":1208
17060  *
17061  * @cname('__pyx_memoryview_copy_data_to_temp')
17062  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
17063  *                              __Pyx_memviewslice *tmpslice,
17064  *                              char order,
17065  */
17066 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)17067 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17068   int __pyx_v_i;
17069   void *__pyx_v_result;
17070   size_t __pyx_v_itemsize;
17071   size_t __pyx_v_size;
17072   void *__pyx_r;
17073   Py_ssize_t __pyx_t_1;
17074   int __pyx_t_2;
17075   int __pyx_t_3;
17076   struct __pyx_memoryview_obj *__pyx_t_4;
17077   int __pyx_t_5;
17078   int __pyx_t_6;
17079   int __pyx_lineno = 0;
17080   const char *__pyx_filename = NULL;
17081   int __pyx_clineno = 0;
17082 
17083   /* "View.MemoryView":1219
17084  *     cdef void *result
17085  *
17086  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
17087  *     cdef size_t size = slice_get_size(src, ndim)
17088  *
17089  */
17090   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17091   __pyx_v_itemsize = __pyx_t_1;
17092 
17093   /* "View.MemoryView":1220
17094  *
17095  *     cdef size_t itemsize = src.memview.view.itemsize
17096  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
17097  *
17098  *     result = malloc(size)
17099  */
17100   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17101 
17102   /* "View.MemoryView":1222
17103  *     cdef size_t size = slice_get_size(src, ndim)
17104  *
17105  *     result = malloc(size)             # <<<<<<<<<<<<<<
17106  *     if not result:
17107  *         _err(MemoryError, NULL)
17108  */
17109   __pyx_v_result = malloc(__pyx_v_size);
17110 
17111   /* "View.MemoryView":1223
17112  *
17113  *     result = malloc(size)
17114  *     if not result:             # <<<<<<<<<<<<<<
17115  *         _err(MemoryError, NULL)
17116  *
17117  */
17118   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
17119   if (__pyx_t_2) {
17120 
17121     /* "View.MemoryView":1224
17122  *     result = malloc(size)
17123  *     if not result:
17124  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
17125  *
17126  *
17127  */
17128     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
17129 
17130     /* "View.MemoryView":1223
17131  *
17132  *     result = malloc(size)
17133  *     if not result:             # <<<<<<<<<<<<<<
17134  *         _err(MemoryError, NULL)
17135  *
17136  */
17137   }
17138 
17139   /* "View.MemoryView":1227
17140  *
17141  *
17142  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
17143  *     tmpslice.memview = src.memview
17144  *     for i in range(ndim):
17145  */
17146   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17147 
17148   /* "View.MemoryView":1228
17149  *
17150  *     tmpslice.data = <char *> result
17151  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
17152  *     for i in range(ndim):
17153  *         tmpslice.shape[i] = src.shape[i]
17154  */
17155   __pyx_t_4 = __pyx_v_src->memview;
17156   __pyx_v_tmpslice->memview = __pyx_t_4;
17157 
17158   /* "View.MemoryView":1229
17159  *     tmpslice.data = <char *> result
17160  *     tmpslice.memview = src.memview
17161  *     for i in range(ndim):             # <<<<<<<<<<<<<<
17162  *         tmpslice.shape[i] = src.shape[i]
17163  *         tmpslice.suboffsets[i] = -1
17164  */
17165   __pyx_t_3 = __pyx_v_ndim;
17166   __pyx_t_5 = __pyx_t_3;
17167   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17168     __pyx_v_i = __pyx_t_6;
17169 
17170     /* "View.MemoryView":1230
17171  *     tmpslice.memview = src.memview
17172  *     for i in range(ndim):
17173  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
17174  *         tmpslice.suboffsets[i] = -1
17175  *
17176  */
17177     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17178 
17179     /* "View.MemoryView":1231
17180  *     for i in range(ndim):
17181  *         tmpslice.shape[i] = src.shape[i]
17182  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
17183  *
17184  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
17185  */
17186     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17187   }
17188 
17189   /* "View.MemoryView":1233
17190  *         tmpslice.suboffsets[i] = -1
17191  *
17192  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
17193  *                               ndim, order)
17194  *
17195  */
17196   (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
17197 
17198   /* "View.MemoryView":1237
17199  *
17200  *
17201  *     for i in range(ndim):             # <<<<<<<<<<<<<<
17202  *         if tmpslice.shape[i] == 1:
17203  *             tmpslice.strides[i] = 0
17204  */
17205   __pyx_t_3 = __pyx_v_ndim;
17206   __pyx_t_5 = __pyx_t_3;
17207   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17208     __pyx_v_i = __pyx_t_6;
17209 
17210     /* "View.MemoryView":1238
17211  *
17212  *     for i in range(ndim):
17213  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
17214  *             tmpslice.strides[i] = 0
17215  *
17216  */
17217     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
17218     if (__pyx_t_2) {
17219 
17220       /* "View.MemoryView":1239
17221  *     for i in range(ndim):
17222  *         if tmpslice.shape[i] == 1:
17223  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
17224  *
17225  *     if slice_is_contig(src[0], order, ndim):
17226  */
17227       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17228 
17229       /* "View.MemoryView":1238
17230  *
17231  *     for i in range(ndim):
17232  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
17233  *             tmpslice.strides[i] = 0
17234  *
17235  */
17236     }
17237   }
17238 
17239   /* "View.MemoryView":1241
17240  *             tmpslice.strides[i] = 0
17241  *
17242  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
17243  *         memcpy(result, src.data, size)
17244  *     else:
17245  */
17246   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
17247   if (__pyx_t_2) {
17248 
17249     /* "View.MemoryView":1242
17250  *
17251  *     if slice_is_contig(src[0], order, ndim):
17252  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
17253  *     else:
17254  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17255  */
17256     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17257 
17258     /* "View.MemoryView":1241
17259  *             tmpslice.strides[i] = 0
17260  *
17261  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
17262  *         memcpy(result, src.data, size)
17263  *     else:
17264  */
17265     goto __pyx_L9;
17266   }
17267 
17268   /* "View.MemoryView":1244
17269  *         memcpy(result, src.data, size)
17270  *     else:
17271  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
17272  *
17273  *     return result
17274  */
17275   /*else*/ {
17276     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17277   }
17278   __pyx_L9:;
17279 
17280   /* "View.MemoryView":1246
17281  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17282  *
17283  *     return result             # <<<<<<<<<<<<<<
17284  *
17285  *
17286  */
17287   __pyx_r = __pyx_v_result;
17288   goto __pyx_L0;
17289 
17290   /* "View.MemoryView":1208
17291  *
17292  * @cname('__pyx_memoryview_copy_data_to_temp')
17293  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
17294  *                              __Pyx_memviewslice *tmpslice,
17295  *                              char order,
17296  */
17297 
17298   /* function exit code */
17299   __pyx_L1_error:;
17300   {
17301     #ifdef WITH_THREAD
17302     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17303     #endif
17304     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17305     #ifdef WITH_THREAD
17306     __Pyx_PyGILState_Release(__pyx_gilstate_save);
17307     #endif
17308   }
17309   __pyx_r = NULL;
17310   __pyx_L0:;
17311   return __pyx_r;
17312 }
17313 
17314 /* "View.MemoryView":1251
17315  *
17316  * @cname('__pyx_memoryview_err_extents')
17317  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
17318  *                              Py_ssize_t extent2) except -1 with gil:
17319  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17320  */
17321 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)17322 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17323   int __pyx_r;
17324   __Pyx_RefNannyDeclarations
17325   PyObject *__pyx_t_1 = NULL;
17326   PyObject *__pyx_t_2 = NULL;
17327   PyObject *__pyx_t_3 = NULL;
17328   PyObject *__pyx_t_4 = NULL;
17329   int __pyx_lineno = 0;
17330   const char *__pyx_filename = NULL;
17331   int __pyx_clineno = 0;
17332   #ifdef WITH_THREAD
17333   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17334   #endif
17335   __Pyx_RefNannySetupContext("_err_extents", 0);
17336 
17337   /* "View.MemoryView":1254
17338  *                              Py_ssize_t extent2) except -1 with gil:
17339  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17340  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
17341  *
17342  * @cname('__pyx_memoryview_err_dim')
17343  */
17344   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
17345   __Pyx_GOTREF(__pyx_t_1);
17346   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
17347   __Pyx_GOTREF(__pyx_t_2);
17348   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
17349   __Pyx_GOTREF(__pyx_t_3);
17350   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
17351   __Pyx_GOTREF(__pyx_t_4);
17352   __Pyx_GIVEREF(__pyx_t_1);
17353   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
17354   __Pyx_GIVEREF(__pyx_t_2);
17355   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
17356   __Pyx_GIVEREF(__pyx_t_3);
17357   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
17358   __pyx_t_1 = 0;
17359   __pyx_t_2 = 0;
17360   __pyx_t_3 = 0;
17361 
17362   /* "View.MemoryView":1253
17363  * cdef int _err_extents(int i, Py_ssize_t extent1,
17364  *                              Py_ssize_t extent2) except -1 with gil:
17365  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
17366  *                                                         (i, extent1, extent2))
17367  *
17368  */
17369   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
17370   __Pyx_GOTREF(__pyx_t_3);
17371   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17372   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
17373   __Pyx_GOTREF(__pyx_t_4);
17374   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17375   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
17376   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17377   __PYX_ERR(2, 1253, __pyx_L1_error)
17378 
17379   /* "View.MemoryView":1251
17380  *
17381  * @cname('__pyx_memoryview_err_extents')
17382  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
17383  *                              Py_ssize_t extent2) except -1 with gil:
17384  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17385  */
17386 
17387   /* function exit code */
17388   __pyx_L1_error:;
17389   __Pyx_XDECREF(__pyx_t_1);
17390   __Pyx_XDECREF(__pyx_t_2);
17391   __Pyx_XDECREF(__pyx_t_3);
17392   __Pyx_XDECREF(__pyx_t_4);
17393   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17394   __pyx_r = -1;
17395   __Pyx_RefNannyFinishContext();
17396   #ifdef WITH_THREAD
17397   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17398   #endif
17399   return __pyx_r;
17400 }
17401 
17402 /* "View.MemoryView":1257
17403  *
17404  * @cname('__pyx_memoryview_err_dim')
17405  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
17406  *     raise error(msg.decode('ascii') % dim)
17407  *
17408  */
17409 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)17410 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
17411   int __pyx_r;
17412   __Pyx_RefNannyDeclarations
17413   PyObject *__pyx_t_1 = NULL;
17414   PyObject *__pyx_t_2 = NULL;
17415   PyObject *__pyx_t_3 = NULL;
17416   PyObject *__pyx_t_4 = NULL;
17417   int __pyx_lineno = 0;
17418   const char *__pyx_filename = NULL;
17419   int __pyx_clineno = 0;
17420   #ifdef WITH_THREAD
17421   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17422   #endif
17423   __Pyx_RefNannySetupContext("_err_dim", 0);
17424   __Pyx_INCREF(__pyx_v_error);
17425 
17426   /* "View.MemoryView":1258
17427  * @cname('__pyx_memoryview_err_dim')
17428  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
17429  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
17430  *
17431  * @cname('__pyx_memoryview_err')
17432  */
17433   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1258, __pyx_L1_error)
17434   __Pyx_GOTREF(__pyx_t_2);
17435   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
17436   __Pyx_GOTREF(__pyx_t_3);
17437   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
17438   __Pyx_GOTREF(__pyx_t_4);
17439   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17440   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17441   __Pyx_INCREF(__pyx_v_error);
17442   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
17443   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17444     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
17445     if (likely(__pyx_t_2)) {
17446       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17447       __Pyx_INCREF(__pyx_t_2);
17448       __Pyx_INCREF(function);
17449       __Pyx_DECREF_SET(__pyx_t_3, function);
17450     }
17451   }
17452   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
17453   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17454   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17455   if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
17456   __Pyx_GOTREF(__pyx_t_1);
17457   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17458   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17459   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17460   __PYX_ERR(2, 1258, __pyx_L1_error)
17461 
17462   /* "View.MemoryView":1257
17463  *
17464  * @cname('__pyx_memoryview_err_dim')
17465  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
17466  *     raise error(msg.decode('ascii') % dim)
17467  *
17468  */
17469 
17470   /* function exit code */
17471   __pyx_L1_error:;
17472   __Pyx_XDECREF(__pyx_t_1);
17473   __Pyx_XDECREF(__pyx_t_2);
17474   __Pyx_XDECREF(__pyx_t_3);
17475   __Pyx_XDECREF(__pyx_t_4);
17476   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17477   __pyx_r = -1;
17478   __Pyx_XDECREF(__pyx_v_error);
17479   __Pyx_RefNannyFinishContext();
17480   #ifdef WITH_THREAD
17481   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17482   #endif
17483   return __pyx_r;
17484 }
17485 
17486 /* "View.MemoryView":1261
17487  *
17488  * @cname('__pyx_memoryview_err')
17489  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
17490  *     if msg != NULL:
17491  *         raise error(msg.decode('ascii'))
17492  */
17493 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)17494 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
17495   int __pyx_r;
17496   __Pyx_RefNannyDeclarations
17497   int __pyx_t_1;
17498   PyObject *__pyx_t_2 = NULL;
17499   PyObject *__pyx_t_3 = NULL;
17500   PyObject *__pyx_t_4 = NULL;
17501   PyObject *__pyx_t_5 = NULL;
17502   int __pyx_lineno = 0;
17503   const char *__pyx_filename = NULL;
17504   int __pyx_clineno = 0;
17505   #ifdef WITH_THREAD
17506   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17507   #endif
17508   __Pyx_RefNannySetupContext("_err", 0);
17509   __Pyx_INCREF(__pyx_v_error);
17510 
17511   /* "View.MemoryView":1262
17512  * @cname('__pyx_memoryview_err')
17513  * cdef int _err(object error, char *msg) except -1 with gil:
17514  *     if msg != NULL:             # <<<<<<<<<<<<<<
17515  *         raise error(msg.decode('ascii'))
17516  *     else:
17517  */
17518   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
17519   if (unlikely(__pyx_t_1)) {
17520 
17521     /* "View.MemoryView":1263
17522  * cdef int _err(object error, char *msg) except -1 with gil:
17523  *     if msg != NULL:
17524  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
17525  *     else:
17526  *         raise error
17527  */
17528     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1263, __pyx_L1_error)
17529     __Pyx_GOTREF(__pyx_t_3);
17530     __Pyx_INCREF(__pyx_v_error);
17531     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
17532     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
17533       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
17534       if (likely(__pyx_t_5)) {
17535         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
17536         __Pyx_INCREF(__pyx_t_5);
17537         __Pyx_INCREF(function);
17538         __Pyx_DECREF_SET(__pyx_t_4, function);
17539       }
17540     }
17541     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
17542     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17543     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17544     if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
17545     __Pyx_GOTREF(__pyx_t_2);
17546     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17547     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17548     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17549     __PYX_ERR(2, 1263, __pyx_L1_error)
17550 
17551     /* "View.MemoryView":1262
17552  * @cname('__pyx_memoryview_err')
17553  * cdef int _err(object error, char *msg) except -1 with gil:
17554  *     if msg != NULL:             # <<<<<<<<<<<<<<
17555  *         raise error(msg.decode('ascii'))
17556  *     else:
17557  */
17558   }
17559 
17560   /* "View.MemoryView":1265
17561  *         raise error(msg.decode('ascii'))
17562  *     else:
17563  *         raise error             # <<<<<<<<<<<<<<
17564  *
17565  * @cname('__pyx_memoryview_copy_contents')
17566  */
17567   /*else*/ {
17568     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
17569     __PYX_ERR(2, 1265, __pyx_L1_error)
17570   }
17571 
17572   /* "View.MemoryView":1261
17573  *
17574  * @cname('__pyx_memoryview_err')
17575  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
17576  *     if msg != NULL:
17577  *         raise error(msg.decode('ascii'))
17578  */
17579 
17580   /* function exit code */
17581   __pyx_L1_error:;
17582   __Pyx_XDECREF(__pyx_t_2);
17583   __Pyx_XDECREF(__pyx_t_3);
17584   __Pyx_XDECREF(__pyx_t_4);
17585   __Pyx_XDECREF(__pyx_t_5);
17586   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17587   __pyx_r = -1;
17588   __Pyx_XDECREF(__pyx_v_error);
17589   __Pyx_RefNannyFinishContext();
17590   #ifdef WITH_THREAD
17591   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17592   #endif
17593   return __pyx_r;
17594 }
17595 
17596 /* "View.MemoryView":1268
17597  *
17598  * @cname('__pyx_memoryview_copy_contents')
17599  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
17600  *                                   __Pyx_memviewslice dst,
17601  *                                   int src_ndim, int dst_ndim,
17602  */
17603 
__pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src,__Pyx_memviewslice __pyx_v_dst,int __pyx_v_src_ndim,int __pyx_v_dst_ndim,int __pyx_v_dtype_is_object)17604 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17605   void *__pyx_v_tmpdata;
17606   size_t __pyx_v_itemsize;
17607   int __pyx_v_i;
17608   char __pyx_v_order;
17609   int __pyx_v_broadcasting;
17610   int __pyx_v_direct_copy;
17611   __Pyx_memviewslice __pyx_v_tmp;
17612   int __pyx_v_ndim;
17613   int __pyx_r;
17614   Py_ssize_t __pyx_t_1;
17615   int __pyx_t_2;
17616   int __pyx_t_3;
17617   int __pyx_t_4;
17618   int __pyx_t_5;
17619   int __pyx_t_6;
17620   void *__pyx_t_7;
17621   int __pyx_t_8;
17622   int __pyx_lineno = 0;
17623   const char *__pyx_filename = NULL;
17624   int __pyx_clineno = 0;
17625 
17626   /* "View.MemoryView":1276
17627  *     Check for overlapping memory and verify the shapes.
17628  *     """
17629  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
17630  *     cdef size_t itemsize = src.memview.view.itemsize
17631  *     cdef int i
17632  */
17633   __pyx_v_tmpdata = NULL;
17634 
17635   /* "View.MemoryView":1277
17636  *     """
17637  *     cdef void *tmpdata = NULL
17638  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
17639  *     cdef int i
17640  *     cdef char order = get_best_order(&src, src_ndim)
17641  */
17642   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17643   __pyx_v_itemsize = __pyx_t_1;
17644 
17645   /* "View.MemoryView":1279
17646  *     cdef size_t itemsize = src.memview.view.itemsize
17647  *     cdef int i
17648  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
17649  *     cdef bint broadcasting = False
17650  *     cdef bint direct_copy = False
17651  */
17652   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17653 
17654   /* "View.MemoryView":1280
17655  *     cdef int i
17656  *     cdef char order = get_best_order(&src, src_ndim)
17657  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
17658  *     cdef bint direct_copy = False
17659  *     cdef __Pyx_memviewslice tmp
17660  */
17661   __pyx_v_broadcasting = 0;
17662 
17663   /* "View.MemoryView":1281
17664  *     cdef char order = get_best_order(&src, src_ndim)
17665  *     cdef bint broadcasting = False
17666  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
17667  *     cdef __Pyx_memviewslice tmp
17668  *
17669  */
17670   __pyx_v_direct_copy = 0;
17671 
17672   /* "View.MemoryView":1284
17673  *     cdef __Pyx_memviewslice tmp
17674  *
17675  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
17676  *         broadcast_leading(&src, src_ndim, dst_ndim)
17677  *     elif dst_ndim < src_ndim:
17678  */
17679   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
17680   if (__pyx_t_2) {
17681 
17682     /* "View.MemoryView":1285
17683  *
17684  *     if src_ndim < dst_ndim:
17685  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
17686  *     elif dst_ndim < src_ndim:
17687  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17688  */
17689     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17690 
17691     /* "View.MemoryView":1284
17692  *     cdef __Pyx_memviewslice tmp
17693  *
17694  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
17695  *         broadcast_leading(&src, src_ndim, dst_ndim)
17696  *     elif dst_ndim < src_ndim:
17697  */
17698     goto __pyx_L3;
17699   }
17700 
17701   /* "View.MemoryView":1286
17702  *     if src_ndim < dst_ndim:
17703  *         broadcast_leading(&src, src_ndim, dst_ndim)
17704  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
17705  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17706  *
17707  */
17708   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
17709   if (__pyx_t_2) {
17710 
17711     /* "View.MemoryView":1287
17712  *         broadcast_leading(&src, src_ndim, dst_ndim)
17713  *     elif dst_ndim < src_ndim:
17714  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
17715  *
17716  *     cdef int ndim = max(src_ndim, dst_ndim)
17717  */
17718     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17719 
17720     /* "View.MemoryView":1286
17721  *     if src_ndim < dst_ndim:
17722  *         broadcast_leading(&src, src_ndim, dst_ndim)
17723  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
17724  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17725  *
17726  */
17727   }
17728   __pyx_L3:;
17729 
17730   /* "View.MemoryView":1289
17731  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17732  *
17733  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
17734  *
17735  *     for i in range(ndim):
17736  */
17737   __pyx_t_3 = __pyx_v_dst_ndim;
17738   __pyx_t_4 = __pyx_v_src_ndim;
17739   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
17740     __pyx_t_5 = __pyx_t_3;
17741   } else {
17742     __pyx_t_5 = __pyx_t_4;
17743   }
17744   __pyx_v_ndim = __pyx_t_5;
17745 
17746   /* "View.MemoryView":1291
17747  *     cdef int ndim = max(src_ndim, dst_ndim)
17748  *
17749  *     for i in range(ndim):             # <<<<<<<<<<<<<<
17750  *         if src.shape[i] != dst.shape[i]:
17751  *             if src.shape[i] == 1:
17752  */
17753   __pyx_t_5 = __pyx_v_ndim;
17754   __pyx_t_3 = __pyx_t_5;
17755   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17756     __pyx_v_i = __pyx_t_4;
17757 
17758     /* "View.MemoryView":1292
17759  *
17760  *     for i in range(ndim):
17761  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
17762  *             if src.shape[i] == 1:
17763  *                 broadcasting = True
17764  */
17765     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
17766     if (__pyx_t_2) {
17767 
17768       /* "View.MemoryView":1293
17769  *     for i in range(ndim):
17770  *         if src.shape[i] != dst.shape[i]:
17771  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
17772  *                 broadcasting = True
17773  *                 src.strides[i] = 0
17774  */
17775       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
17776       if (__pyx_t_2) {
17777 
17778         /* "View.MemoryView":1294
17779  *         if src.shape[i] != dst.shape[i]:
17780  *             if src.shape[i] == 1:
17781  *                 broadcasting = True             # <<<<<<<<<<<<<<
17782  *                 src.strides[i] = 0
17783  *             else:
17784  */
17785         __pyx_v_broadcasting = 1;
17786 
17787         /* "View.MemoryView":1295
17788  *             if src.shape[i] == 1:
17789  *                 broadcasting = True
17790  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
17791  *             else:
17792  *                 _err_extents(i, dst.shape[i], src.shape[i])
17793  */
17794         (__pyx_v_src.strides[__pyx_v_i]) = 0;
17795 
17796         /* "View.MemoryView":1293
17797  *     for i in range(ndim):
17798  *         if src.shape[i] != dst.shape[i]:
17799  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
17800  *                 broadcasting = True
17801  *                 src.strides[i] = 0
17802  */
17803         goto __pyx_L7;
17804       }
17805 
17806       /* "View.MemoryView":1297
17807  *                 src.strides[i] = 0
17808  *             else:
17809  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
17810  *
17811  *         if src.suboffsets[i] >= 0:
17812  */
17813       /*else*/ {
17814         __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
17815       }
17816       __pyx_L7:;
17817 
17818       /* "View.MemoryView":1292
17819  *
17820  *     for i in range(ndim):
17821  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
17822  *             if src.shape[i] == 1:
17823  *                 broadcasting = True
17824  */
17825     }
17826 
17827     /* "View.MemoryView":1299
17828  *                 _err_extents(i, dst.shape[i], src.shape[i])
17829  *
17830  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
17831  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17832  *
17833  */
17834     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
17835     if (__pyx_t_2) {
17836 
17837       /* "View.MemoryView":1300
17838  *
17839  *         if src.suboffsets[i] >= 0:
17840  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
17841  *
17842  *     if slices_overlap(&src, &dst, ndim, itemsize):
17843  */
17844       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error)
17845 
17846       /* "View.MemoryView":1299
17847  *                 _err_extents(i, dst.shape[i], src.shape[i])
17848  *
17849  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
17850  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17851  *
17852  */
17853     }
17854   }
17855 
17856   /* "View.MemoryView":1302
17857  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17858  *
17859  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
17860  *
17861  *         if not slice_is_contig(src, order, ndim):
17862  */
17863   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
17864   if (__pyx_t_2) {
17865 
17866     /* "View.MemoryView":1304
17867  *     if slices_overlap(&src, &dst, ndim, itemsize):
17868  *
17869  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
17870  *             order = get_best_order(&dst, ndim)
17871  *
17872  */
17873     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
17874     if (__pyx_t_2) {
17875 
17876       /* "View.MemoryView":1305
17877  *
17878  *         if not slice_is_contig(src, order, ndim):
17879  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
17880  *
17881  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17882  */
17883       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17884 
17885       /* "View.MemoryView":1304
17886  *     if slices_overlap(&src, &dst, ndim, itemsize):
17887  *
17888  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
17889  *             order = get_best_order(&dst, ndim)
17890  *
17891  */
17892     }
17893 
17894     /* "View.MemoryView":1307
17895  *             order = get_best_order(&dst, ndim)
17896  *
17897  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
17898  *         src = tmp
17899  *
17900  */
17901     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error)
17902     __pyx_v_tmpdata = __pyx_t_7;
17903 
17904     /* "View.MemoryView":1308
17905  *
17906  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17907  *         src = tmp             # <<<<<<<<<<<<<<
17908  *
17909  *     if not broadcasting:
17910  */
17911     __pyx_v_src = __pyx_v_tmp;
17912 
17913     /* "View.MemoryView":1302
17914  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17915  *
17916  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
17917  *
17918  *         if not slice_is_contig(src, order, ndim):
17919  */
17920   }
17921 
17922   /* "View.MemoryView":1310
17923  *         src = tmp
17924  *
17925  *     if not broadcasting:             # <<<<<<<<<<<<<<
17926  *
17927  *
17928  */
17929   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
17930   if (__pyx_t_2) {
17931 
17932     /* "View.MemoryView":1313
17933  *
17934  *
17935  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
17936  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17937  *         elif slice_is_contig(src, 'F', ndim):
17938  */
17939     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
17940     if (__pyx_t_2) {
17941 
17942       /* "View.MemoryView":1314
17943  *
17944  *         if slice_is_contig(src, 'C', ndim):
17945  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
17946  *         elif slice_is_contig(src, 'F', ndim):
17947  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17948  */
17949       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17950 
17951       /* "View.MemoryView":1313
17952  *
17953  *
17954  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
17955  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17956  *         elif slice_is_contig(src, 'F', ndim):
17957  */
17958       goto __pyx_L12;
17959     }
17960 
17961     /* "View.MemoryView":1315
17962  *         if slice_is_contig(src, 'C', ndim):
17963  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17964  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
17965  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17966  *
17967  */
17968     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
17969     if (__pyx_t_2) {
17970 
17971       /* "View.MemoryView":1316
17972  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17973  *         elif slice_is_contig(src, 'F', ndim):
17974  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
17975  *
17976  *         if direct_copy:
17977  */
17978       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17979 
17980       /* "View.MemoryView":1315
17981  *         if slice_is_contig(src, 'C', ndim):
17982  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17983  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
17984  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17985  *
17986  */
17987     }
17988     __pyx_L12:;
17989 
17990     /* "View.MemoryView":1318
17991  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17992  *
17993  *         if direct_copy:             # <<<<<<<<<<<<<<
17994  *
17995  *             refcount_copying(&dst, dtype_is_object, ndim, False)
17996  */
17997     __pyx_t_2 = (__pyx_v_direct_copy != 0);
17998     if (__pyx_t_2) {
17999 
18000       /* "View.MemoryView":1320
18001  *         if direct_copy:
18002  *
18003  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
18004  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18005  *             refcount_copying(&dst, dtype_is_object, ndim, True)
18006  */
18007       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18008 
18009       /* "View.MemoryView":1321
18010  *
18011  *             refcount_copying(&dst, dtype_is_object, ndim, False)
18012  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
18013  *             refcount_copying(&dst, dtype_is_object, ndim, True)
18014  *             free(tmpdata)
18015  */
18016       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18017 
18018       /* "View.MemoryView":1322
18019  *             refcount_copying(&dst, dtype_is_object, ndim, False)
18020  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18021  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
18022  *             free(tmpdata)
18023  *             return 0
18024  */
18025       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18026 
18027       /* "View.MemoryView":1323
18028  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18029  *             refcount_copying(&dst, dtype_is_object, ndim, True)
18030  *             free(tmpdata)             # <<<<<<<<<<<<<<
18031  *             return 0
18032  *
18033  */
18034       free(__pyx_v_tmpdata);
18035 
18036       /* "View.MemoryView":1324
18037  *             refcount_copying(&dst, dtype_is_object, ndim, True)
18038  *             free(tmpdata)
18039  *             return 0             # <<<<<<<<<<<<<<
18040  *
18041  *     if order == 'F' == get_best_order(&dst, ndim):
18042  */
18043       __pyx_r = 0;
18044       goto __pyx_L0;
18045 
18046       /* "View.MemoryView":1318
18047  *             direct_copy = slice_is_contig(dst, 'F', ndim)
18048  *
18049  *         if direct_copy:             # <<<<<<<<<<<<<<
18050  *
18051  *             refcount_copying(&dst, dtype_is_object, ndim, False)
18052  */
18053     }
18054 
18055     /* "View.MemoryView":1310
18056  *         src = tmp
18057  *
18058  *     if not broadcasting:             # <<<<<<<<<<<<<<
18059  *
18060  *
18061  */
18062   }
18063 
18064   /* "View.MemoryView":1326
18065  *             return 0
18066  *
18067  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
18068  *
18069  *
18070  */
18071   __pyx_t_2 = (__pyx_v_order == 'F');
18072   if (__pyx_t_2) {
18073     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18074   }
18075   __pyx_t_8 = (__pyx_t_2 != 0);
18076   if (__pyx_t_8) {
18077 
18078     /* "View.MemoryView":1329
18079  *
18080  *
18081  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
18082  *         transpose_memslice(&dst)
18083  *
18084  */
18085     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
18086 
18087     /* "View.MemoryView":1330
18088  *
18089  *         transpose_memslice(&src)
18090  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
18091  *
18092  *     refcount_copying(&dst, dtype_is_object, ndim, False)
18093  */
18094     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
18095 
18096     /* "View.MemoryView":1326
18097  *             return 0
18098  *
18099  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
18100  *
18101  *
18102  */
18103   }
18104 
18105   /* "View.MemoryView":1332
18106  *         transpose_memslice(&dst)
18107  *
18108  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
18109  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
18110  *     refcount_copying(&dst, dtype_is_object, ndim, True)
18111  */
18112   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18113 
18114   /* "View.MemoryView":1333
18115  *
18116  *     refcount_copying(&dst, dtype_is_object, ndim, False)
18117  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
18118  *     refcount_copying(&dst, dtype_is_object, ndim, True)
18119  *
18120  */
18121   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18122 
18123   /* "View.MemoryView":1334
18124  *     refcount_copying(&dst, dtype_is_object, ndim, False)
18125  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
18126  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
18127  *
18128  *     free(tmpdata)
18129  */
18130   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18131 
18132   /* "View.MemoryView":1336
18133  *     refcount_copying(&dst, dtype_is_object, ndim, True)
18134  *
18135  *     free(tmpdata)             # <<<<<<<<<<<<<<
18136  *     return 0
18137  *
18138  */
18139   free(__pyx_v_tmpdata);
18140 
18141   /* "View.MemoryView":1337
18142  *
18143  *     free(tmpdata)
18144  *     return 0             # <<<<<<<<<<<<<<
18145  *
18146  * @cname('__pyx_memoryview_broadcast_leading')
18147  */
18148   __pyx_r = 0;
18149   goto __pyx_L0;
18150 
18151   /* "View.MemoryView":1268
18152  *
18153  * @cname('__pyx_memoryview_copy_contents')
18154  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
18155  *                                   __Pyx_memviewslice dst,
18156  *                                   int src_ndim, int dst_ndim,
18157  */
18158 
18159   /* function exit code */
18160   __pyx_L1_error:;
18161   {
18162     #ifdef WITH_THREAD
18163     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18164     #endif
18165     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18166     #ifdef WITH_THREAD
18167     __Pyx_PyGILState_Release(__pyx_gilstate_save);
18168     #endif
18169   }
18170   __pyx_r = -1;
18171   __pyx_L0:;
18172   return __pyx_r;
18173 }
18174 
18175 /* "View.MemoryView":1340
18176  *
18177  * @cname('__pyx_memoryview_broadcast_leading')
18178  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
18179  *                             int ndim,
18180  *                             int ndim_other) nogil:
18181  */
18182 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)18183 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18184   int __pyx_v_i;
18185   int __pyx_v_offset;
18186   int __pyx_t_1;
18187   int __pyx_t_2;
18188   int __pyx_t_3;
18189 
18190   /* "View.MemoryView":1344
18191  *                             int ndim_other) nogil:
18192  *     cdef int i
18193  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
18194  *
18195  *     for i in range(ndim - 1, -1, -1):
18196  */
18197   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18198 
18199   /* "View.MemoryView":1346
18200  *     cdef int offset = ndim_other - ndim
18201  *
18202  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
18203  *         mslice.shape[i + offset] = mslice.shape[i]
18204  *         mslice.strides[i + offset] = mslice.strides[i]
18205  */
18206   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18207     __pyx_v_i = __pyx_t_1;
18208 
18209     /* "View.MemoryView":1347
18210  *
18211  *     for i in range(ndim - 1, -1, -1):
18212  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
18213  *         mslice.strides[i + offset] = mslice.strides[i]
18214  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18215  */
18216     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18217 
18218     /* "View.MemoryView":1348
18219  *     for i in range(ndim - 1, -1, -1):
18220  *         mslice.shape[i + offset] = mslice.shape[i]
18221  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
18222  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18223  *
18224  */
18225     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18226 
18227     /* "View.MemoryView":1349
18228  *         mslice.shape[i + offset] = mslice.shape[i]
18229  *         mslice.strides[i + offset] = mslice.strides[i]
18230  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
18231  *
18232  *     for i in range(offset):
18233  */
18234     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18235   }
18236 
18237   /* "View.MemoryView":1351
18238  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18239  *
18240  *     for i in range(offset):             # <<<<<<<<<<<<<<
18241  *         mslice.shape[i] = 1
18242  *         mslice.strides[i] = mslice.strides[0]
18243  */
18244   __pyx_t_1 = __pyx_v_offset;
18245   __pyx_t_2 = __pyx_t_1;
18246   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18247     __pyx_v_i = __pyx_t_3;
18248 
18249     /* "View.MemoryView":1352
18250  *
18251  *     for i in range(offset):
18252  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
18253  *         mslice.strides[i] = mslice.strides[0]
18254  *         mslice.suboffsets[i] = -1
18255  */
18256     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18257 
18258     /* "View.MemoryView":1353
18259  *     for i in range(offset):
18260  *         mslice.shape[i] = 1
18261  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
18262  *         mslice.suboffsets[i] = -1
18263  *
18264  */
18265     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18266 
18267     /* "View.MemoryView":1354
18268  *         mslice.shape[i] = 1
18269  *         mslice.strides[i] = mslice.strides[0]
18270  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
18271  *
18272  *
18273  */
18274     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18275   }
18276 
18277   /* "View.MemoryView":1340
18278  *
18279  * @cname('__pyx_memoryview_broadcast_leading')
18280  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
18281  *                             int ndim,
18282  *                             int ndim_other) nogil:
18283  */
18284 
18285   /* function exit code */
18286 }
18287 
18288 /* "View.MemoryView":1362
18289  *
18290  * @cname('__pyx_memoryview_refcount_copying')
18291  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
18292  *                            int ndim, bint inc) nogil:
18293  *
18294  */
18295 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)18296 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18297   int __pyx_t_1;
18298 
18299   /* "View.MemoryView":1366
18300  *
18301  *
18302  *     if dtype_is_object:             # <<<<<<<<<<<<<<
18303  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
18304  *                                            dst.strides, ndim, inc)
18305  */
18306   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
18307   if (__pyx_t_1) {
18308 
18309     /* "View.MemoryView":1367
18310  *
18311  *     if dtype_is_object:
18312  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
18313  *                                            dst.strides, ndim, inc)
18314  *
18315  */
18316     __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18317 
18318     /* "View.MemoryView":1366
18319  *
18320  *
18321  *     if dtype_is_object:             # <<<<<<<<<<<<<<
18322  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
18323  *                                            dst.strides, ndim, inc)
18324  */
18325   }
18326 
18327   /* "View.MemoryView":1362
18328  *
18329  * @cname('__pyx_memoryview_refcount_copying')
18330  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
18331  *                            int ndim, bint inc) nogil:
18332  *
18333  */
18334 
18335   /* function exit code */
18336 }
18337 
18338 /* "View.MemoryView":1371
18339  *
18340  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18341  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18342  *                                              Py_ssize_t *strides, int ndim,
18343  *                                              bint inc) with gil:
18344  */
18345 
__pyx_memoryview_refcount_objects_in_slice_with_gil(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)18346 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18347   __Pyx_RefNannyDeclarations
18348   #ifdef WITH_THREAD
18349   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18350   #endif
18351   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
18352 
18353   /* "View.MemoryView":1374
18354  *                                              Py_ssize_t *strides, int ndim,
18355  *                                              bint inc) with gil:
18356  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
18357  *
18358  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18359  */
18360   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18361 
18362   /* "View.MemoryView":1371
18363  *
18364  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18365  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18366  *                                              Py_ssize_t *strides, int ndim,
18367  *                                              bint inc) with gil:
18368  */
18369 
18370   /* function exit code */
18371   __Pyx_RefNannyFinishContext();
18372   #ifdef WITH_THREAD
18373   __Pyx_PyGILState_Release(__pyx_gilstate_save);
18374   #endif
18375 }
18376 
18377 /* "View.MemoryView":1377
18378  *
18379  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18380  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18381  *                                     Py_ssize_t *strides, int ndim, bint inc):
18382  *     cdef Py_ssize_t i
18383  */
18384 
__pyx_memoryview_refcount_objects_in_slice(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)18385 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18386   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18387   __Pyx_RefNannyDeclarations
18388   Py_ssize_t __pyx_t_1;
18389   Py_ssize_t __pyx_t_2;
18390   Py_ssize_t __pyx_t_3;
18391   int __pyx_t_4;
18392   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
18393 
18394   /* "View.MemoryView":1381
18395  *     cdef Py_ssize_t i
18396  *
18397  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
18398  *         if ndim == 1:
18399  *             if inc:
18400  */
18401   __pyx_t_1 = (__pyx_v_shape[0]);
18402   __pyx_t_2 = __pyx_t_1;
18403   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18404     __pyx_v_i = __pyx_t_3;
18405 
18406     /* "View.MemoryView":1382
18407  *
18408  *     for i in range(shape[0]):
18409  *         if ndim == 1:             # <<<<<<<<<<<<<<
18410  *             if inc:
18411  *                 Py_INCREF((<PyObject **> data)[0])
18412  */
18413     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
18414     if (__pyx_t_4) {
18415 
18416       /* "View.MemoryView":1383
18417  *     for i in range(shape[0]):
18418  *         if ndim == 1:
18419  *             if inc:             # <<<<<<<<<<<<<<
18420  *                 Py_INCREF((<PyObject **> data)[0])
18421  *             else:
18422  */
18423       __pyx_t_4 = (__pyx_v_inc != 0);
18424       if (__pyx_t_4) {
18425 
18426         /* "View.MemoryView":1384
18427  *         if ndim == 1:
18428  *             if inc:
18429  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
18430  *             else:
18431  *                 Py_DECREF((<PyObject **> data)[0])
18432  */
18433         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18434 
18435         /* "View.MemoryView":1383
18436  *     for i in range(shape[0]):
18437  *         if ndim == 1:
18438  *             if inc:             # <<<<<<<<<<<<<<
18439  *                 Py_INCREF((<PyObject **> data)[0])
18440  *             else:
18441  */
18442         goto __pyx_L6;
18443       }
18444 
18445       /* "View.MemoryView":1386
18446  *                 Py_INCREF((<PyObject **> data)[0])
18447  *             else:
18448  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
18449  *         else:
18450  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
18451  */
18452       /*else*/ {
18453         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18454       }
18455       __pyx_L6:;
18456 
18457       /* "View.MemoryView":1382
18458  *
18459  *     for i in range(shape[0]):
18460  *         if ndim == 1:             # <<<<<<<<<<<<<<
18461  *             if inc:
18462  *                 Py_INCREF((<PyObject **> data)[0])
18463  */
18464       goto __pyx_L5;
18465     }
18466 
18467     /* "View.MemoryView":1388
18468  *                 Py_DECREF((<PyObject **> data)[0])
18469  *         else:
18470  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
18471  *                                       ndim - 1, inc)
18472  *
18473  */
18474     /*else*/ {
18475 
18476       /* "View.MemoryView":1389
18477  *         else:
18478  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
18479  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
18480  *
18481  *         data += strides[0]
18482  */
18483       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18484     }
18485     __pyx_L5:;
18486 
18487     /* "View.MemoryView":1391
18488  *                                       ndim - 1, inc)
18489  *
18490  *         data += strides[0]             # <<<<<<<<<<<<<<
18491  *
18492  *
18493  */
18494     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
18495   }
18496 
18497   /* "View.MemoryView":1377
18498  *
18499  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18500  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18501  *                                     Py_ssize_t *strides, int ndim, bint inc):
18502  *     cdef Py_ssize_t i
18503  */
18504 
18505   /* function exit code */
18506   __Pyx_RefNannyFinishContext();
18507 }
18508 
18509 /* "View.MemoryView":1397
18510  *
18511  * @cname('__pyx_memoryview_slice_assign_scalar')
18512  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
18513  *                               size_t itemsize, void *item,
18514  *                               bint dtype_is_object) nogil:
18515  */
18516 
__pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item,int __pyx_v_dtype_is_object)18517 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18518 
18519   /* "View.MemoryView":1400
18520  *                               size_t itemsize, void *item,
18521  *                               bint dtype_is_object) nogil:
18522  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
18523  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18524  *                          itemsize, item)
18525  */
18526   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18527 
18528   /* "View.MemoryView":1401
18529  *                               bint dtype_is_object) nogil:
18530  *     refcount_copying(dst, dtype_is_object, ndim, False)
18531  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
18532  *                          itemsize, item)
18533  *     refcount_copying(dst, dtype_is_object, ndim, True)
18534  */
18535   __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18536 
18537   /* "View.MemoryView":1403
18538  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18539  *                          itemsize, item)
18540  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
18541  *
18542  *
18543  */
18544   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18545 
18546   /* "View.MemoryView":1397
18547  *
18548  * @cname('__pyx_memoryview_slice_assign_scalar')
18549  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
18550  *                               size_t itemsize, void *item,
18551  *                               bint dtype_is_object) nogil:
18552  */
18553 
18554   /* function exit code */
18555 }
18556 
18557 /* "View.MemoryView":1407
18558  *
18559  * @cname('__pyx_memoryview__slice_assign_scalar')
18560  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18561  *                               Py_ssize_t *strides, int ndim,
18562  *                               size_t itemsize, void *item) nogil:
18563  */
18564 
__pyx_memoryview__slice_assign_scalar(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item)18565 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18566   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18567   Py_ssize_t __pyx_v_stride;
18568   Py_ssize_t __pyx_v_extent;
18569   int __pyx_t_1;
18570   Py_ssize_t __pyx_t_2;
18571   Py_ssize_t __pyx_t_3;
18572   Py_ssize_t __pyx_t_4;
18573 
18574   /* "View.MemoryView":1411
18575  *                               size_t itemsize, void *item) nogil:
18576  *     cdef Py_ssize_t i
18577  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
18578  *     cdef Py_ssize_t extent = shape[0]
18579  *
18580  */
18581   __pyx_v_stride = (__pyx_v_strides[0]);
18582 
18583   /* "View.MemoryView":1412
18584  *     cdef Py_ssize_t i
18585  *     cdef Py_ssize_t stride = strides[0]
18586  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
18587  *
18588  *     if ndim == 1:
18589  */
18590   __pyx_v_extent = (__pyx_v_shape[0]);
18591 
18592   /* "View.MemoryView":1414
18593  *     cdef Py_ssize_t extent = shape[0]
18594  *
18595  *     if ndim == 1:             # <<<<<<<<<<<<<<
18596  *         for i in range(extent):
18597  *             memcpy(data, item, itemsize)
18598  */
18599   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18600   if (__pyx_t_1) {
18601 
18602     /* "View.MemoryView":1415
18603  *
18604  *     if ndim == 1:
18605  *         for i in range(extent):             # <<<<<<<<<<<<<<
18606  *             memcpy(data, item, itemsize)
18607  *             data += stride
18608  */
18609     __pyx_t_2 = __pyx_v_extent;
18610     __pyx_t_3 = __pyx_t_2;
18611     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18612       __pyx_v_i = __pyx_t_4;
18613 
18614       /* "View.MemoryView":1416
18615  *     if ndim == 1:
18616  *         for i in range(extent):
18617  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
18618  *             data += stride
18619  *     else:
18620  */
18621       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18622 
18623       /* "View.MemoryView":1417
18624  *         for i in range(extent):
18625  *             memcpy(data, item, itemsize)
18626  *             data += stride             # <<<<<<<<<<<<<<
18627  *     else:
18628  *         for i in range(extent):
18629  */
18630       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18631     }
18632 
18633     /* "View.MemoryView":1414
18634  *     cdef Py_ssize_t extent = shape[0]
18635  *
18636  *     if ndim == 1:             # <<<<<<<<<<<<<<
18637  *         for i in range(extent):
18638  *             memcpy(data, item, itemsize)
18639  */
18640     goto __pyx_L3;
18641   }
18642 
18643   /* "View.MemoryView":1419
18644  *             data += stride
18645  *     else:
18646  *         for i in range(extent):             # <<<<<<<<<<<<<<
18647  *             _slice_assign_scalar(data, shape + 1, strides + 1,
18648  *                                 ndim - 1, itemsize, item)
18649  */
18650   /*else*/ {
18651     __pyx_t_2 = __pyx_v_extent;
18652     __pyx_t_3 = __pyx_t_2;
18653     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18654       __pyx_v_i = __pyx_t_4;
18655 
18656       /* "View.MemoryView":1420
18657  *     else:
18658  *         for i in range(extent):
18659  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
18660  *                                 ndim - 1, itemsize, item)
18661  *             data += stride
18662  */
18663       __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18664 
18665       /* "View.MemoryView":1422
18666  *             _slice_assign_scalar(data, shape + 1, strides + 1,
18667  *                                 ndim - 1, itemsize, item)
18668  *             data += stride             # <<<<<<<<<<<<<<
18669  *
18670  *
18671  */
18672       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18673     }
18674   }
18675   __pyx_L3:;
18676 
18677   /* "View.MemoryView":1407
18678  *
18679  * @cname('__pyx_memoryview__slice_assign_scalar')
18680  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18681  *                               Py_ssize_t *strides, int ndim,
18682  *                               size_t itemsize, void *item) nogil:
18683  */
18684 
18685   /* function exit code */
18686 }
18687 
18688 /* "(tree fragment)":1
18689  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18690  *     cdef object __pyx_PickleError
18691  *     cdef object __pyx_result
18692  */
18693 
18694 /* Python wrapper */
18695 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18696 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)18697 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18698   PyObject *__pyx_v___pyx_type = 0;
18699   long __pyx_v___pyx_checksum;
18700   PyObject *__pyx_v___pyx_state = 0;
18701   int __pyx_lineno = 0;
18702   const char *__pyx_filename = NULL;
18703   int __pyx_clineno = 0;
18704   PyObject *__pyx_r = 0;
18705   __Pyx_RefNannyDeclarations
18706   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18707   {
18708     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18709     PyObject* values[3] = {0,0,0};
18710     if (unlikely(__pyx_kwds)) {
18711       Py_ssize_t kw_args;
18712       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18713       switch (pos_args) {
18714         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18715         CYTHON_FALLTHROUGH;
18716         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18717         CYTHON_FALLTHROUGH;
18718         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18719         CYTHON_FALLTHROUGH;
18720         case  0: break;
18721         default: goto __pyx_L5_argtuple_error;
18722       }
18723       kw_args = PyDict_Size(__pyx_kwds);
18724       switch (pos_args) {
18725         case  0:
18726         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
18727         else goto __pyx_L5_argtuple_error;
18728         CYTHON_FALLTHROUGH;
18729         case  1:
18730         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
18731         else {
18732           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
18733         }
18734         CYTHON_FALLTHROUGH;
18735         case  2:
18736         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
18737         else {
18738           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
18739         }
18740       }
18741       if (unlikely(kw_args > 0)) {
18742         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
18743       }
18744     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18745       goto __pyx_L5_argtuple_error;
18746     } else {
18747       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18748       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18749       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18750     }
18751     __pyx_v___pyx_type = values[0];
18752     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
18753     __pyx_v___pyx_state = values[2];
18754   }
18755   goto __pyx_L4_argument_unpacking_done;
18756   __pyx_L5_argtuple_error:;
18757   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
18758   __pyx_L3_error:;
18759   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18760   __Pyx_RefNannyFinishContext();
18761   return NULL;
18762   __pyx_L4_argument_unpacking_done:;
18763   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18764 
18765   /* function exit code */
18766   __Pyx_RefNannyFinishContext();
18767   return __pyx_r;
18768 }
18769 
__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)18770 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18771   PyObject *__pyx_v___pyx_PickleError = 0;
18772   PyObject *__pyx_v___pyx_result = 0;
18773   PyObject *__pyx_r = NULL;
18774   __Pyx_RefNannyDeclarations
18775   int __pyx_t_1;
18776   PyObject *__pyx_t_2 = NULL;
18777   PyObject *__pyx_t_3 = NULL;
18778   PyObject *__pyx_t_4 = NULL;
18779   PyObject *__pyx_t_5 = NULL;
18780   int __pyx_t_6;
18781   int __pyx_lineno = 0;
18782   const char *__pyx_filename = NULL;
18783   int __pyx_clineno = 0;
18784   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18785 
18786   /* "(tree fragment)":4
18787  *     cdef object __pyx_PickleError
18788  *     cdef object __pyx_result
18789  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
18790  *         from pickle import PickleError as __pyx_PickleError
18791  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18792  */
18793   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
18794   if (__pyx_t_1) {
18795 
18796     /* "(tree fragment)":5
18797  *     cdef object __pyx_result
18798  *     if __pyx_checksum != 0xb068931:
18799  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
18800  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18801  *     __pyx_result = Enum.__new__(__pyx_type)
18802  */
18803     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
18804     __Pyx_GOTREF(__pyx_t_2);
18805     __Pyx_INCREF(__pyx_n_s_PickleError);
18806     __Pyx_GIVEREF(__pyx_n_s_PickleError);
18807     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
18808     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
18809     __Pyx_GOTREF(__pyx_t_3);
18810     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18811     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
18812     __Pyx_GOTREF(__pyx_t_2);
18813     __Pyx_INCREF(__pyx_t_2);
18814     __pyx_v___pyx_PickleError = __pyx_t_2;
18815     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18816     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18817 
18818     /* "(tree fragment)":6
18819  *     if __pyx_checksum != 0xb068931:
18820  *         from pickle import PickleError as __pyx_PickleError
18821  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
18822  *     __pyx_result = Enum.__new__(__pyx_type)
18823  *     if __pyx_state is not None:
18824  */
18825     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
18826     __Pyx_GOTREF(__pyx_t_2);
18827     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
18828     __Pyx_GOTREF(__pyx_t_4);
18829     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18830     __Pyx_INCREF(__pyx_v___pyx_PickleError);
18831     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
18832     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
18833       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
18834       if (likely(__pyx_t_5)) {
18835         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18836         __Pyx_INCREF(__pyx_t_5);
18837         __Pyx_INCREF(function);
18838         __Pyx_DECREF_SET(__pyx_t_2, function);
18839       }
18840     }
18841     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
18842     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18843     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18844     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
18845     __Pyx_GOTREF(__pyx_t_3);
18846     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18847     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18848     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18849     __PYX_ERR(2, 6, __pyx_L1_error)
18850 
18851     /* "(tree fragment)":4
18852  *     cdef object __pyx_PickleError
18853  *     cdef object __pyx_result
18854  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
18855  *         from pickle import PickleError as __pyx_PickleError
18856  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18857  */
18858   }
18859 
18860   /* "(tree fragment)":7
18861  *         from pickle import PickleError as __pyx_PickleError
18862  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18863  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
18864  *     if __pyx_state is not None:
18865  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18866  */
18867   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
18868   __Pyx_GOTREF(__pyx_t_2);
18869   __pyx_t_4 = NULL;
18870   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18871     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
18872     if (likely(__pyx_t_4)) {
18873       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18874       __Pyx_INCREF(__pyx_t_4);
18875       __Pyx_INCREF(function);
18876       __Pyx_DECREF_SET(__pyx_t_2, function);
18877     }
18878   }
18879   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
18880   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18881   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
18882   __Pyx_GOTREF(__pyx_t_3);
18883   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18884   __pyx_v___pyx_result = __pyx_t_3;
18885   __pyx_t_3 = 0;
18886 
18887   /* "(tree fragment)":8
18888  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18889  *     __pyx_result = Enum.__new__(__pyx_type)
18890  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18891  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18892  *     return __pyx_result
18893  */
18894   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
18895   __pyx_t_6 = (__pyx_t_1 != 0);
18896   if (__pyx_t_6) {
18897 
18898     /* "(tree fragment)":9
18899  *     __pyx_result = Enum.__new__(__pyx_type)
18900  *     if __pyx_state is not None:
18901  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
18902  *     return __pyx_result
18903  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18904  */
18905     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
18906     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
18907     __Pyx_GOTREF(__pyx_t_3);
18908     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18909 
18910     /* "(tree fragment)":8
18911  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18912  *     __pyx_result = Enum.__new__(__pyx_type)
18913  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18914  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18915  *     return __pyx_result
18916  */
18917   }
18918 
18919   /* "(tree fragment)":10
18920  *     if __pyx_state is not None:
18921  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18922  *     return __pyx_result             # <<<<<<<<<<<<<<
18923  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18924  *     __pyx_result.name = __pyx_state[0]
18925  */
18926   __Pyx_XDECREF(__pyx_r);
18927   __Pyx_INCREF(__pyx_v___pyx_result);
18928   __pyx_r = __pyx_v___pyx_result;
18929   goto __pyx_L0;
18930 
18931   /* "(tree fragment)":1
18932  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18933  *     cdef object __pyx_PickleError
18934  *     cdef object __pyx_result
18935  */
18936 
18937   /* function exit code */
18938   __pyx_L1_error:;
18939   __Pyx_XDECREF(__pyx_t_2);
18940   __Pyx_XDECREF(__pyx_t_3);
18941   __Pyx_XDECREF(__pyx_t_4);
18942   __Pyx_XDECREF(__pyx_t_5);
18943   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18944   __pyx_r = NULL;
18945   __pyx_L0:;
18946   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18947   __Pyx_XDECREF(__pyx_v___pyx_result);
18948   __Pyx_XGIVEREF(__pyx_r);
18949   __Pyx_RefNannyFinishContext();
18950   return __pyx_r;
18951 }
18952 
18953 /* "(tree fragment)":11
18954  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18955  *     return __pyx_result
18956  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18957  *     __pyx_result.name = __pyx_state[0]
18958  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18959  */
18960 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)18961 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18962   PyObject *__pyx_r = NULL;
18963   __Pyx_RefNannyDeclarations
18964   PyObject *__pyx_t_1 = NULL;
18965   int __pyx_t_2;
18966   Py_ssize_t __pyx_t_3;
18967   int __pyx_t_4;
18968   int __pyx_t_5;
18969   PyObject *__pyx_t_6 = NULL;
18970   PyObject *__pyx_t_7 = NULL;
18971   PyObject *__pyx_t_8 = NULL;
18972   int __pyx_lineno = 0;
18973   const char *__pyx_filename = NULL;
18974   int __pyx_clineno = 0;
18975   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18976 
18977   /* "(tree fragment)":12
18978  *     return __pyx_result
18979  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18980  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
18981  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18982  *         __pyx_result.__dict__.update(__pyx_state[1])
18983  */
18984   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18985     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18986     __PYX_ERR(2, 12, __pyx_L1_error)
18987   }
18988   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
18989   __Pyx_GOTREF(__pyx_t_1);
18990   __Pyx_GIVEREF(__pyx_t_1);
18991   __Pyx_GOTREF(__pyx_v___pyx_result->name);
18992   __Pyx_DECREF(__pyx_v___pyx_result->name);
18993   __pyx_v___pyx_result->name = __pyx_t_1;
18994   __pyx_t_1 = 0;
18995 
18996   /* "(tree fragment)":13
18997  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18998  *     __pyx_result.name = __pyx_state[0]
18999  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
19000  *         __pyx_result.__dict__.update(__pyx_state[1])
19001  */
19002   if (unlikely(__pyx_v___pyx_state == Py_None)) {
19003     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19004     __PYX_ERR(2, 13, __pyx_L1_error)
19005   }
19006   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
19007   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
19008   if (__pyx_t_4) {
19009   } else {
19010     __pyx_t_2 = __pyx_t_4;
19011     goto __pyx_L4_bool_binop_done;
19012   }
19013   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
19014   __pyx_t_5 = (__pyx_t_4 != 0);
19015   __pyx_t_2 = __pyx_t_5;
19016   __pyx_L4_bool_binop_done:;
19017   if (__pyx_t_2) {
19018 
19019     /* "(tree fragment)":14
19020  *     __pyx_result.name = __pyx_state[0]
19021  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19022  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
19023  */
19024     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
19025     __Pyx_GOTREF(__pyx_t_6);
19026     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
19027     __Pyx_GOTREF(__pyx_t_7);
19028     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19029     if (unlikely(__pyx_v___pyx_state == Py_None)) {
19030       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19031       __PYX_ERR(2, 14, __pyx_L1_error)
19032     }
19033     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
19034     __Pyx_GOTREF(__pyx_t_6);
19035     __pyx_t_8 = NULL;
19036     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
19037       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
19038       if (likely(__pyx_t_8)) {
19039         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19040         __Pyx_INCREF(__pyx_t_8);
19041         __Pyx_INCREF(function);
19042         __Pyx_DECREF_SET(__pyx_t_7, function);
19043       }
19044     }
19045     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
19046     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
19047     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19048     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
19049     __Pyx_GOTREF(__pyx_t_1);
19050     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19051     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19052 
19053     /* "(tree fragment)":13
19054  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19055  *     __pyx_result.name = __pyx_state[0]
19056  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
19057  *         __pyx_result.__dict__.update(__pyx_state[1])
19058  */
19059   }
19060 
19061   /* "(tree fragment)":11
19062  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19063  *     return __pyx_result
19064  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
19065  *     __pyx_result.name = __pyx_state[0]
19066  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19067  */
19068 
19069   /* function exit code */
19070   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19071   goto __pyx_L0;
19072   __pyx_L1_error:;
19073   __Pyx_XDECREF(__pyx_t_1);
19074   __Pyx_XDECREF(__pyx_t_6);
19075   __Pyx_XDECREF(__pyx_t_7);
19076   __Pyx_XDECREF(__pyx_t_8);
19077   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19078   __pyx_r = 0;
19079   __pyx_L0:;
19080   __Pyx_XGIVEREF(__pyx_r);
19081   __Pyx_RefNannyFinishContext();
19082   return __pyx_r;
19083 }
19084 static struct __pyx_vtabstruct_array __pyx_vtable_array;
19085 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)19086 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
19087   struct __pyx_array_obj *p;
19088   PyObject *o;
19089   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19090     o = (*t->tp_alloc)(t, 0);
19091   } else {
19092     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19093   }
19094   if (unlikely(!o)) return 0;
19095   p = ((struct __pyx_array_obj *)o);
19096   p->__pyx_vtab = __pyx_vtabptr_array;
19097   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
19098   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
19099   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
19100   return o;
19101   bad:
19102   Py_DECREF(o); o = 0;
19103   return NULL;
19104 }
19105 
__pyx_tp_dealloc_array(PyObject * o)19106 static void __pyx_tp_dealloc_array(PyObject *o) {
19107   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
19108   #if CYTHON_USE_TP_FINALIZE
19109   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
19110     if (PyObject_CallFinalizerFromDealloc(o)) return;
19111   }
19112   #endif
19113   {
19114     PyObject *etype, *eval, *etb;
19115     PyErr_Fetch(&etype, &eval, &etb);
19116     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19117     __pyx_array___dealloc__(o);
19118     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19119     PyErr_Restore(etype, eval, etb);
19120   }
19121   Py_CLEAR(p->mode);
19122   Py_CLEAR(p->_format);
19123   (*Py_TYPE(o)->tp_free)(o);
19124 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)19125 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
19126   PyObject *r;
19127   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19128   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19129   Py_DECREF(x);
19130   return r;
19131 }
19132 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)19133 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
19134   if (v) {
19135     return __pyx_array___setitem__(o, i, v);
19136   }
19137   else {
19138     PyErr_Format(PyExc_NotImplementedError,
19139       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19140     return -1;
19141   }
19142 }
19143 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)19144 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
19145   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
19146   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
19147     PyErr_Clear();
19148     v = __pyx_array___getattr__(o, n);
19149   }
19150   return v;
19151 }
19152 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)19153 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
19154   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
19155 }
19156 
19157 static PyMethodDef __pyx_methods_array[] = {
19158   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
19159   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
19160   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
19161   {0, 0, 0, 0}
19162 };
19163 
19164 static struct PyGetSetDef __pyx_getsets_array[] = {
19165   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
19166   {0, 0, 0, 0, 0}
19167 };
19168 
19169 static PySequenceMethods __pyx_tp_as_sequence_array = {
19170   __pyx_array___len__, /*sq_length*/
19171   0, /*sq_concat*/
19172   0, /*sq_repeat*/
19173   __pyx_sq_item_array, /*sq_item*/
19174   0, /*sq_slice*/
19175   0, /*sq_ass_item*/
19176   0, /*sq_ass_slice*/
19177   0, /*sq_contains*/
19178   0, /*sq_inplace_concat*/
19179   0, /*sq_inplace_repeat*/
19180 };
19181 
19182 static PyMappingMethods __pyx_tp_as_mapping_array = {
19183   __pyx_array___len__, /*mp_length*/
19184   __pyx_array___getitem__, /*mp_subscript*/
19185   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
19186 };
19187 
19188 static PyBufferProcs __pyx_tp_as_buffer_array = {
19189   #if PY_MAJOR_VERSION < 3
19190   0, /*bf_getreadbuffer*/
19191   #endif
19192   #if PY_MAJOR_VERSION < 3
19193   0, /*bf_getwritebuffer*/
19194   #endif
19195   #if PY_MAJOR_VERSION < 3
19196   0, /*bf_getsegcount*/
19197   #endif
19198   #if PY_MAJOR_VERSION < 3
19199   0, /*bf_getcharbuffer*/
19200   #endif
19201   __pyx_array_getbuffer, /*bf_getbuffer*/
19202   0, /*bf_releasebuffer*/
19203 };
19204 
19205 static PyTypeObject __pyx_type___pyx_array = {
19206   PyVarObject_HEAD_INIT(0, 0)
19207   "openTSNE._matrix_mul.matrix_mul.array", /*tp_name*/
19208   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
19209   0, /*tp_itemsize*/
19210   __pyx_tp_dealloc_array, /*tp_dealloc*/
19211   #if PY_VERSION_HEX < 0x030800b4
19212   0, /*tp_print*/
19213   #endif
19214   #if PY_VERSION_HEX >= 0x030800b4
19215   0, /*tp_vectorcall_offset*/
19216   #endif
19217   0, /*tp_getattr*/
19218   0, /*tp_setattr*/
19219   #if PY_MAJOR_VERSION < 3
19220   0, /*tp_compare*/
19221   #endif
19222   #if PY_MAJOR_VERSION >= 3
19223   0, /*tp_as_async*/
19224   #endif
19225   0, /*tp_repr*/
19226   0, /*tp_as_number*/
19227   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
19228   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
19229   0, /*tp_hash*/
19230   0, /*tp_call*/
19231   0, /*tp_str*/
19232   __pyx_tp_getattro_array, /*tp_getattro*/
19233   0, /*tp_setattro*/
19234   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
19235   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
19236   0, /*tp_doc*/
19237   0, /*tp_traverse*/
19238   0, /*tp_clear*/
19239   0, /*tp_richcompare*/
19240   0, /*tp_weaklistoffset*/
19241   0, /*tp_iter*/
19242   0, /*tp_iternext*/
19243   __pyx_methods_array, /*tp_methods*/
19244   0, /*tp_members*/
19245   __pyx_getsets_array, /*tp_getset*/
19246   0, /*tp_base*/
19247   0, /*tp_dict*/
19248   0, /*tp_descr_get*/
19249   0, /*tp_descr_set*/
19250   0, /*tp_dictoffset*/
19251   0, /*tp_init*/
19252   0, /*tp_alloc*/
19253   __pyx_tp_new_array, /*tp_new*/
19254   0, /*tp_free*/
19255   0, /*tp_is_gc*/
19256   0, /*tp_bases*/
19257   0, /*tp_mro*/
19258   0, /*tp_cache*/
19259   0, /*tp_subclasses*/
19260   0, /*tp_weaklist*/
19261   0, /*tp_del*/
19262   0, /*tp_version_tag*/
19263   #if PY_VERSION_HEX >= 0x030400a1
19264   0, /*tp_finalize*/
19265   #endif
19266   #if PY_VERSION_HEX >= 0x030800b1
19267   0, /*tp_vectorcall*/
19268   #endif
19269   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19270   0, /*tp_print*/
19271   #endif
19272 };
19273 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)19274 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19275   struct __pyx_MemviewEnum_obj *p;
19276   PyObject *o;
19277   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19278     o = (*t->tp_alloc)(t, 0);
19279   } else {
19280     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19281   }
19282   if (unlikely(!o)) return 0;
19283   p = ((struct __pyx_MemviewEnum_obj *)o);
19284   p->name = Py_None; Py_INCREF(Py_None);
19285   return o;
19286 }
19287 
__pyx_tp_dealloc_Enum(PyObject * o)19288 static void __pyx_tp_dealloc_Enum(PyObject *o) {
19289   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
19290   #if CYTHON_USE_TP_FINALIZE
19291   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19292     if (PyObject_CallFinalizerFromDealloc(o)) return;
19293   }
19294   #endif
19295   PyObject_GC_UnTrack(o);
19296   Py_CLEAR(p->name);
19297   (*Py_TYPE(o)->tp_free)(o);
19298 }
19299 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)19300 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
19301   int e;
19302   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
19303   if (p->name) {
19304     e = (*v)(p->name, a); if (e) return e;
19305   }
19306   return 0;
19307 }
19308 
__pyx_tp_clear_Enum(PyObject * o)19309 static int __pyx_tp_clear_Enum(PyObject *o) {
19310   PyObject* tmp;
19311   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
19312   tmp = ((PyObject*)p->name);
19313   p->name = Py_None; Py_INCREF(Py_None);
19314   Py_XDECREF(tmp);
19315   return 0;
19316 }
19317 
19318 static PyMethodDef __pyx_methods_Enum[] = {
19319   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
19320   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
19321   {0, 0, 0, 0}
19322 };
19323 
19324 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
19325   PyVarObject_HEAD_INIT(0, 0)
19326   "openTSNE._matrix_mul.matrix_mul.Enum", /*tp_name*/
19327   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
19328   0, /*tp_itemsize*/
19329   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
19330   #if PY_VERSION_HEX < 0x030800b4
19331   0, /*tp_print*/
19332   #endif
19333   #if PY_VERSION_HEX >= 0x030800b4
19334   0, /*tp_vectorcall_offset*/
19335   #endif
19336   0, /*tp_getattr*/
19337   0, /*tp_setattr*/
19338   #if PY_MAJOR_VERSION < 3
19339   0, /*tp_compare*/
19340   #endif
19341   #if PY_MAJOR_VERSION >= 3
19342   0, /*tp_as_async*/
19343   #endif
19344   __pyx_MemviewEnum___repr__, /*tp_repr*/
19345   0, /*tp_as_number*/
19346   0, /*tp_as_sequence*/
19347   0, /*tp_as_mapping*/
19348   0, /*tp_hash*/
19349   0, /*tp_call*/
19350   0, /*tp_str*/
19351   0, /*tp_getattro*/
19352   0, /*tp_setattro*/
19353   0, /*tp_as_buffer*/
19354   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19355   0, /*tp_doc*/
19356   __pyx_tp_traverse_Enum, /*tp_traverse*/
19357   __pyx_tp_clear_Enum, /*tp_clear*/
19358   0, /*tp_richcompare*/
19359   0, /*tp_weaklistoffset*/
19360   0, /*tp_iter*/
19361   0, /*tp_iternext*/
19362   __pyx_methods_Enum, /*tp_methods*/
19363   0, /*tp_members*/
19364   0, /*tp_getset*/
19365   0, /*tp_base*/
19366   0, /*tp_dict*/
19367   0, /*tp_descr_get*/
19368   0, /*tp_descr_set*/
19369   0, /*tp_dictoffset*/
19370   __pyx_MemviewEnum___init__, /*tp_init*/
19371   0, /*tp_alloc*/
19372   __pyx_tp_new_Enum, /*tp_new*/
19373   0, /*tp_free*/
19374   0, /*tp_is_gc*/
19375   0, /*tp_bases*/
19376   0, /*tp_mro*/
19377   0, /*tp_cache*/
19378   0, /*tp_subclasses*/
19379   0, /*tp_weaklist*/
19380   0, /*tp_del*/
19381   0, /*tp_version_tag*/
19382   #if PY_VERSION_HEX >= 0x030400a1
19383   0, /*tp_finalize*/
19384   #endif
19385   #if PY_VERSION_HEX >= 0x030800b1
19386   0, /*tp_vectorcall*/
19387   #endif
19388   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19389   0, /*tp_print*/
19390   #endif
19391 };
19392 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
19393 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)19394 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
19395   struct __pyx_memoryview_obj *p;
19396   PyObject *o;
19397   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19398     o = (*t->tp_alloc)(t, 0);
19399   } else {
19400     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19401   }
19402   if (unlikely(!o)) return 0;
19403   p = ((struct __pyx_memoryview_obj *)o);
19404   p->__pyx_vtab = __pyx_vtabptr_memoryview;
19405   p->obj = Py_None; Py_INCREF(Py_None);
19406   p->_size = Py_None; Py_INCREF(Py_None);
19407   p->_array_interface = Py_None; Py_INCREF(Py_None);
19408   p->view.obj = NULL;
19409   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
19410   return o;
19411   bad:
19412   Py_DECREF(o); o = 0;
19413   return NULL;
19414 }
19415 
__pyx_tp_dealloc_memoryview(PyObject * o)19416 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
19417   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19418   #if CYTHON_USE_TP_FINALIZE
19419   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19420     if (PyObject_CallFinalizerFromDealloc(o)) return;
19421   }
19422   #endif
19423   PyObject_GC_UnTrack(o);
19424   {
19425     PyObject *etype, *eval, *etb;
19426     PyErr_Fetch(&etype, &eval, &etb);
19427     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19428     __pyx_memoryview___dealloc__(o);
19429     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19430     PyErr_Restore(etype, eval, etb);
19431   }
19432   Py_CLEAR(p->obj);
19433   Py_CLEAR(p->_size);
19434   Py_CLEAR(p->_array_interface);
19435   (*Py_TYPE(o)->tp_free)(o);
19436 }
19437 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)19438 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
19439   int e;
19440   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19441   if (p->obj) {
19442     e = (*v)(p->obj, a); if (e) return e;
19443   }
19444   if (p->_size) {
19445     e = (*v)(p->_size, a); if (e) return e;
19446   }
19447   if (p->_array_interface) {
19448     e = (*v)(p->_array_interface, a); if (e) return e;
19449   }
19450   if (p->view.obj) {
19451     e = (*v)(p->view.obj, a); if (e) return e;
19452   }
19453   return 0;
19454 }
19455 
__pyx_tp_clear_memoryview(PyObject * o)19456 static int __pyx_tp_clear_memoryview(PyObject *o) {
19457   PyObject* tmp;
19458   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19459   tmp = ((PyObject*)p->obj);
19460   p->obj = Py_None; Py_INCREF(Py_None);
19461   Py_XDECREF(tmp);
19462   tmp = ((PyObject*)p->_size);
19463   p->_size = Py_None; Py_INCREF(Py_None);
19464   Py_XDECREF(tmp);
19465   tmp = ((PyObject*)p->_array_interface);
19466   p->_array_interface = Py_None; Py_INCREF(Py_None);
19467   Py_XDECREF(tmp);
19468   Py_CLEAR(p->view.obj);
19469   return 0;
19470 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)19471 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
19472   PyObject *r;
19473   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19474   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19475   Py_DECREF(x);
19476   return r;
19477 }
19478 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)19479 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
19480   if (v) {
19481     return __pyx_memoryview___setitem__(o, i, v);
19482   }
19483   else {
19484     PyErr_Format(PyExc_NotImplementedError,
19485       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19486     return -1;
19487   }
19488 }
19489 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)19490 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
19491   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
19492 }
19493 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)19494 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
19495   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
19496 }
19497 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)19498 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
19499   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
19500 }
19501 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)19502 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
19503   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
19504 }
19505 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)19506 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
19507   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
19508 }
19509 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)19510 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
19511   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
19512 }
19513 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)19514 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
19515   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
19516 }
19517 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)19518 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
19519   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
19520 }
19521 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)19522 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
19523   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
19524 }
19525 
19526 static PyMethodDef __pyx_methods_memoryview[] = {
19527   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
19528   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
19529   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
19530   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
19531   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
19532   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
19533   {0, 0, 0, 0}
19534 };
19535 
19536 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
19537   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
19538   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
19539   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
19540   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
19541   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
19542   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
19543   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
19544   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
19545   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
19546   {0, 0, 0, 0, 0}
19547 };
19548 
19549 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
19550   __pyx_memoryview___len__, /*sq_length*/
19551   0, /*sq_concat*/
19552   0, /*sq_repeat*/
19553   __pyx_sq_item_memoryview, /*sq_item*/
19554   0, /*sq_slice*/
19555   0, /*sq_ass_item*/
19556   0, /*sq_ass_slice*/
19557   0, /*sq_contains*/
19558   0, /*sq_inplace_concat*/
19559   0, /*sq_inplace_repeat*/
19560 };
19561 
19562 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
19563   __pyx_memoryview___len__, /*mp_length*/
19564   __pyx_memoryview___getitem__, /*mp_subscript*/
19565   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
19566 };
19567 
19568 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
19569   #if PY_MAJOR_VERSION < 3
19570   0, /*bf_getreadbuffer*/
19571   #endif
19572   #if PY_MAJOR_VERSION < 3
19573   0, /*bf_getwritebuffer*/
19574   #endif
19575   #if PY_MAJOR_VERSION < 3
19576   0, /*bf_getsegcount*/
19577   #endif
19578   #if PY_MAJOR_VERSION < 3
19579   0, /*bf_getcharbuffer*/
19580   #endif
19581   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
19582   0, /*bf_releasebuffer*/
19583 };
19584 
19585 static PyTypeObject __pyx_type___pyx_memoryview = {
19586   PyVarObject_HEAD_INIT(0, 0)
19587   "openTSNE._matrix_mul.matrix_mul.memoryview", /*tp_name*/
19588   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
19589   0, /*tp_itemsize*/
19590   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
19591   #if PY_VERSION_HEX < 0x030800b4
19592   0, /*tp_print*/
19593   #endif
19594   #if PY_VERSION_HEX >= 0x030800b4
19595   0, /*tp_vectorcall_offset*/
19596   #endif
19597   0, /*tp_getattr*/
19598   0, /*tp_setattr*/
19599   #if PY_MAJOR_VERSION < 3
19600   0, /*tp_compare*/
19601   #endif
19602   #if PY_MAJOR_VERSION >= 3
19603   0, /*tp_as_async*/
19604   #endif
19605   __pyx_memoryview___repr__, /*tp_repr*/
19606   0, /*tp_as_number*/
19607   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
19608   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
19609   0, /*tp_hash*/
19610   0, /*tp_call*/
19611   __pyx_memoryview___str__, /*tp_str*/
19612   0, /*tp_getattro*/
19613   0, /*tp_setattro*/
19614   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
19615   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19616   0, /*tp_doc*/
19617   __pyx_tp_traverse_memoryview, /*tp_traverse*/
19618   __pyx_tp_clear_memoryview, /*tp_clear*/
19619   0, /*tp_richcompare*/
19620   0, /*tp_weaklistoffset*/
19621   0, /*tp_iter*/
19622   0, /*tp_iternext*/
19623   __pyx_methods_memoryview, /*tp_methods*/
19624   0, /*tp_members*/
19625   __pyx_getsets_memoryview, /*tp_getset*/
19626   0, /*tp_base*/
19627   0, /*tp_dict*/
19628   0, /*tp_descr_get*/
19629   0, /*tp_descr_set*/
19630   0, /*tp_dictoffset*/
19631   0, /*tp_init*/
19632   0, /*tp_alloc*/
19633   __pyx_tp_new_memoryview, /*tp_new*/
19634   0, /*tp_free*/
19635   0, /*tp_is_gc*/
19636   0, /*tp_bases*/
19637   0, /*tp_mro*/
19638   0, /*tp_cache*/
19639   0, /*tp_subclasses*/
19640   0, /*tp_weaklist*/
19641   0, /*tp_del*/
19642   0, /*tp_version_tag*/
19643   #if PY_VERSION_HEX >= 0x030400a1
19644   0, /*tp_finalize*/
19645   #endif
19646   #if PY_VERSION_HEX >= 0x030800b1
19647   0, /*tp_vectorcall*/
19648   #endif
19649   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19650   0, /*tp_print*/
19651   #endif
19652 };
19653 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
19654 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)19655 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
19656   struct __pyx_memoryviewslice_obj *p;
19657   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
19658   if (unlikely(!o)) return 0;
19659   p = ((struct __pyx_memoryviewslice_obj *)o);
19660   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
19661   p->from_object = Py_None; Py_INCREF(Py_None);
19662   p->from_slice.memview = NULL;
19663   return o;
19664 }
19665 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)19666 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
19667   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19668   #if CYTHON_USE_TP_FINALIZE
19669   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19670     if (PyObject_CallFinalizerFromDealloc(o)) return;
19671   }
19672   #endif
19673   PyObject_GC_UnTrack(o);
19674   {
19675     PyObject *etype, *eval, *etb;
19676     PyErr_Fetch(&etype, &eval, &etb);
19677     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19678     __pyx_memoryviewslice___dealloc__(o);
19679     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19680     PyErr_Restore(etype, eval, etb);
19681   }
19682   Py_CLEAR(p->from_object);
19683   PyObject_GC_Track(o);
19684   __pyx_tp_dealloc_memoryview(o);
19685 }
19686 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)19687 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
19688   int e;
19689   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19690   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
19691   if (p->from_object) {
19692     e = (*v)(p->from_object, a); if (e) return e;
19693   }
19694   return 0;
19695 }
19696 
__pyx_tp_clear__memoryviewslice(PyObject * o)19697 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
19698   PyObject* tmp;
19699   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19700   __pyx_tp_clear_memoryview(o);
19701   tmp = ((PyObject*)p->from_object);
19702   p->from_object = Py_None; Py_INCREF(Py_None);
19703   Py_XDECREF(tmp);
19704   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
19705   return 0;
19706 }
19707 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)19708 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
19709   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
19710 }
19711 
19712 static PyMethodDef __pyx_methods__memoryviewslice[] = {
19713   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
19714   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
19715   {0, 0, 0, 0}
19716 };
19717 
19718 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
19719   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
19720   {0, 0, 0, 0, 0}
19721 };
19722 
19723 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
19724   PyVarObject_HEAD_INIT(0, 0)
19725   "openTSNE._matrix_mul.matrix_mul._memoryviewslice", /*tp_name*/
19726   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
19727   0, /*tp_itemsize*/
19728   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
19729   #if PY_VERSION_HEX < 0x030800b4
19730   0, /*tp_print*/
19731   #endif
19732   #if PY_VERSION_HEX >= 0x030800b4
19733   0, /*tp_vectorcall_offset*/
19734   #endif
19735   0, /*tp_getattr*/
19736   0, /*tp_setattr*/
19737   #if PY_MAJOR_VERSION < 3
19738   0, /*tp_compare*/
19739   #endif
19740   #if PY_MAJOR_VERSION >= 3
19741   0, /*tp_as_async*/
19742   #endif
19743   #if CYTHON_COMPILING_IN_PYPY
19744   __pyx_memoryview___repr__, /*tp_repr*/
19745   #else
19746   0, /*tp_repr*/
19747   #endif
19748   0, /*tp_as_number*/
19749   0, /*tp_as_sequence*/
19750   0, /*tp_as_mapping*/
19751   0, /*tp_hash*/
19752   0, /*tp_call*/
19753   #if CYTHON_COMPILING_IN_PYPY
19754   __pyx_memoryview___str__, /*tp_str*/
19755   #else
19756   0, /*tp_str*/
19757   #endif
19758   0, /*tp_getattro*/
19759   0, /*tp_setattro*/
19760   0, /*tp_as_buffer*/
19761   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19762   "Internal class for passing memoryview slices to Python", /*tp_doc*/
19763   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
19764   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
19765   0, /*tp_richcompare*/
19766   0, /*tp_weaklistoffset*/
19767   0, /*tp_iter*/
19768   0, /*tp_iternext*/
19769   __pyx_methods__memoryviewslice, /*tp_methods*/
19770   0, /*tp_members*/
19771   __pyx_getsets__memoryviewslice, /*tp_getset*/
19772   0, /*tp_base*/
19773   0, /*tp_dict*/
19774   0, /*tp_descr_get*/
19775   0, /*tp_descr_set*/
19776   0, /*tp_dictoffset*/
19777   0, /*tp_init*/
19778   0, /*tp_alloc*/
19779   __pyx_tp_new__memoryviewslice, /*tp_new*/
19780   0, /*tp_free*/
19781   0, /*tp_is_gc*/
19782   0, /*tp_bases*/
19783   0, /*tp_mro*/
19784   0, /*tp_cache*/
19785   0, /*tp_subclasses*/
19786   0, /*tp_weaklist*/
19787   0, /*tp_del*/
19788   0, /*tp_version_tag*/
19789   #if PY_VERSION_HEX >= 0x030400a1
19790   0, /*tp_finalize*/
19791   #endif
19792   #if PY_VERSION_HEX >= 0x030800b1
19793   0, /*tp_vectorcall*/
19794   #endif
19795   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19796   0, /*tp_print*/
19797   #endif
19798 };
19799 
19800 static PyMethodDef __pyx_methods[] = {
19801   {0, 0, 0, 0}
19802 };
19803 
19804 #if PY_MAJOR_VERSION >= 3
19805 #if CYTHON_PEP489_MULTI_PHASE_INIT
19806 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
19807 static int __pyx_pymod_exec_matrix_mul(PyObject* module); /*proto*/
19808 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19809   {Py_mod_create, (void*)__pyx_pymod_create},
19810   {Py_mod_exec, (void*)__pyx_pymod_exec_matrix_mul},
19811   {0, NULL}
19812 };
19813 #endif
19814 
19815 static struct PyModuleDef __pyx_moduledef = {
19816     PyModuleDef_HEAD_INIT,
19817     "matrix_mul",
19818     0, /* m_doc */
19819   #if CYTHON_PEP489_MULTI_PHASE_INIT
19820     0, /* m_size */
19821   #else
19822     -1, /* m_size */
19823   #endif
19824     __pyx_methods /* m_methods */,
19825   #if CYTHON_PEP489_MULTI_PHASE_INIT
19826     __pyx_moduledef_slots, /* m_slots */
19827   #else
19828     NULL, /* m_reload */
19829   #endif
19830     NULL, /* m_traverse */
19831     NULL, /* m_clear */
19832     NULL /* m_free */
19833 };
19834 #endif
19835 #ifndef CYTHON_SMALL_CODE
19836 #if defined(__clang__)
19837     #define CYTHON_SMALL_CODE
19838 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19839     #define CYTHON_SMALL_CODE __attribute__((cold))
19840 #else
19841     #define CYTHON_SMALL_CODE
19842 #endif
19843 #endif
19844 
19845 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19846   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
19847   {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
19848   {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
19849   {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
19850   {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
19851   {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
19852   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
19853   {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
19854   {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
19855   {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
19856   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
19857   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
19858   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19859   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
19860   {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
19861   {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
19862   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
19863   {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
19864   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
19865   {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
19866   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
19867   {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
19868   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
19869   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19870   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19871   {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
19872   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19873   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
19874   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
19875   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
19876   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
19877   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
19878   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
19879   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19880   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
19881   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
19882   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
19883   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
19884   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
19885   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
19886   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
19887   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
19888   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
19889   {&__pyx_n_s_fft, __pyx_k_fft, sizeof(__pyx_k_fft), 0, 0, 1, 1},
19890   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
19891   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
19892   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
19893   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
19894   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19895   {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
19896   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
19897   {&__pyx_n_s_ifft, __pyx_k_ifft, sizeof(__pyx_k_ifft), 0, 0, 1, 1},
19898   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
19899   {&__pyx_n_s_irfft2, __pyx_k_irfft2, sizeof(__pyx_k_irfft2), 0, 0, 1, 1},
19900   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
19901   {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
19902   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
19903   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
19904   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
19905   {&__pyx_n_s_multiply, __pyx_k_multiply, sizeof(__pyx_k_multiply), 0, 0, 1, 1},
19906   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
19907   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
19908   {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
19909   {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
19910   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
19911   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
19912   {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
19913   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
19914   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
19915   {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
19916   {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
19917   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
19918   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
19919   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
19920   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
19921   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
19922   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
19923   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
19924   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
19925   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
19926   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
19927   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19928   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
19929   {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
19930   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19931   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19932   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19933   {&__pyx_n_s_rfft2, __pyx_k_rfft2, sizeof(__pyx_k_rfft2), 0, 0, 1, 1},
19934   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19935   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19936   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
19937   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
19938   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
19939   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
19940   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
19941   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
19942   {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
19943   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
19944   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
19945   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
19946   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
19947   {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
19948   {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
19949   {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
19950   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
19951   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
19952   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
19953   {0, 0, 0, 0, 0, 0, 0}
19954 };
__Pyx_InitCachedBuiltins(void)19955 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
19956   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 55, __pyx_L1_error)
19957   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
19958   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 855, __pyx_L1_error)
19959   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1037, __pyx_L1_error)
19960   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
19961   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
19962   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
19963   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
19964   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
19965   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
19966   return 0;
19967   __pyx_L1_error:;
19968   return -1;
19969 }
19970 
__Pyx_InitCachedConstants(void)19971 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
19972   __Pyx_RefNannyDeclarations
19973   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
19974 
19975   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
19976  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
19977  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
19978  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
19979  *
19980  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
19981  */
19982   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
19983   __Pyx_GOTREF(__pyx_tuple_);
19984   __Pyx_GIVEREF(__pyx_tuple_);
19985 
19986   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
19987  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
19988  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
19989  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
19990  *
19991  *             info.buf = PyArray_DATA(self)
19992  */
19993   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
19994   __Pyx_GOTREF(__pyx_tuple__2);
19995   __Pyx_GIVEREF(__pyx_tuple__2);
19996 
19997   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
19998  *                 if ((descr.byteorder == c'>' and little_endian) or
19999  *                     (descr.byteorder == c'<' and not little_endian)):
20000  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
20001  *                 if   t == NPY_BYTE:        f = "b"
20002  *                 elif t == NPY_UBYTE:       f = "B"
20003  */
20004   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
20005   __Pyx_GOTREF(__pyx_tuple__3);
20006   __Pyx_GIVEREF(__pyx_tuple__3);
20007 
20008   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
20009  *
20010  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
20011  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
20012  *
20013  *         if ((child.byteorder == c'>' and little_endian) or
20014  */
20015   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 855, __pyx_L1_error)
20016   __Pyx_GOTREF(__pyx_tuple__4);
20017   __Pyx_GIVEREF(__pyx_tuple__4);
20018 
20019   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
20020  *             t = child.type_num
20021  *             if end - f < 5:
20022  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
20023  *
20024  *             # Until ticket #99 is fixed, use integers to avoid warnings
20025  */
20026   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 879, __pyx_L1_error)
20027   __Pyx_GOTREF(__pyx_tuple__5);
20028   __Pyx_GIVEREF(__pyx_tuple__5);
20029 
20030   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
20031  *         _import_array()
20032  *     except Exception:
20033  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
20034  *
20035  * cdef inline int import_umath() except -1:
20036  */
20037   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1037, __pyx_L1_error)
20038   __Pyx_GOTREF(__pyx_tuple__6);
20039   __Pyx_GIVEREF(__pyx_tuple__6);
20040 
20041   /* "../../../../../opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
20042  *         _import_umath()
20043  *     except Exception:
20044  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
20045  *
20046  * cdef inline int import_ufunc() except -1:
20047  */
20048   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1043, __pyx_L1_error)
20049   __Pyx_GOTREF(__pyx_tuple__7);
20050   __Pyx_GIVEREF(__pyx_tuple__7);
20051 
20052   /* "View.MemoryView":133
20053  *
20054  *         if not self.ndim:
20055  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
20056  *
20057  *         if itemsize <= 0:
20058  */
20059   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 133, __pyx_L1_error)
20060   __Pyx_GOTREF(__pyx_tuple__8);
20061   __Pyx_GIVEREF(__pyx_tuple__8);
20062 
20063   /* "View.MemoryView":136
20064  *
20065  *         if itemsize <= 0:
20066  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
20067  *
20068  *         if not isinstance(format, bytes):
20069  */
20070   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 136, __pyx_L1_error)
20071   __Pyx_GOTREF(__pyx_tuple__9);
20072   __Pyx_GIVEREF(__pyx_tuple__9);
20073 
20074   /* "View.MemoryView":148
20075  *
20076  *         if not self._shape:
20077  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
20078  *
20079  *
20080  */
20081   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 148, __pyx_L1_error)
20082   __Pyx_GOTREF(__pyx_tuple__10);
20083   __Pyx_GIVEREF(__pyx_tuple__10);
20084 
20085   /* "View.MemoryView":176
20086  *             self.data = <char *>malloc(self.len)
20087  *             if not self.data:
20088  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
20089  *
20090  *             if self.dtype_is_object:
20091  */
20092   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 176, __pyx_L1_error)
20093   __Pyx_GOTREF(__pyx_tuple__11);
20094   __Pyx_GIVEREF(__pyx_tuple__11);
20095 
20096   /* "View.MemoryView":192
20097  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20098  *         if not (flags & bufmode):
20099  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
20100  *         info.buf = self.data
20101  *         info.len = self.len
20102  */
20103   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 192, __pyx_L1_error)
20104   __Pyx_GOTREF(__pyx_tuple__12);
20105   __Pyx_GIVEREF(__pyx_tuple__12);
20106 
20107   /* "(tree fragment)":2
20108  * def __reduce_cython__(self):
20109  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20110  * def __setstate_cython__(self, __pyx_state):
20111  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20112  */
20113   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 2, __pyx_L1_error)
20114   __Pyx_GOTREF(__pyx_tuple__13);
20115   __Pyx_GIVEREF(__pyx_tuple__13);
20116 
20117   /* "(tree fragment)":4
20118  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20119  * def __setstate_cython__(self, __pyx_state):
20120  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20121  */
20122   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 4, __pyx_L1_error)
20123   __Pyx_GOTREF(__pyx_tuple__14);
20124   __Pyx_GIVEREF(__pyx_tuple__14);
20125 
20126   /* "View.MemoryView":418
20127  *     def __setitem__(memoryview self, object index, object value):
20128  *         if self.view.readonly:
20129  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
20130  *
20131  *         have_slices, index = _unellipsify(index, self.view.ndim)
20132  */
20133   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 418, __pyx_L1_error)
20134   __Pyx_GOTREF(__pyx_tuple__15);
20135   __Pyx_GIVEREF(__pyx_tuple__15);
20136 
20137   /* "View.MemoryView":495
20138  *             result = struct.unpack(self.view.format, bytesitem)
20139  *         except struct.error:
20140  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
20141  *         else:
20142  *             if len(self.view.format) == 1:
20143  */
20144   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 495, __pyx_L1_error)
20145   __Pyx_GOTREF(__pyx_tuple__16);
20146   __Pyx_GIVEREF(__pyx_tuple__16);
20147 
20148   /* "View.MemoryView":520
20149  *     def __getbuffer__(self, Py_buffer *info, int flags):
20150  *         if flags & PyBUF_WRITABLE and self.view.readonly:
20151  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
20152  *
20153  *         if flags & PyBUF_ND:
20154  */
20155   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 520, __pyx_L1_error)
20156   __Pyx_GOTREF(__pyx_tuple__17);
20157   __Pyx_GIVEREF(__pyx_tuple__17);
20158 
20159   /* "View.MemoryView":570
20160  *         if self.view.strides == NULL:
20161  *
20162  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
20163  *
20164  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
20165  */
20166   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 570, __pyx_L1_error)
20167   __Pyx_GOTREF(__pyx_tuple__18);
20168   __Pyx_GIVEREF(__pyx_tuple__18);
20169 
20170   /* "View.MemoryView":577
20171  *     def suboffsets(self):
20172  *         if self.view.suboffsets == NULL:
20173  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
20174  *
20175  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
20176  */
20177   __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 577, __pyx_L1_error)
20178   __Pyx_GOTREF(__pyx_tuple__19);
20179   __Pyx_INCREF(__pyx_int_neg_1);
20180   __Pyx_GIVEREF(__pyx_int_neg_1);
20181   PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
20182   __Pyx_GIVEREF(__pyx_tuple__19);
20183 
20184   /* "(tree fragment)":2
20185  * def __reduce_cython__(self):
20186  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20187  * def __setstate_cython__(self, __pyx_state):
20188  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20189  */
20190   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 2, __pyx_L1_error)
20191   __Pyx_GOTREF(__pyx_tuple__20);
20192   __Pyx_GIVEREF(__pyx_tuple__20);
20193 
20194   /* "(tree fragment)":4
20195  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20196  * def __setstate_cython__(self, __pyx_state):
20197  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20198  */
20199   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
20200   __Pyx_GOTREF(__pyx_tuple__21);
20201   __Pyx_GIVEREF(__pyx_tuple__21);
20202 
20203   /* "View.MemoryView":682
20204  *         if item is Ellipsis:
20205  *             if not seen_ellipsis:
20206  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
20207  *                 seen_ellipsis = True
20208  *             else:
20209  */
20210   __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(2, 682, __pyx_L1_error)
20211   __Pyx_GOTREF(__pyx_slice__22);
20212   __Pyx_GIVEREF(__pyx_slice__22);
20213 
20214   /* "View.MemoryView":703
20215  *     for suboffset in suboffsets[:ndim]:
20216  *         if suboffset >= 0:
20217  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
20218  *
20219  *
20220  */
20221   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 703, __pyx_L1_error)
20222   __Pyx_GOTREF(__pyx_tuple__23);
20223   __Pyx_GIVEREF(__pyx_tuple__23);
20224 
20225   /* "(tree fragment)":2
20226  * def __reduce_cython__(self):
20227  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20228  * def __setstate_cython__(self, __pyx_state):
20229  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20230  */
20231   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error)
20232   __Pyx_GOTREF(__pyx_tuple__24);
20233   __Pyx_GIVEREF(__pyx_tuple__24);
20234 
20235   /* "(tree fragment)":4
20236  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20237  * def __setstate_cython__(self, __pyx_state):
20238  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20239  */
20240   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error)
20241   __Pyx_GOTREF(__pyx_tuple__25);
20242   __Pyx_GIVEREF(__pyx_tuple__25);
20243 
20244   /* "View.MemoryView":286
20245  *         return self.name
20246  *
20247  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
20248  * cdef strided = Enum("<strided and direct>") # default
20249  * cdef indirect = Enum("<strided and indirect>")
20250  */
20251   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 286, __pyx_L1_error)
20252   __Pyx_GOTREF(__pyx_tuple__26);
20253   __Pyx_GIVEREF(__pyx_tuple__26);
20254 
20255   /* "View.MemoryView":287
20256  *
20257  * cdef generic = Enum("<strided and direct or indirect>")
20258  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
20259  * cdef indirect = Enum("<strided and indirect>")
20260  *
20261  */
20262   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 287, __pyx_L1_error)
20263   __Pyx_GOTREF(__pyx_tuple__27);
20264   __Pyx_GIVEREF(__pyx_tuple__27);
20265 
20266   /* "View.MemoryView":288
20267  * cdef generic = Enum("<strided and direct or indirect>")
20268  * cdef strided = Enum("<strided and direct>") # default
20269  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
20270  *
20271  *
20272  */
20273   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 288, __pyx_L1_error)
20274   __Pyx_GOTREF(__pyx_tuple__28);
20275   __Pyx_GIVEREF(__pyx_tuple__28);
20276 
20277   /* "View.MemoryView":291
20278  *
20279  *
20280  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
20281  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
20282  *
20283  */
20284   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 291, __pyx_L1_error)
20285   __Pyx_GOTREF(__pyx_tuple__29);
20286   __Pyx_GIVEREF(__pyx_tuple__29);
20287 
20288   /* "View.MemoryView":292
20289  *
20290  * cdef contiguous = Enum("<contiguous and direct>")
20291  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
20292  *
20293  *
20294  */
20295   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 292, __pyx_L1_error)
20296   __Pyx_GOTREF(__pyx_tuple__30);
20297   __Pyx_GIVEREF(__pyx_tuple__30);
20298 
20299   /* "(tree fragment)":1
20300  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
20301  *     cdef object __pyx_PickleError
20302  *     cdef object __pyx_result
20303  */
20304   __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 1, __pyx_L1_error)
20305   __Pyx_GOTREF(__pyx_tuple__31);
20306   __Pyx_GIVEREF(__pyx_tuple__31);
20307   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(2, 1, __pyx_L1_error)
20308   __Pyx_RefNannyFinishContext();
20309   return 0;
20310   __pyx_L1_error:;
20311   __Pyx_RefNannyFinishContext();
20312   return -1;
20313 }
20314 
__Pyx_InitGlobals(void)20315 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
20316   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20317   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
20318   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20319   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
20320   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20321   return 0;
20322   __pyx_L1_error:;
20323   return -1;
20324 }
20325 
20326 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
20327 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
20328 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
20329 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
20330 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
20331 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
20332 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
20333 
__Pyx_modinit_global_init_code(void)20334 static int __Pyx_modinit_global_init_code(void) {
20335   __Pyx_RefNannyDeclarations
20336   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
20337   /*--- Global init code ---*/
20338   generic = Py_None; Py_INCREF(Py_None);
20339   strided = Py_None; Py_INCREF(Py_None);
20340   indirect = Py_None; Py_INCREF(Py_None);
20341   contiguous = Py_None; Py_INCREF(Py_None);
20342   indirect_contiguous = Py_None; Py_INCREF(Py_None);
20343   __Pyx_RefNannyFinishContext();
20344   return 0;
20345 }
20346 
__Pyx_modinit_variable_export_code(void)20347 static int __Pyx_modinit_variable_export_code(void) {
20348   __Pyx_RefNannyDeclarations
20349   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
20350   /*--- Variable export code ---*/
20351   __Pyx_RefNannyFinishContext();
20352   return 0;
20353 }
20354 
__Pyx_modinit_function_export_code(void)20355 static int __Pyx_modinit_function_export_code(void) {
20356   __Pyx_RefNannyDeclarations
20357   int __pyx_lineno = 0;
20358   const char *__pyx_filename = NULL;
20359   int __pyx_clineno = 0;
20360   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
20361   /*--- Function export code ---*/
20362   if (__Pyx_ExportFunction("matrix_multiply_fft_1d", (void (*)(void))__pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_1d, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20363   if (__Pyx_ExportFunction("matrix_multiply_fft_2d", (void (*)(void))__pyx_f_8openTSNE_11_matrix_mul_10matrix_mul_matrix_multiply_fft_2d, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20364   __Pyx_RefNannyFinishContext();
20365   return 0;
20366   __pyx_L1_error:;
20367   __Pyx_RefNannyFinishContext();
20368   return -1;
20369 }
20370 
__Pyx_modinit_type_init_code(void)20371 static int __Pyx_modinit_type_init_code(void) {
20372   __Pyx_RefNannyDeclarations
20373   int __pyx_lineno = 0;
20374   const char *__pyx_filename = NULL;
20375   int __pyx_clineno = 0;
20376   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
20377   /*--- Type init code ---*/
20378   __pyx_vtabptr_array = &__pyx_vtable_array;
20379   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
20380   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
20381   #if PY_VERSION_HEX < 0x030800B1
20382   __pyx_type___pyx_array.tp_print = 0;
20383   #endif
20384   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
20385   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
20386   __pyx_array_type = &__pyx_type___pyx_array;
20387   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
20388   #if PY_VERSION_HEX < 0x030800B1
20389   __pyx_type___pyx_MemviewEnum.tp_print = 0;
20390   #endif
20391   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
20392     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20393   }
20394   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
20395   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
20396   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
20397   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
20398   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
20399   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
20400   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
20401   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
20402   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
20403   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
20404   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
20405   #if PY_VERSION_HEX < 0x030800B1
20406   __pyx_type___pyx_memoryview.tp_print = 0;
20407   #endif
20408   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
20409     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20410   }
20411   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
20412   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
20413   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
20414   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
20415   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
20416   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
20417   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
20418   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
20419   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
20420   #if PY_VERSION_HEX < 0x030800B1
20421   __pyx_type___pyx_memoryviewslice.tp_print = 0;
20422   #endif
20423   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
20424     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20425   }
20426   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
20427   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
20428   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
20429   __Pyx_RefNannyFinishContext();
20430   return 0;
20431   __pyx_L1_error:;
20432   __Pyx_RefNannyFinishContext();
20433   return -1;
20434 }
20435 
__Pyx_modinit_type_import_code(void)20436 static int __Pyx_modinit_type_import_code(void) {
20437   __Pyx_RefNannyDeclarations
20438   PyObject *__pyx_t_1 = NULL;
20439   int __pyx_lineno = 0;
20440   const char *__pyx_filename = NULL;
20441   int __pyx_clineno = 0;
20442   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
20443   /*--- Type import code ---*/
20444   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
20445   __Pyx_GOTREF(__pyx_t_1);
20446   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
20447   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
20448   sizeof(PyTypeObject),
20449   #else
20450   sizeof(PyHeapTypeObject),
20451   #endif
20452   __Pyx_ImportType_CheckSize_Warn);
20453    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
20454   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20455   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
20456   __Pyx_GOTREF(__pyx_t_1);
20457   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
20458    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
20459   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
20460    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
20461   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
20462    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
20463   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
20464    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
20465   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
20466    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 917, __pyx_L1_error)
20467   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20468   __Pyx_RefNannyFinishContext();
20469   return 0;
20470   __pyx_L1_error:;
20471   __Pyx_XDECREF(__pyx_t_1);
20472   __Pyx_RefNannyFinishContext();
20473   return -1;
20474 }
20475 
__Pyx_modinit_variable_import_code(void)20476 static int __Pyx_modinit_variable_import_code(void) {
20477   __Pyx_RefNannyDeclarations
20478   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
20479   /*--- Variable import code ---*/
20480   __Pyx_RefNannyFinishContext();
20481   return 0;
20482 }
20483 
__Pyx_modinit_function_import_code(void)20484 static int __Pyx_modinit_function_import_code(void) {
20485   __Pyx_RefNannyDeclarations
20486   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
20487   /*--- Function import code ---*/
20488   __Pyx_RefNannyFinishContext();
20489   return 0;
20490 }
20491 
20492 
20493 #ifndef CYTHON_NO_PYINIT_EXPORT
20494 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20495 #elif PY_MAJOR_VERSION < 3
20496 #ifdef __cplusplus
20497 #define __Pyx_PyMODINIT_FUNC extern "C" void
20498 #else
20499 #define __Pyx_PyMODINIT_FUNC void
20500 #endif
20501 #else
20502 #ifdef __cplusplus
20503 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
20504 #else
20505 #define __Pyx_PyMODINIT_FUNC PyObject *
20506 #endif
20507 #endif
20508 
20509 
20510 #if PY_MAJOR_VERSION < 3
20511 __Pyx_PyMODINIT_FUNC initmatrix_mul(void) CYTHON_SMALL_CODE; /*proto*/
initmatrix_mul(void)20512 __Pyx_PyMODINIT_FUNC initmatrix_mul(void)
20513 #else
20514 __Pyx_PyMODINIT_FUNC PyInit_matrix_mul(void) CYTHON_SMALL_CODE; /*proto*/
20515 __Pyx_PyMODINIT_FUNC PyInit_matrix_mul(void)
20516 #if CYTHON_PEP489_MULTI_PHASE_INIT
20517 {
20518   return PyModuleDef_Init(&__pyx_moduledef);
20519 }
20520 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
20521     #if PY_VERSION_HEX >= 0x030700A1
20522     static PY_INT64_T main_interpreter_id = -1;
20523     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
20524     if (main_interpreter_id == -1) {
20525         main_interpreter_id = current_id;
20526         return (unlikely(current_id == -1)) ? -1 : 0;
20527     } else if (unlikely(main_interpreter_id != current_id))
20528     #else
20529     static PyInterpreterState *main_interpreter = NULL;
20530     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
20531     if (!main_interpreter) {
20532         main_interpreter = current_interpreter;
20533     } else if (unlikely(main_interpreter != current_interpreter))
20534     #endif
20535     {
20536         PyErr_SetString(
20537             PyExc_ImportError,
20538             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
20539         return -1;
20540     }
20541     return 0;
20542 }
20543 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
20544     PyObject *value = PyObject_GetAttrString(spec, from_name);
20545     int result = 0;
20546     if (likely(value)) {
20547         if (allow_none || value != Py_None) {
20548             result = PyDict_SetItemString(moddict, to_name, value);
20549         }
20550         Py_DECREF(value);
20551     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20552         PyErr_Clear();
20553     } else {
20554         result = -1;
20555     }
20556     return result;
20557 }
20558 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20559     PyObject *module = NULL, *moddict, *modname;
20560     if (__Pyx_check_single_interpreter())
20561         return NULL;
20562     if (__pyx_m)
20563         return __Pyx_NewRef(__pyx_m);
20564     modname = PyObject_GetAttrString(spec, "name");
20565     if (unlikely(!modname)) goto bad;
20566     module = PyModule_NewObject(modname);
20567     Py_DECREF(modname);
20568     if (unlikely(!module)) goto bad;
20569     moddict = PyModule_GetDict(module);
20570     if (unlikely(!moddict)) goto bad;
20571     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
20572     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
20573     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
20574     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
20575     return module;
20576 bad:
20577     Py_XDECREF(module);
20578     return NULL;
20579 }
20580 
20581 
20582 static CYTHON_SMALL_CODE int __pyx_pymod_exec_matrix_mul(PyObject *__pyx_pyinit_module)
20583 #endif
20584 #endif
20585 {
20586   PyObject *__pyx_t_1 = NULL;
20587   static PyThread_type_lock __pyx_t_2[8];
20588   int __pyx_lineno = 0;
20589   const char *__pyx_filename = NULL;
20590   int __pyx_clineno = 0;
20591   __Pyx_RefNannyDeclarations
20592   #if CYTHON_PEP489_MULTI_PHASE_INIT
20593   if (__pyx_m) {
20594     if (__pyx_m == __pyx_pyinit_module) return 0;
20595     PyErr_SetString(PyExc_RuntimeError, "Module 'matrix_mul' has already been imported. Re-initialisation is not supported.");
20596     return -1;
20597   }
20598   #elif PY_MAJOR_VERSION >= 3
20599   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
20600   #endif
20601   #if CYTHON_REFNANNY
20602 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
20603 if (!__Pyx_RefNanny) {
20604   PyErr_Clear();
20605   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
20606   if (!__Pyx_RefNanny)
20607       Py_FatalError("failed to import 'refnanny' module");
20608 }
20609 #endif
20610   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_matrix_mul(void)", 0);
20611   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20612   #ifdef __Pxy_PyFrame_Initialize_Offsets
20613   __Pxy_PyFrame_Initialize_Offsets();
20614   #endif
20615   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20616   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20617   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20618   #ifdef __Pyx_CyFunction_USED
20619   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20620   #endif
20621   #ifdef __Pyx_FusedFunction_USED
20622   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20623   #endif
20624   #ifdef __Pyx_Coroutine_USED
20625   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20626   #endif
20627   #ifdef __Pyx_Generator_USED
20628   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20629   #endif
20630   #ifdef __Pyx_AsyncGen_USED
20631   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20632   #endif
20633   #ifdef __Pyx_StopAsyncIteration_USED
20634   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20635   #endif
20636   /*--- Library function declarations ---*/
20637   /*--- Threads initialization code ---*/
20638   #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
20639   PyEval_InitThreads();
20640   #endif
20641   /*--- Module creation code ---*/
20642   #if CYTHON_PEP489_MULTI_PHASE_INIT
20643   __pyx_m = __pyx_pyinit_module;
20644   Py_INCREF(__pyx_m);
20645   #else
20646   #if PY_MAJOR_VERSION < 3
20647   __pyx_m = Py_InitModule4("matrix_mul", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20648   #else
20649   __pyx_m = PyModule_Create(&__pyx_moduledef);
20650   #endif
20651   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20652   #endif
20653   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20654   Py_INCREF(__pyx_d);
20655   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20656   Py_INCREF(__pyx_b);
20657   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20658   Py_INCREF(__pyx_cython_runtime);
20659   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20660   /*--- Initialize various global constants etc. ---*/
20661   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20662   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20663   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20664   #endif
20665   if (__pyx_module_is_main_openTSNE___matrix_mul__matrix_mul) {
20666     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20667   }
20668   #if PY_MAJOR_VERSION >= 3
20669   {
20670     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20671     if (!PyDict_GetItemString(modules, "openTSNE._matrix_mul.matrix_mul")) {
20672       if (unlikely(PyDict_SetItemString(modules, "openTSNE._matrix_mul.matrix_mul", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20673     }
20674   }
20675   #endif
20676   /*--- Builtin init code ---*/
20677   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20678   /*--- Constants init code ---*/
20679   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20680   /*--- Global type/function init code ---*/
20681   (void)__Pyx_modinit_global_init_code();
20682   (void)__Pyx_modinit_variable_export_code();
20683   if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20684   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20685   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20686   (void)__Pyx_modinit_variable_import_code();
20687   (void)__Pyx_modinit_function_import_code();
20688   /*--- Execution code ---*/
20689   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20690   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20691   #endif
20692 
20693   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":9
20694  * cimport openTSNE._matrix_mul.matrix_mul
20695  * cimport numpy as np
20696  * import numpy as np             # <<<<<<<<<<<<<<
20697  *
20698  *
20699  */
20700   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
20701   __Pyx_GOTREF(__pyx_t_1);
20702   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
20703   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20704 
20705   /* "openTSNE/_matrix_mul/matrix_mul_numpy.pyx":1
20706  * # cython: boundscheck=False             # <<<<<<<<<<<<<<
20707  * # cython: wraparound=False
20708  * # cython: cdivision=True
20709  */
20710   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20711   __Pyx_GOTREF(__pyx_t_1);
20712   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20713   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20714 
20715   /* "View.MemoryView":209
20716  *         info.obj = self
20717  *
20718  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20719  *
20720  *     def __dealloc__(array self):
20721  */
20722   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error)
20723   __Pyx_GOTREF(__pyx_t_1);
20724   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
20725   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20726   PyType_Modified(__pyx_array_type);
20727 
20728   /* "View.MemoryView":286
20729  *         return self.name
20730  *
20731  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
20732  * cdef strided = Enum("<strided and direct>") # default
20733  * cdef indirect = Enum("<strided and indirect>")
20734  */
20735   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error)
20736   __Pyx_GOTREF(__pyx_t_1);
20737   __Pyx_XGOTREF(generic);
20738   __Pyx_DECREF_SET(generic, __pyx_t_1);
20739   __Pyx_GIVEREF(__pyx_t_1);
20740   __pyx_t_1 = 0;
20741 
20742   /* "View.MemoryView":287
20743  *
20744  * cdef generic = Enum("<strided and direct or indirect>")
20745  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
20746  * cdef indirect = Enum("<strided and indirect>")
20747  *
20748  */
20749   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
20750   __Pyx_GOTREF(__pyx_t_1);
20751   __Pyx_XGOTREF(strided);
20752   __Pyx_DECREF_SET(strided, __pyx_t_1);
20753   __Pyx_GIVEREF(__pyx_t_1);
20754   __pyx_t_1 = 0;
20755 
20756   /* "View.MemoryView":288
20757  * cdef generic = Enum("<strided and direct or indirect>")
20758  * cdef strided = Enum("<strided and direct>") # default
20759  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
20760  *
20761  *
20762  */
20763   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error)
20764   __Pyx_GOTREF(__pyx_t_1);
20765   __Pyx_XGOTREF(indirect);
20766   __Pyx_DECREF_SET(indirect, __pyx_t_1);
20767   __Pyx_GIVEREF(__pyx_t_1);
20768   __pyx_t_1 = 0;
20769 
20770   /* "View.MemoryView":291
20771  *
20772  *
20773  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
20774  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
20775  *
20776  */
20777   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
20778   __Pyx_GOTREF(__pyx_t_1);
20779   __Pyx_XGOTREF(contiguous);
20780   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
20781   __Pyx_GIVEREF(__pyx_t_1);
20782   __pyx_t_1 = 0;
20783 
20784   /* "View.MemoryView":292
20785  *
20786  * cdef contiguous = Enum("<contiguous and direct>")
20787  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
20788  *
20789  *
20790  */
20791   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error)
20792   __Pyx_GOTREF(__pyx_t_1);
20793   __Pyx_XGOTREF(indirect_contiguous);
20794   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
20795   __Pyx_GIVEREF(__pyx_t_1);
20796   __pyx_t_1 = 0;
20797 
20798   /* "View.MemoryView":316
20799  *
20800  * DEF THREAD_LOCKS_PREALLOCATED = 8
20801  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
20802  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
20803  *     PyThread_allocate_lock(),
20804  */
20805   __pyx_memoryview_thread_locks_used = 0;
20806 
20807   /* "View.MemoryView":317
20808  * DEF THREAD_LOCKS_PREALLOCATED = 8
20809  * cdef int __pyx_memoryview_thread_locks_used = 0
20810  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
20811  *     PyThread_allocate_lock(),
20812  *     PyThread_allocate_lock(),
20813  */
20814   __pyx_t_2[0] = PyThread_allocate_lock();
20815   __pyx_t_2[1] = PyThread_allocate_lock();
20816   __pyx_t_2[2] = PyThread_allocate_lock();
20817   __pyx_t_2[3] = PyThread_allocate_lock();
20818   __pyx_t_2[4] = PyThread_allocate_lock();
20819   __pyx_t_2[5] = PyThread_allocate_lock();
20820   __pyx_t_2[6] = PyThread_allocate_lock();
20821   __pyx_t_2[7] = PyThread_allocate_lock();
20822   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
20823 
20824   /* "View.MemoryView":549
20825  *         info.obj = self
20826  *
20827  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20828  *
20829  *
20830  */
20831   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
20832   __Pyx_GOTREF(__pyx_t_1);
20833   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
20834   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20835   PyType_Modified(__pyx_memoryview_type);
20836 
20837   /* "View.MemoryView":995
20838  *         return self.from_object
20839  *
20840  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20841  *
20842  *
20843  */
20844   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error)
20845   __Pyx_GOTREF(__pyx_t_1);
20846   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
20847   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20848   PyType_Modified(__pyx_memoryviewslice_type);
20849 
20850   /* "(tree fragment)":1
20851  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
20852  *     cdef object __pyx_PickleError
20853  *     cdef object __pyx_result
20854  */
20855   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
20856   __Pyx_GOTREF(__pyx_t_1);
20857   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
20858   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20859 
20860   /* "(tree fragment)":11
20861  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20862  *     return __pyx_result
20863  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
20864  *     __pyx_result.name = __pyx_state[0]
20865  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20866  */
20867 
20868   /*--- Wrapped vars code ---*/
20869 
20870   goto __pyx_L0;
20871   __pyx_L1_error:;
20872   __Pyx_XDECREF(__pyx_t_1);
20873   if (__pyx_m) {
20874     if (__pyx_d) {
20875       __Pyx_AddTraceback("init openTSNE._matrix_mul.matrix_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
20876     }
20877     Py_CLEAR(__pyx_m);
20878   } else if (!PyErr_Occurred()) {
20879     PyErr_SetString(PyExc_ImportError, "init openTSNE._matrix_mul.matrix_mul");
20880   }
20881   __pyx_L0:;
20882   __Pyx_RefNannyFinishContext();
20883   #if CYTHON_PEP489_MULTI_PHASE_INIT
20884   return (__pyx_m != NULL) ? 0 : -1;
20885   #elif PY_MAJOR_VERSION >= 3
20886   return __pyx_m;
20887   #else
20888   return;
20889   #endif
20890 }
20891 
20892 /* --- Runtime support code --- */
20893 /* Refnanny */
20894 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)20895 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
20896     PyObject *m = NULL, *p = NULL;
20897     void *r = NULL;
20898     m = PyImport_ImportModule(modname);
20899     if (!m) goto end;
20900     p = PyObject_GetAttrString(m, "RefNannyAPI");
20901     if (!p) goto end;
20902     r = PyLong_AsVoidPtr(p);
20903 end:
20904     Py_XDECREF(p);
20905     Py_XDECREF(m);
20906     return (__Pyx_RefNannyAPIStruct *)r;
20907 }
20908 #endif
20909 
20910 /* PyObjectGetAttrStr */
20911 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)20912 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
20913     PyTypeObject* tp = Py_TYPE(obj);
20914     if (likely(tp->tp_getattro))
20915         return tp->tp_getattro(obj, attr_name);
20916 #if PY_MAJOR_VERSION < 3
20917     if (likely(tp->tp_getattr))
20918         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
20919 #endif
20920     return PyObject_GetAttr(obj, attr_name);
20921 }
20922 #endif
20923 
20924 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)20925 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20926     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20927     if (unlikely(!result)) {
20928         PyErr_Format(PyExc_NameError,
20929 #if PY_MAJOR_VERSION >= 3
20930             "name '%U' is not defined", name);
20931 #else
20932             "name '%.200s' is not defined", PyString_AS_STRING(name));
20933 #endif
20934     }
20935     return result;
20936 }
20937 
20938 /* PyDictVersioning */
20939 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)20940 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
20941     PyObject *dict = Py_TYPE(obj)->tp_dict;
20942     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
20943 }
__Pyx_get_object_dict_version(PyObject * obj)20944 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
20945     PyObject **dictptr = NULL;
20946     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
20947     if (offset) {
20948 #if CYTHON_COMPILING_IN_CPYTHON
20949         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
20950 #else
20951         dictptr = _PyObject_GetDictPtr(obj);
20952 #endif
20953     }
20954     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
20955 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)20956 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
20957     PyObject *dict = Py_TYPE(obj)->tp_dict;
20958     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
20959         return 0;
20960     return obj_dict_version == __Pyx_get_object_dict_version(obj);
20961 }
20962 #endif
20963 
20964 /* GetModuleGlobalName */
20965 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)20966 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
20967 #else
20968 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
20969 #endif
20970 {
20971     PyObject *result;
20972 #if !CYTHON_AVOID_BORROWED_REFS
20973 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
20974     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
20975     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20976     if (likely(result)) {
20977         return __Pyx_NewRef(result);
20978     } else if (unlikely(PyErr_Occurred())) {
20979         return NULL;
20980     }
20981 #else
20982     result = PyDict_GetItem(__pyx_d, name);
20983     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20984     if (likely(result)) {
20985         return __Pyx_NewRef(result);
20986     }
20987 #endif
20988 #else
20989     result = PyObject_GetItem(__pyx_d, name);
20990     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20991     if (likely(result)) {
20992         return __Pyx_NewRef(result);
20993     }
20994     PyErr_Clear();
20995 #endif
20996     return __Pyx_GetBuiltinName(name);
20997 }
20998 
20999 /* PyObjectCall */
21000 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)21001 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21002     PyObject *result;
21003     ternaryfunc call = Py_TYPE(func)->tp_call;
21004     if (unlikely(!call))
21005         return PyObject_Call(func, arg, kw);
21006     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
21007         return NULL;
21008     result = (*call)(func, arg, kw);
21009     Py_LeaveRecursiveCall();
21010     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21011         PyErr_SetString(
21012             PyExc_SystemError,
21013             "NULL result without error in PyObject_Call");
21014     }
21015     return result;
21016 }
21017 #endif
21018 
21019 /* PyCFunctionFastCall */
21020 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)21021 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21022     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21023     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21024     PyObject *self = PyCFunction_GET_SELF(func);
21025     int flags = PyCFunction_GET_FLAGS(func);
21026     assert(PyCFunction_Check(func));
21027     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
21028     assert(nargs >= 0);
21029     assert(nargs == 0 || args != NULL);
21030     /* _PyCFunction_FastCallDict() must not be called with an exception set,
21031        because it may clear it (directly or indirectly) and so the
21032        caller loses its exception */
21033     assert(!PyErr_Occurred());
21034     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21035         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
21036     } else {
21037         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
21038     }
21039 }
21040 #endif
21041 
21042 /* PyFunctionFastCall */
21043 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)21044 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21045                                                PyObject *globals) {
21046     PyFrameObject *f;
21047     PyThreadState *tstate = __Pyx_PyThreadState_Current;
21048     PyObject **fastlocals;
21049     Py_ssize_t i;
21050     PyObject *result;
21051     assert(globals != NULL);
21052     /* XXX Perhaps we should create a specialized
21053        PyFrame_New() that doesn't take locals, but does
21054        take builtins without sanity checking them.
21055        */
21056     assert(tstate != NULL);
21057     f = PyFrame_New(tstate, co, globals, NULL);
21058     if (f == NULL) {
21059         return NULL;
21060     }
21061     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
21062     for (i = 0; i < na; i++) {
21063         Py_INCREF(*args);
21064         fastlocals[i] = *args++;
21065     }
21066     result = PyEval_EvalFrameEx(f,0);
21067     ++tstate->recursion_depth;
21068     Py_DECREF(f);
21069     --tstate->recursion_depth;
21070     return result;
21071 }
21072 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)21073 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
21074     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21075     PyObject *globals = PyFunction_GET_GLOBALS(func);
21076     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21077     PyObject *closure;
21078 #if PY_MAJOR_VERSION >= 3
21079     PyObject *kwdefs;
21080 #endif
21081     PyObject *kwtuple, **k;
21082     PyObject **d;
21083     Py_ssize_t nd;
21084     Py_ssize_t nk;
21085     PyObject *result;
21086     assert(kwargs == NULL || PyDict_Check(kwargs));
21087     nk = kwargs ? PyDict_Size(kwargs) : 0;
21088     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
21089         return NULL;
21090     }
21091     if (
21092 #if PY_MAJOR_VERSION >= 3
21093             co->co_kwonlyargcount == 0 &&
21094 #endif
21095             likely(kwargs == NULL || nk == 0) &&
21096             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21097         if (argdefs == NULL && co->co_argcount == nargs) {
21098             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21099             goto done;
21100         }
21101         else if (nargs == 0 && argdefs != NULL
21102                  && co->co_argcount == Py_SIZE(argdefs)) {
21103             /* function called with no arguments, but all parameters have
21104                a default value: use default values as arguments .*/
21105             args = &PyTuple_GET_ITEM(argdefs, 0);
21106             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21107             goto done;
21108         }
21109     }
21110     if (kwargs != NULL) {
21111         Py_ssize_t pos, i;
21112         kwtuple = PyTuple_New(2 * nk);
21113         if (kwtuple == NULL) {
21114             result = NULL;
21115             goto done;
21116         }
21117         k = &PyTuple_GET_ITEM(kwtuple, 0);
21118         pos = i = 0;
21119         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
21120             Py_INCREF(k[i]);
21121             Py_INCREF(k[i+1]);
21122             i += 2;
21123         }
21124         nk = i / 2;
21125     }
21126     else {
21127         kwtuple = NULL;
21128         k = NULL;
21129     }
21130     closure = PyFunction_GET_CLOSURE(func);
21131 #if PY_MAJOR_VERSION >= 3
21132     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21133 #endif
21134     if (argdefs != NULL) {
21135         d = &PyTuple_GET_ITEM(argdefs, 0);
21136         nd = Py_SIZE(argdefs);
21137     }
21138     else {
21139         d = NULL;
21140         nd = 0;
21141     }
21142 #if PY_MAJOR_VERSION >= 3
21143     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21144                                args, (int)nargs,
21145                                k, (int)nk,
21146                                d, (int)nd, kwdefs, closure);
21147 #else
21148     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21149                                args, (int)nargs,
21150                                k, (int)nk,
21151                                d, (int)nd, closure);
21152 #endif
21153     Py_XDECREF(kwtuple);
21154 done:
21155     Py_LeaveRecursiveCall();
21156     return result;
21157 }
21158 #endif
21159 #endif
21160 
21161 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)21162 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
21163     PyObject *args, *result = NULL;
21164     #if CYTHON_FAST_PYCALL
21165     if (PyFunction_Check(function)) {
21166         PyObject *args[2] = {arg1, arg2};
21167         return __Pyx_PyFunction_FastCall(function, args, 2);
21168     }
21169     #endif
21170     #if CYTHON_FAST_PYCCALL
21171     if (__Pyx_PyFastCFunction_Check(function)) {
21172         PyObject *args[2] = {arg1, arg2};
21173         return __Pyx_PyCFunction_FastCall(function, args, 2);
21174     }
21175     #endif
21176     args = PyTuple_New(2);
21177     if (unlikely(!args)) goto done;
21178     Py_INCREF(arg1);
21179     PyTuple_SET_ITEM(args, 0, arg1);
21180     Py_INCREF(arg2);
21181     PyTuple_SET_ITEM(args, 1, arg2);
21182     Py_INCREF(function);
21183     result = __Pyx_PyObject_Call(function, args, NULL);
21184     Py_DECREF(args);
21185     Py_DECREF(function);
21186 done:
21187     return result;
21188 }
21189 
21190 /* PyObjectCallMethO */
21191 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)21192 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21193     PyObject *self, *result;
21194     PyCFunction cfunc;
21195     cfunc = PyCFunction_GET_FUNCTION(func);
21196     self = PyCFunction_GET_SELF(func);
21197     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
21198         return NULL;
21199     result = cfunc(self, arg);
21200     Py_LeaveRecursiveCall();
21201     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21202         PyErr_SetString(
21203             PyExc_SystemError,
21204             "NULL result without error in PyObject_Call");
21205     }
21206     return result;
21207 }
21208 #endif
21209 
21210 /* PyObjectCallOneArg */
21211 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)21212 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21213     PyObject *result;
21214     PyObject *args = PyTuple_New(1);
21215     if (unlikely(!args)) return NULL;
21216     Py_INCREF(arg);
21217     PyTuple_SET_ITEM(args, 0, arg);
21218     result = __Pyx_PyObject_Call(func, args, NULL);
21219     Py_DECREF(args);
21220     return result;
21221 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)21222 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21223 #if CYTHON_FAST_PYCALL
21224     if (PyFunction_Check(func)) {
21225         return __Pyx_PyFunction_FastCall(func, &arg, 1);
21226     }
21227 #endif
21228     if (likely(PyCFunction_Check(func))) {
21229         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21230             return __Pyx_PyObject_CallMethO(func, arg);
21231 #if CYTHON_FAST_PYCCALL
21232         } else if (__Pyx_PyFastCFunction_Check(func)) {
21233             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21234 #endif
21235         }
21236     }
21237     return __Pyx__PyObject_CallOneArg(func, arg);
21238 }
21239 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)21240 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21241     PyObject *result;
21242     PyObject *args = PyTuple_Pack(1, arg);
21243     if (unlikely(!args)) return NULL;
21244     result = __Pyx_PyObject_Call(func, args, NULL);
21245     Py_DECREF(args);
21246     return result;
21247 }
21248 #endif
21249 
21250 /* MemviewSliceInit */
21251 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)21252 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
21253                         int ndim,
21254                         __Pyx_memviewslice *memviewslice,
21255                         int memview_is_new_reference)
21256 {
21257     __Pyx_RefNannyDeclarations
21258     int i, retval=-1;
21259     Py_buffer *buf = &memview->view;
21260     __Pyx_RefNannySetupContext("init_memviewslice", 0);
21261     if (unlikely(memviewslice->memview || memviewslice->data)) {
21262         PyErr_SetString(PyExc_ValueError,
21263             "memviewslice is already initialized!");
21264         goto fail;
21265     }
21266     if (buf->strides) {
21267         for (i = 0; i < ndim; i++) {
21268             memviewslice->strides[i] = buf->strides[i];
21269         }
21270     } else {
21271         Py_ssize_t stride = buf->itemsize;
21272         for (i = ndim - 1; i >= 0; i--) {
21273             memviewslice->strides[i] = stride;
21274             stride *= buf->shape[i];
21275         }
21276     }
21277     for (i = 0; i < ndim; i++) {
21278         memviewslice->shape[i]   = buf->shape[i];
21279         if (buf->suboffsets) {
21280             memviewslice->suboffsets[i] = buf->suboffsets[i];
21281         } else {
21282             memviewslice->suboffsets[i] = -1;
21283         }
21284     }
21285     memviewslice->memview = memview;
21286     memviewslice->data = (char *)buf->buf;
21287     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
21288         Py_INCREF(memview);
21289     }
21290     retval = 0;
21291     goto no_fail;
21292 fail:
21293     memviewslice->memview = 0;
21294     memviewslice->data = 0;
21295     retval = -1;
21296 no_fail:
21297     __Pyx_RefNannyFinishContext();
21298     return retval;
21299 }
21300 #ifndef Py_NO_RETURN
21301 #define Py_NO_RETURN
21302 #endif
__pyx_fatalerror(const char * fmt,...)21303 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
21304     va_list vargs;
21305     char msg[200];
21306 #ifdef HAVE_STDARG_PROTOTYPES
21307     va_start(vargs, fmt);
21308 #else
21309     va_start(vargs);
21310 #endif
21311     vsnprintf(msg, 200, fmt, vargs);
21312     va_end(vargs);
21313     Py_FatalError(msg);
21314 }
21315 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)21316 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
21317                                    PyThread_type_lock lock)
21318 {
21319     int result;
21320     PyThread_acquire_lock(lock, 1);
21321     result = (*acquisition_count)++;
21322     PyThread_release_lock(lock);
21323     return result;
21324 }
21325 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)21326 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
21327                                    PyThread_type_lock lock)
21328 {
21329     int result;
21330     PyThread_acquire_lock(lock, 1);
21331     result = (*acquisition_count)--;
21332     PyThread_release_lock(lock);
21333     return result;
21334 }
21335 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)21336 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
21337 {
21338     int first_time;
21339     struct __pyx_memoryview_obj *memview = memslice->memview;
21340     if (unlikely(!memview || (PyObject *) memview == Py_None))
21341         return;
21342     if (unlikely(__pyx_get_slice_count(memview) < 0))
21343         __pyx_fatalerror("Acquisition count is %d (line %d)",
21344                          __pyx_get_slice_count(memview), lineno);
21345     first_time = __pyx_add_acquisition_count(memview) == 0;
21346     if (unlikely(first_time)) {
21347         if (have_gil) {
21348             Py_INCREF((PyObject *) memview);
21349         } else {
21350             PyGILState_STATE _gilstate = PyGILState_Ensure();
21351             Py_INCREF((PyObject *) memview);
21352             PyGILState_Release(_gilstate);
21353         }
21354     }
21355 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)21356 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
21357                                              int have_gil, int lineno) {
21358     int last_time;
21359     struct __pyx_memoryview_obj *memview = memslice->memview;
21360     if (unlikely(!memview || (PyObject *) memview == Py_None)) {
21361         memslice->memview = NULL;
21362         return;
21363     }
21364     if (unlikely(__pyx_get_slice_count(memview) <= 0))
21365         __pyx_fatalerror("Acquisition count is %d (line %d)",
21366                          __pyx_get_slice_count(memview), lineno);
21367     last_time = __pyx_sub_acquisition_count(memview) == 1;
21368     memslice->data = NULL;
21369     if (unlikely(last_time)) {
21370         if (have_gil) {
21371             Py_CLEAR(memslice->memview);
21372         } else {
21373             PyGILState_STATE _gilstate = PyGILState_Ensure();
21374             Py_CLEAR(memslice->memview);
21375             PyGILState_Release(_gilstate);
21376         }
21377     } else {
21378         memslice->memview = NULL;
21379     }
21380 }
21381 
21382 /* PyErrFetchRestore */
21383 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)21384 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21385     PyObject *tmp_type, *tmp_value, *tmp_tb;
21386     tmp_type = tstate->curexc_type;
21387     tmp_value = tstate->curexc_value;
21388     tmp_tb = tstate->curexc_traceback;
21389     tstate->curexc_type = type;
21390     tstate->curexc_value = value;
21391     tstate->curexc_traceback = tb;
21392     Py_XDECREF(tmp_type);
21393     Py_XDECREF(tmp_value);
21394     Py_XDECREF(tmp_tb);
21395 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21396 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21397     *type = tstate->curexc_type;
21398     *value = tstate->curexc_value;
21399     *tb = tstate->curexc_traceback;
21400     tstate->curexc_type = 0;
21401     tstate->curexc_value = 0;
21402     tstate->curexc_traceback = 0;
21403 }
21404 #endif
21405 
21406 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)21407 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
21408                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
21409                                   int full_traceback, CYTHON_UNUSED int nogil) {
21410     PyObject *old_exc, *old_val, *old_tb;
21411     PyObject *ctx;
21412     __Pyx_PyThreadState_declare
21413 #ifdef WITH_THREAD
21414     PyGILState_STATE state;
21415     if (nogil)
21416         state = PyGILState_Ensure();
21417 #ifdef _MSC_VER
21418     else state = (PyGILState_STATE)-1;
21419 #endif
21420 #endif
21421     __Pyx_PyThreadState_assign
21422     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
21423     if (full_traceback) {
21424         Py_XINCREF(old_exc);
21425         Py_XINCREF(old_val);
21426         Py_XINCREF(old_tb);
21427         __Pyx_ErrRestore(old_exc, old_val, old_tb);
21428         PyErr_PrintEx(1);
21429     }
21430     #if PY_MAJOR_VERSION < 3
21431     ctx = PyString_FromString(name);
21432     #else
21433     ctx = PyUnicode_FromString(name);
21434     #endif
21435     __Pyx_ErrRestore(old_exc, old_val, old_tb);
21436     if (!ctx) {
21437         PyErr_WriteUnraisable(Py_None);
21438     } else {
21439         PyErr_WriteUnraisable(ctx);
21440         Py_DECREF(ctx);
21441     }
21442 #ifdef WITH_THREAD
21443     if (nogil)
21444         PyGILState_Release(state);
21445 #endif
21446 }
21447 
21448 /* RaiseException */
21449 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)21450 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21451                         CYTHON_UNUSED PyObject *cause) {
21452     __Pyx_PyThreadState_declare
21453     Py_XINCREF(type);
21454     if (!value || value == Py_None)
21455         value = NULL;
21456     else
21457         Py_INCREF(value);
21458     if (!tb || tb == Py_None)
21459         tb = NULL;
21460     else {
21461         Py_INCREF(tb);
21462         if (!PyTraceBack_Check(tb)) {
21463             PyErr_SetString(PyExc_TypeError,
21464                 "raise: arg 3 must be a traceback or None");
21465             goto raise_error;
21466         }
21467     }
21468     if (PyType_Check(type)) {
21469 #if CYTHON_COMPILING_IN_PYPY
21470         if (!value) {
21471             Py_INCREF(Py_None);
21472             value = Py_None;
21473         }
21474 #endif
21475         PyErr_NormalizeException(&type, &value, &tb);
21476     } else {
21477         if (value) {
21478             PyErr_SetString(PyExc_TypeError,
21479                 "instance exception may not have a separate value");
21480             goto raise_error;
21481         }
21482         value = type;
21483         type = (PyObject*) Py_TYPE(type);
21484         Py_INCREF(type);
21485         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21486             PyErr_SetString(PyExc_TypeError,
21487                 "raise: exception class must be a subclass of BaseException");
21488             goto raise_error;
21489         }
21490     }
21491     __Pyx_PyThreadState_assign
21492     __Pyx_ErrRestore(type, value, tb);
21493     return;
21494 raise_error:
21495     Py_XDECREF(value);
21496     Py_XDECREF(type);
21497     Py_XDECREF(tb);
21498     return;
21499 }
21500 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)21501 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21502     PyObject* owned_instance = NULL;
21503     if (tb == Py_None) {
21504         tb = 0;
21505     } else if (tb && !PyTraceBack_Check(tb)) {
21506         PyErr_SetString(PyExc_TypeError,
21507             "raise: arg 3 must be a traceback or None");
21508         goto bad;
21509     }
21510     if (value == Py_None)
21511         value = 0;
21512     if (PyExceptionInstance_Check(type)) {
21513         if (value) {
21514             PyErr_SetString(PyExc_TypeError,
21515                 "instance exception may not have a separate value");
21516             goto bad;
21517         }
21518         value = type;
21519         type = (PyObject*) Py_TYPE(value);
21520     } else if (PyExceptionClass_Check(type)) {
21521         PyObject *instance_class = NULL;
21522         if (value && PyExceptionInstance_Check(value)) {
21523             instance_class = (PyObject*) Py_TYPE(value);
21524             if (instance_class != type) {
21525                 int is_subclass = PyObject_IsSubclass(instance_class, type);
21526                 if (!is_subclass) {
21527                     instance_class = NULL;
21528                 } else if (unlikely(is_subclass == -1)) {
21529                     goto bad;
21530                 } else {
21531                     type = instance_class;
21532                 }
21533             }
21534         }
21535         if (!instance_class) {
21536             PyObject *args;
21537             if (!value)
21538                 args = PyTuple_New(0);
21539             else if (PyTuple_Check(value)) {
21540                 Py_INCREF(value);
21541                 args = value;
21542             } else
21543                 args = PyTuple_Pack(1, value);
21544             if (!args)
21545                 goto bad;
21546             owned_instance = PyObject_Call(type, args, NULL);
21547             Py_DECREF(args);
21548             if (!owned_instance)
21549                 goto bad;
21550             value = owned_instance;
21551             if (!PyExceptionInstance_Check(value)) {
21552                 PyErr_Format(PyExc_TypeError,
21553                              "calling %R should have returned an instance of "
21554                              "BaseException, not %R",
21555                              type, Py_TYPE(value));
21556                 goto bad;
21557             }
21558         }
21559     } else {
21560         PyErr_SetString(PyExc_TypeError,
21561             "raise: exception class must be a subclass of BaseException");
21562         goto bad;
21563     }
21564     if (cause) {
21565         PyObject *fixed_cause;
21566         if (cause == Py_None) {
21567             fixed_cause = NULL;
21568         } else if (PyExceptionClass_Check(cause)) {
21569             fixed_cause = PyObject_CallObject(cause, NULL);
21570             if (fixed_cause == NULL)
21571                 goto bad;
21572         } else if (PyExceptionInstance_Check(cause)) {
21573             fixed_cause = cause;
21574             Py_INCREF(fixed_cause);
21575         } else {
21576             PyErr_SetString(PyExc_TypeError,
21577                             "exception causes must derive from "
21578                             "BaseException");
21579             goto bad;
21580         }
21581         PyException_SetCause(value, fixed_cause);
21582     }
21583     PyErr_SetObject(type, value);
21584     if (tb) {
21585 #if CYTHON_COMPILING_IN_PYPY
21586         PyObject *tmp_type, *tmp_value, *tmp_tb;
21587         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21588         Py_INCREF(tb);
21589         PyErr_Restore(tmp_type, tmp_value, tb);
21590         Py_XDECREF(tmp_tb);
21591 #else
21592         PyThreadState *tstate = __Pyx_PyThreadState_Current;
21593         PyObject* tmp_tb = tstate->curexc_traceback;
21594         if (tb != tmp_tb) {
21595             Py_INCREF(tb);
21596             tstate->curexc_traceback = tb;
21597             Py_XDECREF(tmp_tb);
21598         }
21599 #endif
21600     }
21601 bad:
21602     Py_XDECREF(owned_instance);
21603     return;
21604 }
21605 #endif
21606 
21607 /* DictGetItem */
21608 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)21609 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
21610     PyObject *value;
21611     value = PyDict_GetItemWithError(d, key);
21612     if (unlikely(!value)) {
21613         if (!PyErr_Occurred()) {
21614             if (unlikely(PyTuple_Check(key))) {
21615                 PyObject* args = PyTuple_Pack(1, key);
21616                 if (likely(args)) {
21617                     PyErr_SetObject(PyExc_KeyError, args);
21618                     Py_DECREF(args);
21619                 }
21620             } else {
21621                 PyErr_SetObject(PyExc_KeyError, key);
21622             }
21623         }
21624         return NULL;
21625     }
21626     Py_INCREF(value);
21627     return value;
21628 }
21629 #endif
21630 
21631 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)21632 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
21633     PyErr_Format(PyExc_ValueError,
21634                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
21635 }
21636 
21637 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)21638 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
21639     PyErr_Format(PyExc_ValueError,
21640                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
21641                  index, (index == 1) ? "" : "s");
21642 }
21643 
21644 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)21645 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
21646     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21647 }
21648 
21649 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)21650 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
21651     if (unlikely(!type)) {
21652         PyErr_SetString(PyExc_SystemError, "Missing type object");
21653         return 0;
21654     }
21655     if (likely(__Pyx_TypeCheck(obj, type)))
21656         return 1;
21657     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
21658                  Py_TYPE(obj)->tp_name, type->tp_name);
21659     return 0;
21660 }
21661 
21662 /* GetTopmostException */
21663 #if CYTHON_USE_EXC_INFO_STACK
21664 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)21665 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21666 {
21667     _PyErr_StackItem *exc_info = tstate->exc_info;
21668     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
21669            exc_info->previous_item != NULL)
21670     {
21671         exc_info = exc_info->previous_item;
21672     }
21673     return exc_info;
21674 }
21675 #endif
21676 
21677 /* SaveResetException */
21678 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21679 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21680     #if CYTHON_USE_EXC_INFO_STACK
21681     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21682     *type = exc_info->exc_type;
21683     *value = exc_info->exc_value;
21684     *tb = exc_info->exc_traceback;
21685     #else
21686     *type = tstate->exc_type;
21687     *value = tstate->exc_value;
21688     *tb = tstate->exc_traceback;
21689     #endif
21690     Py_XINCREF(*type);
21691     Py_XINCREF(*value);
21692     Py_XINCREF(*tb);
21693 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)21694 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21695     PyObject *tmp_type, *tmp_value, *tmp_tb;
21696     #if CYTHON_USE_EXC_INFO_STACK
21697     _PyErr_StackItem *exc_info = tstate->exc_info;
21698     tmp_type = exc_info->exc_type;
21699     tmp_value = exc_info->exc_value;
21700     tmp_tb = exc_info->exc_traceback;
21701     exc_info->exc_type = type;
21702     exc_info->exc_value = value;
21703     exc_info->exc_traceback = tb;
21704     #else
21705     tmp_type = tstate->exc_type;
21706     tmp_value = tstate->exc_value;
21707     tmp_tb = tstate->exc_traceback;
21708     tstate->exc_type = type;
21709     tstate->exc_value = value;
21710     tstate->exc_traceback = tb;
21711     #endif
21712     Py_XDECREF(tmp_type);
21713     Py_XDECREF(tmp_value);
21714     Py_XDECREF(tmp_tb);
21715 }
21716 #endif
21717 
21718 /* PyErrExceptionMatches */
21719 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)21720 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21721     Py_ssize_t i, n;
21722     n = PyTuple_GET_SIZE(tuple);
21723 #if PY_MAJOR_VERSION >= 3
21724     for (i=0; i<n; i++) {
21725         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21726     }
21727 #endif
21728     for (i=0; i<n; i++) {
21729         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
21730     }
21731     return 0;
21732 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)21733 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21734     PyObject *exc_type = tstate->curexc_type;
21735     if (exc_type == err) return 1;
21736     if (unlikely(!exc_type)) return 0;
21737     if (unlikely(PyTuple_Check(err)))
21738         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21739     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21740 }
21741 #endif
21742 
21743 /* GetException */
21744 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21745 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21746 #else
21747 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21748 #endif
21749 {
21750     PyObject *local_type, *local_value, *local_tb;
21751 #if CYTHON_FAST_THREAD_STATE
21752     PyObject *tmp_type, *tmp_value, *tmp_tb;
21753     local_type = tstate->curexc_type;
21754     local_value = tstate->curexc_value;
21755     local_tb = tstate->curexc_traceback;
21756     tstate->curexc_type = 0;
21757     tstate->curexc_value = 0;
21758     tstate->curexc_traceback = 0;
21759 #else
21760     PyErr_Fetch(&local_type, &local_value, &local_tb);
21761 #endif
21762     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21763 #if CYTHON_FAST_THREAD_STATE
21764     if (unlikely(tstate->curexc_type))
21765 #else
21766     if (unlikely(PyErr_Occurred()))
21767 #endif
21768         goto bad;
21769     #if PY_MAJOR_VERSION >= 3
21770     if (local_tb) {
21771         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21772             goto bad;
21773     }
21774     #endif
21775     Py_XINCREF(local_tb);
21776     Py_XINCREF(local_type);
21777     Py_XINCREF(local_value);
21778     *type = local_type;
21779     *value = local_value;
21780     *tb = local_tb;
21781 #if CYTHON_FAST_THREAD_STATE
21782     #if CYTHON_USE_EXC_INFO_STACK
21783     {
21784         _PyErr_StackItem *exc_info = tstate->exc_info;
21785         tmp_type = exc_info->exc_type;
21786         tmp_value = exc_info->exc_value;
21787         tmp_tb = exc_info->exc_traceback;
21788         exc_info->exc_type = local_type;
21789         exc_info->exc_value = local_value;
21790         exc_info->exc_traceback = local_tb;
21791     }
21792     #else
21793     tmp_type = tstate->exc_type;
21794     tmp_value = tstate->exc_value;
21795     tmp_tb = tstate->exc_traceback;
21796     tstate->exc_type = local_type;
21797     tstate->exc_value = local_value;
21798     tstate->exc_traceback = local_tb;
21799     #endif
21800     Py_XDECREF(tmp_type);
21801     Py_XDECREF(tmp_value);
21802     Py_XDECREF(tmp_tb);
21803 #else
21804     PyErr_SetExcInfo(local_type, local_value, local_tb);
21805 #endif
21806     return 0;
21807 bad:
21808     *type = 0;
21809     *value = 0;
21810     *tb = 0;
21811     Py_XDECREF(local_type);
21812     Py_XDECREF(local_value);
21813     Py_XDECREF(local_tb);
21814     return -1;
21815 }
21816 
21817 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)21818 static void __Pyx_RaiseArgtupleInvalid(
21819     const char* func_name,
21820     int exact,
21821     Py_ssize_t num_min,
21822     Py_ssize_t num_max,
21823     Py_ssize_t num_found)
21824 {
21825     Py_ssize_t num_expected;
21826     const char *more_or_less;
21827     if (num_found < num_min) {
21828         num_expected = num_min;
21829         more_or_less = "at least";
21830     } else {
21831         num_expected = num_max;
21832         more_or_less = "at most";
21833     }
21834     if (exact) {
21835         more_or_less = "exactly";
21836     }
21837     PyErr_Format(PyExc_TypeError,
21838                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
21839                  func_name, more_or_less, num_expected,
21840                  (num_expected == 1) ? "" : "s", num_found);
21841 }
21842 
21843 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)21844 static void __Pyx_RaiseDoubleKeywordsError(
21845     const char* func_name,
21846     PyObject* kw_name)
21847 {
21848     PyErr_Format(PyExc_TypeError,
21849         #if PY_MAJOR_VERSION >= 3
21850         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21851         #else
21852         "%s() got multiple values for keyword argument '%s'", func_name,
21853         PyString_AsString(kw_name));
21854         #endif
21855 }
21856 
21857 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)21858 static int __Pyx_ParseOptionalKeywords(
21859     PyObject *kwds,
21860     PyObject **argnames[],
21861     PyObject *kwds2,
21862     PyObject *values[],
21863     Py_ssize_t num_pos_args,
21864     const char* function_name)
21865 {
21866     PyObject *key = 0, *value = 0;
21867     Py_ssize_t pos = 0;
21868     PyObject*** name;
21869     PyObject*** first_kw_arg = argnames + num_pos_args;
21870     while (PyDict_Next(kwds, &pos, &key, &value)) {
21871         name = first_kw_arg;
21872         while (*name && (**name != key)) name++;
21873         if (*name) {
21874             values[name-argnames] = value;
21875             continue;
21876         }
21877         name = first_kw_arg;
21878         #if PY_MAJOR_VERSION < 3
21879         if (likely(PyString_Check(key))) {
21880             while (*name) {
21881                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21882                         && _PyString_Eq(**name, key)) {
21883                     values[name-argnames] = value;
21884                     break;
21885                 }
21886                 name++;
21887             }
21888             if (*name) continue;
21889             else {
21890                 PyObject*** argname = argnames;
21891                 while (argname != first_kw_arg) {
21892                     if ((**argname == key) || (
21893                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21894                              && _PyString_Eq(**argname, key))) {
21895                         goto arg_passed_twice;
21896                     }
21897                     argname++;
21898                 }
21899             }
21900         } else
21901         #endif
21902         if (likely(PyUnicode_Check(key))) {
21903             while (*name) {
21904                 int cmp = (**name == key) ? 0 :
21905                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21906                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21907                 #endif
21908                     PyUnicode_Compare(**name, key);
21909                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
21910                 if (cmp == 0) {
21911                     values[name-argnames] = value;
21912                     break;
21913                 }
21914                 name++;
21915             }
21916             if (*name) continue;
21917             else {
21918                 PyObject*** argname = argnames;
21919                 while (argname != first_kw_arg) {
21920                     int cmp = (**argname == key) ? 0 :
21921                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21922                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21923                     #endif
21924                         PyUnicode_Compare(**argname, key);
21925                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
21926                     if (cmp == 0) goto arg_passed_twice;
21927                     argname++;
21928                 }
21929             }
21930         } else
21931             goto invalid_keyword_type;
21932         if (kwds2) {
21933             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
21934         } else {
21935             goto invalid_keyword;
21936         }
21937     }
21938     return 0;
21939 arg_passed_twice:
21940     __Pyx_RaiseDoubleKeywordsError(function_name, key);
21941     goto bad;
21942 invalid_keyword_type:
21943     PyErr_Format(PyExc_TypeError,
21944         "%.200s() keywords must be strings", function_name);
21945     goto bad;
21946 invalid_keyword:
21947     PyErr_Format(PyExc_TypeError,
21948     #if PY_MAJOR_VERSION < 3
21949         "%.200s() got an unexpected keyword argument '%.200s'",
21950         function_name, PyString_AsString(key));
21951     #else
21952         "%s() got an unexpected keyword argument '%U'",
21953         function_name, key);
21954     #endif
21955 bad:
21956     return -1;
21957 }
21958 
21959 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)21960 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
21961 {
21962     if (unlikely(!type)) {
21963         PyErr_SetString(PyExc_SystemError, "Missing type object");
21964         return 0;
21965     }
21966     else if (exact) {
21967         #if PY_MAJOR_VERSION == 2
21968         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
21969         #endif
21970     }
21971     else {
21972         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
21973     }
21974     PyErr_Format(PyExc_TypeError,
21975         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21976         name, type->tp_name, Py_TYPE(obj)->tp_name);
21977     return 0;
21978 }
21979 
21980 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)21981 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
21982 #if CYTHON_COMPILING_IN_PYPY
21983     return PyObject_RichCompareBool(s1, s2, equals);
21984 #else
21985     if (s1 == s2) {
21986         return (equals == Py_EQ);
21987     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21988         const char *ps1, *ps2;
21989         Py_ssize_t length = PyBytes_GET_SIZE(s1);
21990         if (length != PyBytes_GET_SIZE(s2))
21991             return (equals == Py_NE);
21992         ps1 = PyBytes_AS_STRING(s1);
21993         ps2 = PyBytes_AS_STRING(s2);
21994         if (ps1[0] != ps2[0]) {
21995             return (equals == Py_NE);
21996         } else if (length == 1) {
21997             return (equals == Py_EQ);
21998         } else {
21999             int result;
22000 #if CYTHON_USE_UNICODE_INTERNALS
22001             Py_hash_t hash1, hash2;
22002             hash1 = ((PyBytesObject*)s1)->ob_shash;
22003             hash2 = ((PyBytesObject*)s2)->ob_shash;
22004             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22005                 return (equals == Py_NE);
22006             }
22007 #endif
22008             result = memcmp(ps1, ps2, (size_t)length);
22009             return (equals == Py_EQ) ? (result == 0) : (result != 0);
22010         }
22011     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22012         return (equals == Py_NE);
22013     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22014         return (equals == Py_NE);
22015     } else {
22016         int result;
22017         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22018         if (!py_result)
22019             return -1;
22020         result = __Pyx_PyObject_IsTrue(py_result);
22021         Py_DECREF(py_result);
22022         return result;
22023     }
22024 #endif
22025 }
22026 
22027 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)22028 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
22029 #if CYTHON_COMPILING_IN_PYPY
22030     return PyObject_RichCompareBool(s1, s2, equals);
22031 #else
22032 #if PY_MAJOR_VERSION < 3
22033     PyObject* owned_ref = NULL;
22034 #endif
22035     int s1_is_unicode, s2_is_unicode;
22036     if (s1 == s2) {
22037         goto return_eq;
22038     }
22039     s1_is_unicode = PyUnicode_CheckExact(s1);
22040     s2_is_unicode = PyUnicode_CheckExact(s2);
22041 #if PY_MAJOR_VERSION < 3
22042     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22043         owned_ref = PyUnicode_FromObject(s2);
22044         if (unlikely(!owned_ref))
22045             return -1;
22046         s2 = owned_ref;
22047         s2_is_unicode = 1;
22048     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22049         owned_ref = PyUnicode_FromObject(s1);
22050         if (unlikely(!owned_ref))
22051             return -1;
22052         s1 = owned_ref;
22053         s1_is_unicode = 1;
22054     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22055         return __Pyx_PyBytes_Equals(s1, s2, equals);
22056     }
22057 #endif
22058     if (s1_is_unicode & s2_is_unicode) {
22059         Py_ssize_t length;
22060         int kind;
22061         void *data1, *data2;
22062         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22063             return -1;
22064         length = __Pyx_PyUnicode_GET_LENGTH(s1);
22065         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22066             goto return_ne;
22067         }
22068 #if CYTHON_USE_UNICODE_INTERNALS
22069         {
22070             Py_hash_t hash1, hash2;
22071         #if CYTHON_PEP393_ENABLED
22072             hash1 = ((PyASCIIObject*)s1)->hash;
22073             hash2 = ((PyASCIIObject*)s2)->hash;
22074         #else
22075             hash1 = ((PyUnicodeObject*)s1)->hash;
22076             hash2 = ((PyUnicodeObject*)s2)->hash;
22077         #endif
22078             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22079                 goto return_ne;
22080             }
22081         }
22082 #endif
22083         kind = __Pyx_PyUnicode_KIND(s1);
22084         if (kind != __Pyx_PyUnicode_KIND(s2)) {
22085             goto return_ne;
22086         }
22087         data1 = __Pyx_PyUnicode_DATA(s1);
22088         data2 = __Pyx_PyUnicode_DATA(s2);
22089         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22090             goto return_ne;
22091         } else if (length == 1) {
22092             goto return_eq;
22093         } else {
22094             int result = memcmp(data1, data2, (size_t)(length * kind));
22095             #if PY_MAJOR_VERSION < 3
22096             Py_XDECREF(owned_ref);
22097             #endif
22098             return (equals == Py_EQ) ? (result == 0) : (result != 0);
22099         }
22100     } else if ((s1 == Py_None) & s2_is_unicode) {
22101         goto return_ne;
22102     } else if ((s2 == Py_None) & s1_is_unicode) {
22103         goto return_ne;
22104     } else {
22105         int result;
22106         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22107         #if PY_MAJOR_VERSION < 3
22108         Py_XDECREF(owned_ref);
22109         #endif
22110         if (!py_result)
22111             return -1;
22112         result = __Pyx_PyObject_IsTrue(py_result);
22113         Py_DECREF(py_result);
22114         return result;
22115     }
22116 return_eq:
22117     #if PY_MAJOR_VERSION < 3
22118     Py_XDECREF(owned_ref);
22119     #endif
22120     return (equals == Py_EQ);
22121 return_ne:
22122     #if PY_MAJOR_VERSION < 3
22123     Py_XDECREF(owned_ref);
22124     #endif
22125     return (equals == Py_NE);
22126 #endif
22127 }
22128 
22129 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)22130 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
22131 #if CYTHON_USE_TYPE_SLOTS
22132 #if PY_MAJOR_VERSION >= 3
22133     if (likely(PyUnicode_Check(n)))
22134 #else
22135     if (likely(PyString_Check(n)))
22136 #endif
22137         return __Pyx_PyObject_GetAttrStr(o, n);
22138 #endif
22139     return PyObject_GetAttr(o, n);
22140 }
22141 
22142 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)22143 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
22144     PyObject *r;
22145     if (!j) return NULL;
22146     r = PyObject_GetItem(o, j);
22147     Py_DECREF(j);
22148     return r;
22149 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22150 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
22151                                                               CYTHON_NCP_UNUSED int wraparound,
22152                                                               CYTHON_NCP_UNUSED int boundscheck) {
22153 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22154     Py_ssize_t wrapped_i = i;
22155     if (wraparound & unlikely(i < 0)) {
22156         wrapped_i += PyList_GET_SIZE(o);
22157     }
22158     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
22159         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
22160         Py_INCREF(r);
22161         return r;
22162     }
22163     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22164 #else
22165     return PySequence_GetItem(o, i);
22166 #endif
22167 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22168 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
22169                                                               CYTHON_NCP_UNUSED int wraparound,
22170                                                               CYTHON_NCP_UNUSED int boundscheck) {
22171 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22172     Py_ssize_t wrapped_i = i;
22173     if (wraparound & unlikely(i < 0)) {
22174         wrapped_i += PyTuple_GET_SIZE(o);
22175     }
22176     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
22177         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
22178         Py_INCREF(r);
22179         return r;
22180     }
22181     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22182 #else
22183     return PySequence_GetItem(o, i);
22184 #endif
22185 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22186 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
22187                                                      CYTHON_NCP_UNUSED int wraparound,
22188                                                      CYTHON_NCP_UNUSED int boundscheck) {
22189 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22190     if (is_list || PyList_CheckExact(o)) {
22191         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
22192         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
22193             PyObject *r = PyList_GET_ITEM(o, n);
22194             Py_INCREF(r);
22195             return r;
22196         }
22197     }
22198     else if (PyTuple_CheckExact(o)) {
22199         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
22200         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
22201             PyObject *r = PyTuple_GET_ITEM(o, n);
22202             Py_INCREF(r);
22203             return r;
22204         }
22205     } else {
22206         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22207         if (likely(m && m->sq_item)) {
22208             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22209                 Py_ssize_t l = m->sq_length(o);
22210                 if (likely(l >= 0)) {
22211                     i += l;
22212                 } else {
22213                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22214                         return NULL;
22215                     PyErr_Clear();
22216                 }
22217             }
22218             return m->sq_item(o, i);
22219         }
22220     }
22221 #else
22222     if (is_list || PySequence_Check(o)) {
22223         return PySequence_GetItem(o, i);
22224     }
22225 #endif
22226     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22227 }
22228 
22229 /* ObjectGetItem */
22230 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)22231 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
22232     PyObject *runerr;
22233     Py_ssize_t key_value;
22234     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
22235     if (unlikely(!(m && m->sq_item))) {
22236         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
22237         return NULL;
22238     }
22239     key_value = __Pyx_PyIndex_AsSsize_t(index);
22240     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
22241         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
22242     }
22243     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
22244         PyErr_Clear();
22245         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
22246     }
22247     return NULL;
22248 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)22249 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
22250     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
22251     if (likely(m && m->mp_subscript)) {
22252         return m->mp_subscript(obj, key);
22253     }
22254     return __Pyx_PyObject_GetIndex(obj, key);
22255 }
22256 #endif
22257 
22258 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))22259 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
22260          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
22261          const char* encoding, const char* errors,
22262          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
22263     Py_ssize_t length;
22264     if (unlikely((start < 0) | (stop < 0))) {
22265         size_t slen = strlen(cstring);
22266         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
22267             PyErr_SetString(PyExc_OverflowError,
22268                             "c-string too long to convert to Python");
22269             return NULL;
22270         }
22271         length = (Py_ssize_t) slen;
22272         if (start < 0) {
22273             start += length;
22274             if (start < 0)
22275                 start = 0;
22276         }
22277         if (stop < 0)
22278             stop += length;
22279     }
22280     if (unlikely(stop <= start))
22281         return __Pyx_NewRef(__pyx_empty_unicode);
22282     length = stop - start;
22283     cstring += start;
22284     if (decode_func) {
22285         return decode_func(cstring, length, errors);
22286     } else {
22287         return PyUnicode_Decode(cstring, length, encoding, errors);
22288     }
22289 }
22290 
22291 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)22292 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
22293     __Pyx_PyThreadState_declare
22294     __Pyx_PyThreadState_assign
22295     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22296         return NULL;
22297     __Pyx_PyErr_Clear();
22298     Py_INCREF(d);
22299     return d;
22300 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)22301 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
22302     PyObject *r = __Pyx_GetAttr(o, n);
22303     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
22304 }
22305 
22306 /* SwapException */
22307 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)22308 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22309     PyObject *tmp_type, *tmp_value, *tmp_tb;
22310     #if CYTHON_USE_EXC_INFO_STACK
22311     _PyErr_StackItem *exc_info = tstate->exc_info;
22312     tmp_type = exc_info->exc_type;
22313     tmp_value = exc_info->exc_value;
22314     tmp_tb = exc_info->exc_traceback;
22315     exc_info->exc_type = *type;
22316     exc_info->exc_value = *value;
22317     exc_info->exc_traceback = *tb;
22318     #else
22319     tmp_type = tstate->exc_type;
22320     tmp_value = tstate->exc_value;
22321     tmp_tb = tstate->exc_traceback;
22322     tstate->exc_type = *type;
22323     tstate->exc_value = *value;
22324     tstate->exc_traceback = *tb;
22325     #endif
22326     *type = tmp_type;
22327     *value = tmp_value;
22328     *tb = tmp_tb;
22329 }
22330 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)22331 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22332     PyObject *tmp_type, *tmp_value, *tmp_tb;
22333     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22334     PyErr_SetExcInfo(*type, *value, *tb);
22335     *type = tmp_type;
22336     *value = tmp_value;
22337     *tb = tmp_tb;
22338 }
22339 #endif
22340 
22341 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)22342 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
22343     PyObject *empty_list = 0;
22344     PyObject *module = 0;
22345     PyObject *global_dict = 0;
22346     PyObject *empty_dict = 0;
22347     PyObject *list;
22348     #if PY_MAJOR_VERSION < 3
22349     PyObject *py_import;
22350     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
22351     if (!py_import)
22352         goto bad;
22353     #endif
22354     if (from_list)
22355         list = from_list;
22356     else {
22357         empty_list = PyList_New(0);
22358         if (!empty_list)
22359             goto bad;
22360         list = empty_list;
22361     }
22362     global_dict = PyModule_GetDict(__pyx_m);
22363     if (!global_dict)
22364         goto bad;
22365     empty_dict = PyDict_New();
22366     if (!empty_dict)
22367         goto bad;
22368     {
22369         #if PY_MAJOR_VERSION >= 3
22370         if (level == -1) {
22371             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
22372                 module = PyImport_ImportModuleLevelObject(
22373                     name, global_dict, empty_dict, list, 1);
22374                 if (!module) {
22375                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
22376                         goto bad;
22377                     PyErr_Clear();
22378                 }
22379             }
22380             level = 0;
22381         }
22382         #endif
22383         if (!module) {
22384             #if PY_MAJOR_VERSION < 3
22385             PyObject *py_level = PyInt_FromLong(level);
22386             if (!py_level)
22387                 goto bad;
22388             module = PyObject_CallFunctionObjArgs(py_import,
22389                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
22390             Py_DECREF(py_level);
22391             #else
22392             module = PyImport_ImportModuleLevelObject(
22393                 name, global_dict, empty_dict, list, level);
22394             #endif
22395         }
22396     }
22397 bad:
22398     #if PY_MAJOR_VERSION < 3
22399     Py_XDECREF(py_import);
22400     #endif
22401     Py_XDECREF(empty_list);
22402     Py_XDECREF(empty_dict);
22403     return module;
22404 }
22405 
22406 /* FastTypeChecks */
22407 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)22408 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22409     while (a) {
22410         a = a->tp_base;
22411         if (a == b)
22412             return 1;
22413     }
22414     return b == &PyBaseObject_Type;
22415 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)22416 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22417     PyObject *mro;
22418     if (a == b) return 1;
22419     mro = a->tp_mro;
22420     if (likely(mro)) {
22421         Py_ssize_t i, n;
22422         n = PyTuple_GET_SIZE(mro);
22423         for (i = 0; i < n; i++) {
22424             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
22425                 return 1;
22426         }
22427         return 0;
22428     }
22429     return __Pyx_InBases(a, b);
22430 }
22431 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22432 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22433     PyObject *exception, *value, *tb;
22434     int res;
22435     __Pyx_PyThreadState_declare
22436     __Pyx_PyThreadState_assign
22437     __Pyx_ErrFetch(&exception, &value, &tb);
22438     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22439     if (unlikely(res == -1)) {
22440         PyErr_WriteUnraisable(err);
22441         res = 0;
22442     }
22443     if (!res) {
22444         res = PyObject_IsSubclass(err, exc_type2);
22445         if (unlikely(res == -1)) {
22446             PyErr_WriteUnraisable(err);
22447             res = 0;
22448         }
22449     }
22450     __Pyx_ErrRestore(exception, value, tb);
22451     return res;
22452 }
22453 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22454 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22455     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22456     if (!res) {
22457         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22458     }
22459     return res;
22460 }
22461 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)22462 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22463     Py_ssize_t i, n;
22464     assert(PyExceptionClass_Check(exc_type));
22465     n = PyTuple_GET_SIZE(tuple);
22466 #if PY_MAJOR_VERSION >= 3
22467     for (i=0; i<n; i++) {
22468         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22469     }
22470 #endif
22471     for (i=0; i<n; i++) {
22472         PyObject *t = PyTuple_GET_ITEM(tuple, i);
22473         #if PY_MAJOR_VERSION < 3
22474         if (likely(exc_type == t)) return 1;
22475         #endif
22476         if (likely(PyExceptionClass_Check(t))) {
22477             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
22478         } else {
22479         }
22480     }
22481     return 0;
22482 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)22483 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22484     if (likely(err == exc_type)) return 1;
22485     if (likely(PyExceptionClass_Check(err))) {
22486         if (likely(PyExceptionClass_Check(exc_type))) {
22487             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22488         } else if (likely(PyTuple_Check(exc_type))) {
22489             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22490         } else {
22491         }
22492     }
22493     return PyErr_GivenExceptionMatches(err, exc_type);
22494 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22495 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22496     assert(PyExceptionClass_Check(exc_type1));
22497     assert(PyExceptionClass_Check(exc_type2));
22498     if (likely(err == exc_type1 || err == exc_type2)) return 1;
22499     if (likely(PyExceptionClass_Check(err))) {
22500         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22501     }
22502     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22503 }
22504 #endif
22505 
22506 /* PyIntBinop */
22507 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)22508 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
22509     (void)inplace;
22510     (void)zerodivision_check;
22511     #if PY_MAJOR_VERSION < 3
22512     if (likely(PyInt_CheckExact(op1))) {
22513         const long b = intval;
22514         long x;
22515         long a = PyInt_AS_LONG(op1);
22516             x = (long)((unsigned long)a + b);
22517             if (likely((x^a) >= 0 || (x^b) >= 0))
22518                 return PyInt_FromLong(x);
22519             return PyLong_Type.tp_as_number->nb_add(op1, op2);
22520     }
22521     #endif
22522     #if CYTHON_USE_PYLONG_INTERNALS
22523     if (likely(PyLong_CheckExact(op1))) {
22524         const long b = intval;
22525         long a, x;
22526 #ifdef HAVE_LONG_LONG
22527         const PY_LONG_LONG llb = intval;
22528         PY_LONG_LONG lla, llx;
22529 #endif
22530         const digit* digits = ((PyLongObject*)op1)->ob_digit;
22531         const Py_ssize_t size = Py_SIZE(op1);
22532         if (likely(__Pyx_sst_abs(size) <= 1)) {
22533             a = likely(size) ? digits[0] : 0;
22534             if (size == -1) a = -a;
22535         } else {
22536             switch (size) {
22537                 case -2:
22538                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22539                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22540                         break;
22541 #ifdef HAVE_LONG_LONG
22542                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22543                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22544                         goto long_long;
22545 #endif
22546                     }
22547                     CYTHON_FALLTHROUGH;
22548                 case 2:
22549                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22550                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22551                         break;
22552 #ifdef HAVE_LONG_LONG
22553                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22554                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22555                         goto long_long;
22556 #endif
22557                     }
22558                     CYTHON_FALLTHROUGH;
22559                 case -3:
22560                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22561                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22562                         break;
22563 #ifdef HAVE_LONG_LONG
22564                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22565                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22566                         goto long_long;
22567 #endif
22568                     }
22569                     CYTHON_FALLTHROUGH;
22570                 case 3:
22571                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22572                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22573                         break;
22574 #ifdef HAVE_LONG_LONG
22575                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22576                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22577                         goto long_long;
22578 #endif
22579                     }
22580                     CYTHON_FALLTHROUGH;
22581                 case -4:
22582                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22583                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22584                         break;
22585 #ifdef HAVE_LONG_LONG
22586                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22587                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22588                         goto long_long;
22589 #endif
22590                     }
22591                     CYTHON_FALLTHROUGH;
22592                 case 4:
22593                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22594                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22595                         break;
22596 #ifdef HAVE_LONG_LONG
22597                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22598                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22599                         goto long_long;
22600 #endif
22601                     }
22602                     CYTHON_FALLTHROUGH;
22603                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
22604             }
22605         }
22606                 x = a + b;
22607             return PyLong_FromLong(x);
22608 #ifdef HAVE_LONG_LONG
22609         long_long:
22610                 llx = lla + llb;
22611             return PyLong_FromLongLong(llx);
22612 #endif
22613 
22614 
22615     }
22616     #endif
22617     if (PyFloat_CheckExact(op1)) {
22618         const long b = intval;
22619         double a = PyFloat_AS_DOUBLE(op1);
22620             double result;
22621             PyFPE_START_PROTECT("add", return NULL)
22622             result = ((double)a) + (double)b;
22623             PyFPE_END_PROTECT(result)
22624             return PyFloat_FromDouble(result);
22625     }
22626     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
22627 }
22628 #endif
22629 
22630 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)22631 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
22632     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
22633 }
22634 
22635 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)22636 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
22637     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
22638     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22639         PyErr_Format(PyExc_ImportError,
22640         #if PY_MAJOR_VERSION < 3
22641             "cannot import name %.230s", PyString_AS_STRING(name));
22642         #else
22643             "cannot import name %S", name);
22644         #endif
22645     }
22646     return value;
22647 }
22648 
22649 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)22650 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
22651     PyObject *r;
22652     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
22653         PyErr_SetString(PyExc_TypeError,
22654                         "hasattr(): attribute name must be string");
22655         return -1;
22656     }
22657     r = __Pyx_GetAttr(o, n);
22658     if (unlikely(!r)) {
22659         PyErr_Clear();
22660         return 0;
22661     } else {
22662         Py_DECREF(r);
22663         return 1;
22664     }
22665 }
22666 
22667 /* PyObject_GenericGetAttrNoDict */
22668 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)22669 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
22670     PyErr_Format(PyExc_AttributeError,
22671 #if PY_MAJOR_VERSION >= 3
22672                  "'%.50s' object has no attribute '%U'",
22673                  tp->tp_name, attr_name);
22674 #else
22675                  "'%.50s' object has no attribute '%.400s'",
22676                  tp->tp_name, PyString_AS_STRING(attr_name));
22677 #endif
22678     return NULL;
22679 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)22680 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
22681     PyObject *descr;
22682     PyTypeObject *tp = Py_TYPE(obj);
22683     if (unlikely(!PyString_Check(attr_name))) {
22684         return PyObject_GenericGetAttr(obj, attr_name);
22685     }
22686     assert(!tp->tp_dictoffset);
22687     descr = _PyType_Lookup(tp, attr_name);
22688     if (unlikely(!descr)) {
22689         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
22690     }
22691     Py_INCREF(descr);
22692     #if PY_MAJOR_VERSION < 3
22693     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
22694     #endif
22695     {
22696         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
22697         if (unlikely(f)) {
22698             PyObject *res = f(descr, obj, (PyObject *)tp);
22699             Py_DECREF(descr);
22700             return res;
22701         }
22702     }
22703     return descr;
22704 }
22705 #endif
22706 
22707 /* PyObject_GenericGetAttr */
22708 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)22709 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
22710     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
22711         return PyObject_GenericGetAttr(obj, attr_name);
22712     }
22713     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
22714 }
22715 #endif
22716 
22717 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)22718 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
22719 #if PY_VERSION_HEX >= 0x02070000
22720     PyObject *ob = PyCapsule_New(vtable, 0, 0);
22721 #else
22722     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22723 #endif
22724     if (!ob)
22725         goto bad;
22726     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22727         goto bad;
22728     Py_DECREF(ob);
22729     return 0;
22730 bad:
22731     Py_XDECREF(ob);
22732     return -1;
22733 }
22734 
22735 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)22736 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
22737     __Pyx_PyThreadState_declare
22738     __Pyx_PyThreadState_assign
22739     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22740         __Pyx_PyErr_Clear();
22741 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)22742 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
22743     PyObject *result;
22744 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
22745     PyTypeObject* tp = Py_TYPE(obj);
22746     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
22747         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
22748     }
22749 #endif
22750     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
22751     if (unlikely(!result)) {
22752         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
22753     }
22754     return result;
22755 }
22756 
22757 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)22758 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
22759   int ret;
22760   PyObject *name_attr;
22761   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
22762   if (likely(name_attr)) {
22763       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
22764   } else {
22765       ret = -1;
22766   }
22767   if (unlikely(ret < 0)) {
22768       PyErr_Clear();
22769       ret = 0;
22770   }
22771   Py_XDECREF(name_attr);
22772   return ret;
22773 }
__Pyx_setup_reduce(PyObject * type_obj)22774 static int __Pyx_setup_reduce(PyObject* type_obj) {
22775     int ret = 0;
22776     PyObject *object_reduce = NULL;
22777     PyObject *object_reduce_ex = NULL;
22778     PyObject *reduce = NULL;
22779     PyObject *reduce_ex = NULL;
22780     PyObject *reduce_cython = NULL;
22781     PyObject *setstate = NULL;
22782     PyObject *setstate_cython = NULL;
22783 #if CYTHON_USE_PYTYPE_LOOKUP
22784     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
22785 #else
22786     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
22787 #endif
22788 #if CYTHON_USE_PYTYPE_LOOKUP
22789     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
22790 #else
22791     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
22792 #endif
22793     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
22794     if (reduce_ex == object_reduce_ex) {
22795 #if CYTHON_USE_PYTYPE_LOOKUP
22796         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
22797 #else
22798         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
22799 #endif
22800         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
22801         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22802             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
22803             if (likely(reduce_cython)) {
22804                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22805                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22806             } else if (reduce == object_reduce || PyErr_Occurred()) {
22807                 goto __PYX_BAD;
22808             }
22809             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22810             if (!setstate) PyErr_Clear();
22811             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22812                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
22813                 if (likely(setstate_cython)) {
22814                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22815                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22816                 } else if (!setstate || PyErr_Occurred()) {
22817                     goto __PYX_BAD;
22818                 }
22819             }
22820             PyType_Modified((PyTypeObject*)type_obj);
22821         }
22822     }
22823     goto __PYX_GOOD;
22824 __PYX_BAD:
22825     if (!PyErr_Occurred())
22826         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22827     ret = -1;
22828 __PYX_GOOD:
22829 #if !CYTHON_USE_PYTYPE_LOOKUP
22830     Py_XDECREF(object_reduce);
22831     Py_XDECREF(object_reduce_ex);
22832 #endif
22833     Py_XDECREF(reduce);
22834     Py_XDECREF(reduce_ex);
22835     Py_XDECREF(reduce_cython);
22836     Py_XDECREF(setstate);
22837     Py_XDECREF(setstate_cython);
22838     return ret;
22839 }
22840 
22841 /* TypeImport */
22842 #ifndef __PYX_HAVE_RT_ImportType
22843 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)22844 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
22845     size_t size, enum __Pyx_ImportType_CheckSize check_size)
22846 {
22847     PyObject *result = 0;
22848     char warning[200];
22849     Py_ssize_t basicsize;
22850 #ifdef Py_LIMITED_API
22851     PyObject *py_basicsize;
22852 #endif
22853     result = PyObject_GetAttrString(module, class_name);
22854     if (!result)
22855         goto bad;
22856     if (!PyType_Check(result)) {
22857         PyErr_Format(PyExc_TypeError,
22858             "%.200s.%.200s is not a type object",
22859             module_name, class_name);
22860         goto bad;
22861     }
22862 #ifndef Py_LIMITED_API
22863     basicsize = ((PyTypeObject *)result)->tp_basicsize;
22864 #else
22865     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
22866     if (!py_basicsize)
22867         goto bad;
22868     basicsize = PyLong_AsSsize_t(py_basicsize);
22869     Py_DECREF(py_basicsize);
22870     py_basicsize = 0;
22871     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
22872         goto bad;
22873 #endif
22874     if ((size_t)basicsize < size) {
22875         PyErr_Format(PyExc_ValueError,
22876             "%.200s.%.200s size changed, may indicate binary incompatibility. "
22877             "Expected %zd from C header, got %zd from PyObject",
22878             module_name, class_name, size, basicsize);
22879         goto bad;
22880     }
22881     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
22882         PyErr_Format(PyExc_ValueError,
22883             "%.200s.%.200s size changed, may indicate binary incompatibility. "
22884             "Expected %zd from C header, got %zd from PyObject",
22885             module_name, class_name, size, basicsize);
22886         goto bad;
22887     }
22888     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
22889         PyOS_snprintf(warning, sizeof(warning),
22890             "%s.%s size changed, may indicate binary incompatibility. "
22891             "Expected %zd from C header, got %zd from PyObject",
22892             module_name, class_name, size, basicsize);
22893         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
22894     }
22895     return (PyTypeObject *)result;
22896 bad:
22897     Py_XDECREF(result);
22898     return NULL;
22899 }
22900 #endif
22901 
22902 /* CLineInTraceback */
22903 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)22904 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
22905     PyObject *use_cline;
22906     PyObject *ptype, *pvalue, *ptraceback;
22907 #if CYTHON_COMPILING_IN_CPYTHON
22908     PyObject **cython_runtime_dict;
22909 #endif
22910     if (unlikely(!__pyx_cython_runtime)) {
22911         return c_line;
22912     }
22913     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22914 #if CYTHON_COMPILING_IN_CPYTHON
22915     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22916     if (likely(cython_runtime_dict)) {
22917         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22918             use_cline, *cython_runtime_dict,
22919             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22920     } else
22921 #endif
22922     {
22923       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22924       if (use_cline_obj) {
22925         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22926         Py_DECREF(use_cline_obj);
22927       } else {
22928         PyErr_Clear();
22929         use_cline = NULL;
22930       }
22931     }
22932     if (!use_cline) {
22933         c_line = 0;
22934         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22935     }
22936     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
22937         c_line = 0;
22938     }
22939     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22940     return c_line;
22941 }
22942 #endif
22943 
22944 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)22945 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
22946     int start = 0, mid = 0, end = count - 1;
22947     if (end >= 0 && code_line > entries[end].code_line) {
22948         return count;
22949     }
22950     while (start < end) {
22951         mid = start + (end - start) / 2;
22952         if (code_line < entries[mid].code_line) {
22953             end = mid;
22954         } else if (code_line > entries[mid].code_line) {
22955              start = mid + 1;
22956         } else {
22957             return mid;
22958         }
22959     }
22960     if (code_line <= entries[mid].code_line) {
22961         return mid;
22962     } else {
22963         return mid + 1;
22964     }
22965 }
__pyx_find_code_object(int code_line)22966 static PyCodeObject *__pyx_find_code_object(int code_line) {
22967     PyCodeObject* code_object;
22968     int pos;
22969     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22970         return NULL;
22971     }
22972     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22973     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22974         return NULL;
22975     }
22976     code_object = __pyx_code_cache.entries[pos].code_object;
22977     Py_INCREF(code_object);
22978     return code_object;
22979 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)22980 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
22981     int pos, i;
22982     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22983     if (unlikely(!code_line)) {
22984         return;
22985     }
22986     if (unlikely(!entries)) {
22987         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
22988         if (likely(entries)) {
22989             __pyx_code_cache.entries = entries;
22990             __pyx_code_cache.max_count = 64;
22991             __pyx_code_cache.count = 1;
22992             entries[0].code_line = code_line;
22993             entries[0].code_object = code_object;
22994             Py_INCREF(code_object);
22995         }
22996         return;
22997     }
22998     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22999     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
23000         PyCodeObject* tmp = entries[pos].code_object;
23001         entries[pos].code_object = code_object;
23002         Py_DECREF(tmp);
23003         return;
23004     }
23005     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23006         int new_max = __pyx_code_cache.max_count + 64;
23007         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23008             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
23009         if (unlikely(!entries)) {
23010             return;
23011         }
23012         __pyx_code_cache.entries = entries;
23013         __pyx_code_cache.max_count = new_max;
23014     }
23015     for (i=__pyx_code_cache.count; i>pos; i--) {
23016         entries[i] = entries[i-1];
23017     }
23018     entries[pos].code_line = code_line;
23019     entries[pos].code_object = code_object;
23020     __pyx_code_cache.count++;
23021     Py_INCREF(code_object);
23022 }
23023 
23024 /* AddTraceback */
23025 #include "compile.h"
23026 #include "frameobject.h"
23027 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)23028 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23029             const char *funcname, int c_line,
23030             int py_line, const char *filename) {
23031     PyCodeObject *py_code = 0;
23032     PyObject *py_srcfile = 0;
23033     PyObject *py_funcname = 0;
23034     #if PY_MAJOR_VERSION < 3
23035     py_srcfile = PyString_FromString(filename);
23036     #else
23037     py_srcfile = PyUnicode_FromString(filename);
23038     #endif
23039     if (!py_srcfile) goto bad;
23040     if (c_line) {
23041         #if PY_MAJOR_VERSION < 3
23042         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23043         #else
23044         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23045         #endif
23046     }
23047     else {
23048         #if PY_MAJOR_VERSION < 3
23049         py_funcname = PyString_FromString(funcname);
23050         #else
23051         py_funcname = PyUnicode_FromString(funcname);
23052         #endif
23053     }
23054     if (!py_funcname) goto bad;
23055     py_code = __Pyx_PyCode_New(
23056         0,
23057         0,
23058         0,
23059         0,
23060         0,
23061         __pyx_empty_bytes, /*PyObject *code,*/
23062         __pyx_empty_tuple, /*PyObject *consts,*/
23063         __pyx_empty_tuple, /*PyObject *names,*/
23064         __pyx_empty_tuple, /*PyObject *varnames,*/
23065         __pyx_empty_tuple, /*PyObject *freevars,*/
23066         __pyx_empty_tuple, /*PyObject *cellvars,*/
23067         py_srcfile,   /*PyObject *filename,*/
23068         py_funcname,  /*PyObject *name,*/
23069         py_line,
23070         __pyx_empty_bytes  /*PyObject *lnotab*/
23071     );
23072     Py_DECREF(py_srcfile);
23073     Py_DECREF(py_funcname);
23074     return py_code;
23075 bad:
23076     Py_XDECREF(py_srcfile);
23077     Py_XDECREF(py_funcname);
23078     return NULL;
23079 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)23080 static void __Pyx_AddTraceback(const char *funcname, int c_line,
23081                                int py_line, const char *filename) {
23082     PyCodeObject *py_code = 0;
23083     PyFrameObject *py_frame = 0;
23084     PyThreadState *tstate = __Pyx_PyThreadState_Current;
23085     if (c_line) {
23086         c_line = __Pyx_CLineForTraceback(tstate, c_line);
23087     }
23088     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23089     if (!py_code) {
23090         py_code = __Pyx_CreateCodeObjectForTraceback(
23091             funcname, c_line, py_line, filename);
23092         if (!py_code) goto bad;
23093         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23094     }
23095     py_frame = PyFrame_New(
23096         tstate,            /*PyThreadState *tstate,*/
23097         py_code,           /*PyCodeObject *code,*/
23098         __pyx_d,    /*PyObject *globals,*/
23099         0                  /*PyObject *locals*/
23100     );
23101     if (!py_frame) goto bad;
23102     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23103     PyTraceBack_Here(py_frame);
23104 bad:
23105     Py_XDECREF(py_code);
23106     Py_XDECREF(py_frame);
23107 }
23108 
23109 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)23110 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
23111     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
23112         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
23113         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
23114         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
23115     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
23116     return -1;
23117 }
__Pyx_ReleaseBuffer(Py_buffer * view)23118 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
23119     PyObject *obj = view->obj;
23120     if (!obj) return;
23121     if (PyObject_CheckBuffer(obj)) {
23122         PyBuffer_Release(view);
23123         return;
23124     }
23125     if ((0)) {}
23126         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
23127     view->obj = NULL;
23128     Py_DECREF(obj);
23129 }
23130 #endif
23131 
23132 
23133 /* MemviewSliceIsContig */
23134 static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)23135 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
23136 {
23137     int i, index, step, start;
23138     Py_ssize_t itemsize = mvs.memview->view.itemsize;
23139     if (order == 'F') {
23140         step = 1;
23141         start = 0;
23142     } else {
23143         step = -1;
23144         start = ndim - 1;
23145     }
23146     for (i = 0; i < ndim; i++) {
23147         index = start + step * i;
23148         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
23149             return 0;
23150         itemsize *= mvs.shape[index];
23151     }
23152     return 1;
23153 }
23154 
23155 /* OverlappingSlices */
23156 static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)23157 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
23158                                void **out_start, void **out_end,
23159                                int ndim, size_t itemsize)
23160 {
23161     char *start, *end;
23162     int i;
23163     start = end = slice->data;
23164     for (i = 0; i < ndim; i++) {
23165         Py_ssize_t stride = slice->strides[i];
23166         Py_ssize_t extent = slice->shape[i];
23167         if (extent == 0) {
23168             *out_start = *out_end = start;
23169             return;
23170         } else {
23171             if (stride > 0)
23172                 end += stride * (extent - 1);
23173             else
23174                 start += stride * (extent - 1);
23175         }
23176     }
23177     *out_start = start;
23178     *out_end = end + itemsize;
23179 }
23180 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)23181 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
23182                      __Pyx_memviewslice *slice2,
23183                      int ndim, size_t itemsize)
23184 {
23185     void *start1, *end1, *start2, *end2;
23186     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
23187     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
23188     return (start1 < end2) && (start2 < end1);
23189 }
23190 
23191 /* Capsule */
23192 static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)23193 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
23194 {
23195     PyObject *cobj;
23196 #if PY_VERSION_HEX >= 0x02070000
23197     cobj = PyCapsule_New(p, sig, NULL);
23198 #else
23199     cobj = PyCObject_FromVoidPtr(p, NULL);
23200 #endif
23201     return cobj;
23202 }
23203 
23204 /* Declarations */
23205 #if CYTHON_CCOMPLEX
23206   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)23207     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23208       return ::std::complex< double >(x, y);
23209     }
23210   #else
__pyx_t_double_complex_from_parts(double x,double y)23211     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23212       return x + y*(__pyx_t_double_complex)_Complex_I;
23213     }
23214   #endif
23215 #else
__pyx_t_double_complex_from_parts(double x,double y)23216     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23217       __pyx_t_double_complex z;
23218       z.real = x;
23219       z.imag = y;
23220       return z;
23221     }
23222 #endif
23223 
23224 /* Arithmetic */
23225 #if CYTHON_CCOMPLEX
23226 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23227     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23228        return (a.real == b.real) && (a.imag == b.imag);
23229     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23230     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23231         __pyx_t_double_complex z;
23232         z.real = a.real + b.real;
23233         z.imag = a.imag + b.imag;
23234         return z;
23235     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23236     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23237         __pyx_t_double_complex z;
23238         z.real = a.real - b.real;
23239         z.imag = a.imag - b.imag;
23240         return z;
23241     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23242     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23243         __pyx_t_double_complex z;
23244         z.real = a.real * b.real - a.imag * b.imag;
23245         z.imag = a.real * b.imag + a.imag * b.real;
23246         return z;
23247     }
23248     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23249     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23250         if (b.imag == 0) {
23251             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23252         } else if (fabs(b.real) >= fabs(b.imag)) {
23253             if (b.real == 0 && b.imag == 0) {
23254                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
23255             } else {
23256                 double r = b.imag / b.real;
23257                 double s = (double)(1.0) / (b.real + b.imag * r);
23258                 return __pyx_t_double_complex_from_parts(
23259                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
23260             }
23261         } else {
23262             double r = b.real / b.imag;
23263             double s = (double)(1.0) / (b.imag + b.real * r);
23264             return __pyx_t_double_complex_from_parts(
23265                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
23266         }
23267     }
23268     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23269     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23270         if (b.imag == 0) {
23271             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23272         } else {
23273             double denom = b.real * b.real + b.imag * b.imag;
23274             return __pyx_t_double_complex_from_parts(
23275                 (a.real * b.real + a.imag * b.imag) / denom,
23276                 (a.imag * b.real - a.real * b.imag) / denom);
23277         }
23278     }
23279     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)23280     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
23281         __pyx_t_double_complex z;
23282         z.real = -a.real;
23283         z.imag = -a.imag;
23284         return z;
23285     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)23286     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
23287        return (a.real == 0) && (a.imag == 0);
23288     }
__Pyx_c_conj_double(__pyx_t_double_complex a)23289     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
23290         __pyx_t_double_complex z;
23291         z.real =  a.real;
23292         z.imag = -a.imag;
23293         return z;
23294     }
23295     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)23296         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
23297           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
23298             return sqrt(z.real*z.real + z.imag*z.imag);
23299           #else
23300             return hypot(z.real, z.imag);
23301           #endif
23302         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23303         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23304             __pyx_t_double_complex z;
23305             double r, lnr, theta, z_r, z_theta;
23306             if (b.imag == 0 && b.real == (int)b.real) {
23307                 if (b.real < 0) {
23308                     double denom = a.real * a.real + a.imag * a.imag;
23309                     a.real = a.real / denom;
23310                     a.imag = -a.imag / denom;
23311                     b.real = -b.real;
23312                 }
23313                 switch ((int)b.real) {
23314                     case 0:
23315                         z.real = 1;
23316                         z.imag = 0;
23317                         return z;
23318                     case 1:
23319                         return a;
23320                     case 2:
23321                         return __Pyx_c_prod_double(a, a);
23322                     case 3:
23323                         z = __Pyx_c_prod_double(a, a);
23324                         return __Pyx_c_prod_double(z, a);
23325                     case 4:
23326                         z = __Pyx_c_prod_double(a, a);
23327                         return __Pyx_c_prod_double(z, z);
23328                 }
23329             }
23330             if (a.imag == 0) {
23331                 if (a.real == 0) {
23332                     return a;
23333                 } else if (b.imag == 0) {
23334                     z.real = pow(a.real, b.real);
23335                     z.imag = 0;
23336                     return z;
23337                 } else if (a.real > 0) {
23338                     r = a.real;
23339                     theta = 0;
23340                 } else {
23341                     r = -a.real;
23342                     theta = atan2(0.0, -1.0);
23343                 }
23344             } else {
23345                 r = __Pyx_c_abs_double(a);
23346                 theta = atan2(a.imag, a.real);
23347             }
23348             lnr = log(r);
23349             z_r = exp(lnr * b.real - theta * b.imag);
23350             z_theta = theta * b.real + lnr * b.imag;
23351             z.real = z_r * cos(z_theta);
23352             z.imag = z_r * sin(z_theta);
23353             return z;
23354         }
23355     #endif
23356 #endif
23357 
23358 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)23359 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
23360 {
23361   union {
23362     uint32_t u32;
23363     uint8_t u8[4];
23364   } S;
23365   S.u32 = 0x01020304;
23366   return S.u8[0] == 4;
23367 }
23368 
23369 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)23370 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
23371                               __Pyx_BufFmt_StackElem* stack,
23372                               __Pyx_TypeInfo* type) {
23373   stack[0].field = &ctx->root;
23374   stack[0].parent_offset = 0;
23375   ctx->root.type = type;
23376   ctx->root.name = "buffer dtype";
23377   ctx->root.offset = 0;
23378   ctx->head = stack;
23379   ctx->head->field = &ctx->root;
23380   ctx->fmt_offset = 0;
23381   ctx->head->parent_offset = 0;
23382   ctx->new_packmode = '@';
23383   ctx->enc_packmode = '@';
23384   ctx->new_count = 1;
23385   ctx->enc_count = 0;
23386   ctx->enc_type = 0;
23387   ctx->is_complex = 0;
23388   ctx->is_valid_array = 0;
23389   ctx->struct_alignment = 0;
23390   while (type->typegroup == 'S') {
23391     ++ctx->head;
23392     ctx->head->field = type->fields;
23393     ctx->head->parent_offset = 0;
23394     type = type->fields->type;
23395   }
23396 }
__Pyx_BufFmt_ParseNumber(const char ** ts)23397 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
23398     int count;
23399     const char* t = *ts;
23400     if (*t < '0' || *t > '9') {
23401       return -1;
23402     } else {
23403         count = *t++ - '0';
23404         while (*t >= '0' && *t <= '9') {
23405             count *= 10;
23406             count += *t++ - '0';
23407         }
23408     }
23409     *ts = t;
23410     return count;
23411 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)23412 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
23413     int number = __Pyx_BufFmt_ParseNumber(ts);
23414     if (number == -1)
23415         PyErr_Format(PyExc_ValueError,\
23416                      "Does not understand character buffer dtype format string ('%c')", **ts);
23417     return number;
23418 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)23419 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
23420   PyErr_Format(PyExc_ValueError,
23421                "Unexpected format string character: '%c'", ch);
23422 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)23423 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
23424   switch (ch) {
23425     case '?': return "'bool'";
23426     case 'c': return "'char'";
23427     case 'b': return "'signed char'";
23428     case 'B': return "'unsigned char'";
23429     case 'h': return "'short'";
23430     case 'H': return "'unsigned short'";
23431     case 'i': return "'int'";
23432     case 'I': return "'unsigned int'";
23433     case 'l': return "'long'";
23434     case 'L': return "'unsigned long'";
23435     case 'q': return "'long long'";
23436     case 'Q': return "'unsigned long long'";
23437     case 'f': return (is_complex ? "'complex float'" : "'float'");
23438     case 'd': return (is_complex ? "'complex double'" : "'double'");
23439     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
23440     case 'T': return "a struct";
23441     case 'O': return "Python object";
23442     case 'P': return "a pointer";
23443     case 's': case 'p': return "a string";
23444     case 0: return "end";
23445     default: return "unparseable format string";
23446   }
23447 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)23448 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
23449   switch (ch) {
23450     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
23451     case 'h': case 'H': return 2;
23452     case 'i': case 'I': case 'l': case 'L': return 4;
23453     case 'q': case 'Q': return 8;
23454     case 'f': return (is_complex ? 8 : 4);
23455     case 'd': return (is_complex ? 16 : 8);
23456     case 'g': {
23457       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
23458       return 0;
23459     }
23460     case 'O': case 'P': return sizeof(void*);
23461     default:
23462       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23463       return 0;
23464     }
23465 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)23466 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
23467   switch (ch) {
23468     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
23469     case 'h': case 'H': return sizeof(short);
23470     case 'i': case 'I': return sizeof(int);
23471     case 'l': case 'L': return sizeof(long);
23472     #ifdef HAVE_LONG_LONG
23473     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
23474     #endif
23475     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
23476     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
23477     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
23478     case 'O': case 'P': return sizeof(void*);
23479     default: {
23480       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23481       return 0;
23482     }
23483   }
23484 }
23485 typedef struct { char c; short x; } __Pyx_st_short;
23486 typedef struct { char c; int x; } __Pyx_st_int;
23487 typedef struct { char c; long x; } __Pyx_st_long;
23488 typedef struct { char c; float x; } __Pyx_st_float;
23489 typedef struct { char c; double x; } __Pyx_st_double;
23490 typedef struct { char c; long double x; } __Pyx_st_longdouble;
23491 typedef struct { char c; void *x; } __Pyx_st_void_p;
23492 #ifdef HAVE_LONG_LONG
23493 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
23494 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)23495 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
23496   switch (ch) {
23497     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
23498     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
23499     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
23500     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
23501 #ifdef HAVE_LONG_LONG
23502     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
23503 #endif
23504     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
23505     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
23506     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
23507     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
23508     default:
23509       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23510       return 0;
23511     }
23512 }
23513 /* These are for computing the padding at the end of the struct to align
23514    on the first member of the struct. This will probably the same as above,
23515    but we don't have any guarantees.
23516  */
23517 typedef struct { short x; char c; } __Pyx_pad_short;
23518 typedef struct { int x; char c; } __Pyx_pad_int;
23519 typedef struct { long x; char c; } __Pyx_pad_long;
23520 typedef struct { float x; char c; } __Pyx_pad_float;
23521 typedef struct { double x; char c; } __Pyx_pad_double;
23522 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
23523 typedef struct { void *x; char c; } __Pyx_pad_void_p;
23524 #ifdef HAVE_LONG_LONG
23525 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
23526 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)23527 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
23528   switch (ch) {
23529     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
23530     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
23531     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
23532     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
23533 #ifdef HAVE_LONG_LONG
23534     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
23535 #endif
23536     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
23537     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
23538     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
23539     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
23540     default:
23541       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23542       return 0;
23543     }
23544 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)23545 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
23546   switch (ch) {
23547     case 'c':
23548         return 'H';
23549     case 'b': case 'h': case 'i':
23550     case 'l': case 'q': case 's': case 'p':
23551         return 'I';
23552     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
23553         return 'U';
23554     case 'f': case 'd': case 'g':
23555         return (is_complex ? 'C' : 'R');
23556     case 'O':
23557         return 'O';
23558     case 'P':
23559         return 'P';
23560     default: {
23561       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23562       return 0;
23563     }
23564   }
23565 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)23566 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
23567   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
23568     const char* expected;
23569     const char* quote;
23570     if (ctx->head == NULL) {
23571       expected = "end";
23572       quote = "";
23573     } else {
23574       expected = ctx->head->field->type->name;
23575       quote = "'";
23576     }
23577     PyErr_Format(PyExc_ValueError,
23578                  "Buffer dtype mismatch, expected %s%s%s but got %s",
23579                  quote, expected, quote,
23580                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
23581   } else {
23582     __Pyx_StructField* field = ctx->head->field;
23583     __Pyx_StructField* parent = (ctx->head - 1)->field;
23584     PyErr_Format(PyExc_ValueError,
23585                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
23586                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
23587                  parent->type->name, field->name);
23588   }
23589 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)23590 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
23591   char group;
23592   size_t size, offset, arraysize = 1;
23593   if (ctx->enc_type == 0) return 0;
23594   if (ctx->head->field->type->arraysize[0]) {
23595     int i, ndim = 0;
23596     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
23597         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
23598         ndim = 1;
23599         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
23600             PyErr_Format(PyExc_ValueError,
23601                          "Expected a dimension of size %zu, got %zu",
23602                          ctx->head->field->type->arraysize[0], ctx->enc_count);
23603             return -1;
23604         }
23605     }
23606     if (!ctx->is_valid_array) {
23607       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
23608                    ctx->head->field->type->ndim, ndim);
23609       return -1;
23610     }
23611     for (i = 0; i < ctx->head->field->type->ndim; i++) {
23612       arraysize *= ctx->head->field->type->arraysize[i];
23613     }
23614     ctx->is_valid_array = 0;
23615     ctx->enc_count = 1;
23616   }
23617   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
23618   do {
23619     __Pyx_StructField* field = ctx->head->field;
23620     __Pyx_TypeInfo* type = field->type;
23621     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
23622       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
23623     } else {
23624       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
23625     }
23626     if (ctx->enc_packmode == '@') {
23627       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
23628       size_t align_mod_offset;
23629       if (align_at == 0) return -1;
23630       align_mod_offset = ctx->fmt_offset % align_at;
23631       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
23632       if (ctx->struct_alignment == 0)
23633           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
23634                                                                  ctx->is_complex);
23635     }
23636     if (type->size != size || type->typegroup != group) {
23637       if (type->typegroup == 'C' && type->fields != NULL) {
23638         size_t parent_offset = ctx->head->parent_offset + field->offset;
23639         ++ctx->head;
23640         ctx->head->field = type->fields;
23641         ctx->head->parent_offset = parent_offset;
23642         continue;
23643       }
23644       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
23645       } else {
23646           __Pyx_BufFmt_RaiseExpected(ctx);
23647           return -1;
23648       }
23649     }
23650     offset = ctx->head->parent_offset + field->offset;
23651     if (ctx->fmt_offset != offset) {
23652       PyErr_Format(PyExc_ValueError,
23653                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
23654                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
23655       return -1;
23656     }
23657     ctx->fmt_offset += size;
23658     if (arraysize)
23659       ctx->fmt_offset += (arraysize - 1) * size;
23660     --ctx->enc_count;
23661     while (1) {
23662       if (field == &ctx->root) {
23663         ctx->head = NULL;
23664         if (ctx->enc_count != 0) {
23665           __Pyx_BufFmt_RaiseExpected(ctx);
23666           return -1;
23667         }
23668         break;
23669       }
23670       ctx->head->field = ++field;
23671       if (field->type == NULL) {
23672         --ctx->head;
23673         field = ctx->head->field;
23674         continue;
23675       } else if (field->type->typegroup == 'S') {
23676         size_t parent_offset = ctx->head->parent_offset + field->offset;
23677         if (field->type->fields->type == NULL) continue;
23678         field = field->type->fields;
23679         ++ctx->head;
23680         ctx->head->field = field;
23681         ctx->head->parent_offset = parent_offset;
23682         break;
23683       } else {
23684         break;
23685       }
23686     }
23687   } while (ctx->enc_count);
23688   ctx->enc_type = 0;
23689   ctx->is_complex = 0;
23690   return 0;
23691 }
23692 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)23693 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
23694 {
23695     const char *ts = *tsp;
23696     int i = 0, number, ndim;
23697     ++ts;
23698     if (ctx->new_count != 1) {
23699         PyErr_SetString(PyExc_ValueError,
23700                         "Cannot handle repeated arrays in format string");
23701         return NULL;
23702     }
23703     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23704     ndim = ctx->head->field->type->ndim;
23705     while (*ts && *ts != ')') {
23706         switch (*ts) {
23707             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
23708             default:  break;
23709         }
23710         number = __Pyx_BufFmt_ExpectNumber(&ts);
23711         if (number == -1) return NULL;
23712         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
23713             return PyErr_Format(PyExc_ValueError,
23714                         "Expected a dimension of size %zu, got %d",
23715                         ctx->head->field->type->arraysize[i], number);
23716         if (*ts != ',' && *ts != ')')
23717             return PyErr_Format(PyExc_ValueError,
23718                                 "Expected a comma in format string, got '%c'", *ts);
23719         if (*ts == ',') ts++;
23720         i++;
23721     }
23722     if (i != ndim)
23723         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
23724                             ctx->head->field->type->ndim, i);
23725     if (!*ts) {
23726         PyErr_SetString(PyExc_ValueError,
23727                         "Unexpected end of format string, expected ')'");
23728         return NULL;
23729     }
23730     ctx->is_valid_array = 1;
23731     ctx->new_count = 1;
23732     *tsp = ++ts;
23733     return Py_None;
23734 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)23735 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
23736   int got_Z = 0;
23737   while (1) {
23738     switch(*ts) {
23739       case 0:
23740         if (ctx->enc_type != 0 && ctx->head == NULL) {
23741           __Pyx_BufFmt_RaiseExpected(ctx);
23742           return NULL;
23743         }
23744         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23745         if (ctx->head != NULL) {
23746           __Pyx_BufFmt_RaiseExpected(ctx);
23747           return NULL;
23748         }
23749         return ts;
23750       case ' ':
23751       case '\r':
23752       case '\n':
23753         ++ts;
23754         break;
23755       case '<':
23756         if (!__Pyx_Is_Little_Endian()) {
23757           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
23758           return NULL;
23759         }
23760         ctx->new_packmode = '=';
23761         ++ts;
23762         break;
23763       case '>':
23764       case '!':
23765         if (__Pyx_Is_Little_Endian()) {
23766           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
23767           return NULL;
23768         }
23769         ctx->new_packmode = '=';
23770         ++ts;
23771         break;
23772       case '=':
23773       case '@':
23774       case '^':
23775         ctx->new_packmode = *ts++;
23776         break;
23777       case 'T':
23778         {
23779           const char* ts_after_sub;
23780           size_t i, struct_count = ctx->new_count;
23781           size_t struct_alignment = ctx->struct_alignment;
23782           ctx->new_count = 1;
23783           ++ts;
23784           if (*ts != '{') {
23785             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
23786             return NULL;
23787           }
23788           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23789           ctx->enc_type = 0;
23790           ctx->enc_count = 0;
23791           ctx->struct_alignment = 0;
23792           ++ts;
23793           ts_after_sub = ts;
23794           for (i = 0; i != struct_count; ++i) {
23795             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
23796             if (!ts_after_sub) return NULL;
23797           }
23798           ts = ts_after_sub;
23799           if (struct_alignment) ctx->struct_alignment = struct_alignment;
23800         }
23801         break;
23802       case '}':
23803         {
23804           size_t alignment = ctx->struct_alignment;
23805           ++ts;
23806           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23807           ctx->enc_type = 0;
23808           if (alignment && ctx->fmt_offset % alignment) {
23809             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
23810           }
23811         }
23812         return ts;
23813       case 'x':
23814         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23815         ctx->fmt_offset += ctx->new_count;
23816         ctx->new_count = 1;
23817         ctx->enc_count = 0;
23818         ctx->enc_type = 0;
23819         ctx->enc_packmode = ctx->new_packmode;
23820         ++ts;
23821         break;
23822       case 'Z':
23823         got_Z = 1;
23824         ++ts;
23825         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
23826           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
23827           return NULL;
23828         }
23829         CYTHON_FALLTHROUGH;
23830       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
23831       case 'l': case 'L': case 'q': case 'Q':
23832       case 'f': case 'd': case 'g':
23833       case 'O': case 'p':
23834         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
23835             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
23836           ctx->enc_count += ctx->new_count;
23837           ctx->new_count = 1;
23838           got_Z = 0;
23839           ++ts;
23840           break;
23841         }
23842         CYTHON_FALLTHROUGH;
23843       case 's':
23844         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23845         ctx->enc_count = ctx->new_count;
23846         ctx->enc_packmode = ctx->new_packmode;
23847         ctx->enc_type = *ts;
23848         ctx->is_complex = got_Z;
23849         ++ts;
23850         ctx->new_count = 1;
23851         got_Z = 0;
23852         break;
23853       case ':':
23854         ++ts;
23855         while(*ts != ':') ++ts;
23856         ++ts;
23857         break;
23858       case '(':
23859         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
23860         break;
23861       default:
23862         {
23863           int number = __Pyx_BufFmt_ExpectNumber(&ts);
23864           if (number == -1) return NULL;
23865           ctx->new_count = (size_t)number;
23866         }
23867     }
23868   }
23869 }
23870 
23871 /* TypeInfoCompare */
23872   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)23873 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
23874 {
23875     int i;
23876     if (!a || !b)
23877         return 0;
23878     if (a == b)
23879         return 1;
23880     if (a->size != b->size || a->typegroup != b->typegroup ||
23881             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
23882         if (a->typegroup == 'H' || b->typegroup == 'H') {
23883             return a->size == b->size;
23884         } else {
23885             return 0;
23886         }
23887     }
23888     if (a->ndim) {
23889         for (i = 0; i < a->ndim; i++)
23890             if (a->arraysize[i] != b->arraysize[i])
23891                 return 0;
23892     }
23893     if (a->typegroup == 'S') {
23894         if (a->flags != b->flags)
23895             return 0;
23896         if (a->fields || b->fields) {
23897             if (!(a->fields && b->fields))
23898                 return 0;
23899             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
23900                 __Pyx_StructField *field_a = a->fields + i;
23901                 __Pyx_StructField *field_b = b->fields + i;
23902                 if (field_a->offset != field_b->offset ||
23903                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
23904                     return 0;
23905             }
23906             return !a->fields[i].type && !b->fields[i].type;
23907         }
23908     }
23909     return 1;
23910 }
23911 
23912 /* MemviewSliceValidateAndInit */
23913   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)23914 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
23915 {
23916     if (buf->shape[dim] <= 1)
23917         return 1;
23918     if (buf->strides) {
23919         if (spec & __Pyx_MEMVIEW_CONTIG) {
23920             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
23921                 if (unlikely(buf->strides[dim] != sizeof(void *))) {
23922                     PyErr_Format(PyExc_ValueError,
23923                                  "Buffer is not indirectly contiguous "
23924                                  "in dimension %d.", dim);
23925                     goto fail;
23926                 }
23927             } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
23928                 PyErr_SetString(PyExc_ValueError,
23929                                 "Buffer and memoryview are not contiguous "
23930                                 "in the same dimension.");
23931                 goto fail;
23932             }
23933         }
23934         if (spec & __Pyx_MEMVIEW_FOLLOW) {
23935             Py_ssize_t stride = buf->strides[dim];
23936             if (stride < 0)
23937                 stride = -stride;
23938             if (unlikely(stride < buf->itemsize)) {
23939                 PyErr_SetString(PyExc_ValueError,
23940                                 "Buffer and memoryview are not contiguous "
23941                                 "in the same dimension.");
23942                 goto fail;
23943             }
23944         }
23945     } else {
23946         if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
23947             PyErr_Format(PyExc_ValueError,
23948                          "C-contiguous buffer is not contiguous in "
23949                          "dimension %d", dim);
23950             goto fail;
23951         } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
23952             PyErr_Format(PyExc_ValueError,
23953                          "C-contiguous buffer is not indirect in "
23954                          "dimension %d", dim);
23955             goto fail;
23956         } else if (unlikely(buf->suboffsets)) {
23957             PyErr_SetString(PyExc_ValueError,
23958                             "Buffer exposes suboffsets but no strides");
23959             goto fail;
23960         }
23961     }
23962     return 1;
23963 fail:
23964     return 0;
23965 }
23966 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)23967 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
23968 {
23969     if (spec & __Pyx_MEMVIEW_DIRECT) {
23970         if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
23971             PyErr_Format(PyExc_ValueError,
23972                          "Buffer not compatible with direct access "
23973                          "in dimension %d.", dim);
23974             goto fail;
23975         }
23976     }
23977     if (spec & __Pyx_MEMVIEW_PTR) {
23978         if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
23979             PyErr_Format(PyExc_ValueError,
23980                          "Buffer is not indirectly accessible "
23981                          "in dimension %d.", dim);
23982             goto fail;
23983         }
23984     }
23985     return 1;
23986 fail:
23987     return 0;
23988 }
23989 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)23990 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
23991 {
23992     int i;
23993     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
23994         Py_ssize_t stride = 1;
23995         for (i = 0; i < ndim; i++) {
23996             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
23997                 PyErr_SetString(PyExc_ValueError,
23998                     "Buffer not fortran contiguous.");
23999                 goto fail;
24000             }
24001             stride = stride * buf->shape[i];
24002         }
24003     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
24004         Py_ssize_t stride = 1;
24005         for (i = ndim - 1; i >- 1; i--) {
24006             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
24007                 PyErr_SetString(PyExc_ValueError,
24008                     "Buffer not C contiguous.");
24009                 goto fail;
24010             }
24011             stride = stride * buf->shape[i];
24012         }
24013     }
24014     return 1;
24015 fail:
24016     return 0;
24017 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)24018 static int __Pyx_ValidateAndInit_memviewslice(
24019                 int *axes_specs,
24020                 int c_or_f_flag,
24021                 int buf_flags,
24022                 int ndim,
24023                 __Pyx_TypeInfo *dtype,
24024                 __Pyx_BufFmt_StackElem stack[],
24025                 __Pyx_memviewslice *memviewslice,
24026                 PyObject *original_obj)
24027 {
24028     struct __pyx_memoryview_obj *memview, *new_memview;
24029     __Pyx_RefNannyDeclarations
24030     Py_buffer *buf;
24031     int i, spec = 0, retval = -1;
24032     __Pyx_BufFmt_Context ctx;
24033     int from_memoryview = __pyx_memoryview_check(original_obj);
24034     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
24035     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
24036                                                             original_obj)->typeinfo)) {
24037         memview = (struct __pyx_memoryview_obj *) original_obj;
24038         new_memview = NULL;
24039     } else {
24040         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
24041                                             original_obj, buf_flags, 0, dtype);
24042         new_memview = memview;
24043         if (unlikely(!memview))
24044             goto fail;
24045     }
24046     buf = &memview->view;
24047     if (unlikely(buf->ndim != ndim)) {
24048         PyErr_Format(PyExc_ValueError,
24049                 "Buffer has wrong number of dimensions (expected %d, got %d)",
24050                 ndim, buf->ndim);
24051         goto fail;
24052     }
24053     if (new_memview) {
24054         __Pyx_BufFmt_Init(&ctx, stack, dtype);
24055         if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
24056     }
24057     if (unlikely((unsigned) buf->itemsize != dtype->size)) {
24058         PyErr_Format(PyExc_ValueError,
24059                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
24060                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
24061                      buf->itemsize,
24062                      (buf->itemsize > 1) ? "s" : "",
24063                      dtype->name,
24064                      dtype->size,
24065                      (dtype->size > 1) ? "s" : "");
24066         goto fail;
24067     }
24068     if (buf->len > 0) {
24069         for (i = 0; i < ndim; i++) {
24070             spec = axes_specs[i];
24071             if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
24072                 goto fail;
24073             if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
24074                 goto fail;
24075         }
24076         if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
24077             goto fail;
24078     }
24079     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
24080                                          new_memview != NULL) == -1)) {
24081         goto fail;
24082     }
24083     retval = 0;
24084     goto no_fail;
24085 fail:
24086     Py_XDECREF(new_memview);
24087     retval = -1;
24088 no_fail:
24089     __Pyx_RefNannyFinishContext();
24090     return retval;
24091 }
24092 
24093 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject * obj,int writable_flag)24094   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
24095     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
24096     __Pyx_BufFmt_StackElem stack[1];
24097     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
24098     int retcode;
24099     if (obj == Py_None) {
24100         result.memview = (struct __pyx_memoryview_obj *) Py_None;
24101         return result;
24102     }
24103     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
24104                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
24105                                                  &__Pyx_TypeInfo___pyx_t_double_complex, stack,
24106                                                  &result, obj);
24107     if (unlikely(retcode == -1))
24108         goto __pyx_fail;
24109     return result;
24110 __pyx_fail:
24111     result.memview = NULL;
24112     result.data = NULL;
24113     return result;
24114 }
24115 
24116 /* MemviewDtypeToObject */
__pyx_memview_get_double(const char * itemp)24117   static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
24118     return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
24119 }
__pyx_memview_set_double(const char * itemp,PyObject * obj)24120 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
24121     double value = __pyx_PyFloat_AsDouble(obj);
24122     if ((value == (double)-1) && PyErr_Occurred())
24123         return 0;
24124     *(double *) itemp = value;
24125     return 1;
24126 }
24127 
24128 /* FromPy */
__Pyx_PyComplex_As___pyx_t_double_complex(PyObject * o)24129   static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
24130     Py_complex cval;
24131 #if !CYTHON_COMPILING_IN_PYPY
24132     if (PyComplex_CheckExact(o))
24133         cval = ((PyComplexObject *)o)->cval;
24134     else
24135 #endif
24136         cval = PyComplex_AsCComplex(o);
24137     return __pyx_t_double_complex_from_parts(
24138                (double)cval.real,
24139                (double)cval.imag);
24140 }
24141 
24142 /* MemviewDtypeToObject */
__pyx_memview_get___pyx_t_double_complex(const char * itemp)24143   static CYTHON_INLINE PyObject *__pyx_memview_get___pyx_t_double_complex(const char *itemp) {
24144     return (PyObject *) __pyx_PyComplex_FromComplex(*(__pyx_t_double_complex *) itemp);
24145 }
__pyx_memview_set___pyx_t_double_complex(const char * itemp,PyObject * obj)24146 static CYTHON_INLINE int __pyx_memview_set___pyx_t_double_complex(const char *itemp, PyObject *obj) {
24147     __pyx_t_double_complex value = __Pyx_PyComplex_As___pyx_t_double_complex(obj);
24148     if (PyErr_Occurred())
24149         return 0;
24150     *(__pyx_t_double_complex *) itemp = value;
24151     return 1;
24152 }
24153 
24154 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(PyObject * obj,int writable_flag)24155   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds___pyx_t_double_complex(PyObject *obj, int writable_flag) {
24156     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
24157     __Pyx_BufFmt_StackElem stack[1];
24158     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
24159     int retcode;
24160     if (obj == Py_None) {
24161         result.memview = (struct __pyx_memoryview_obj *) Py_None;
24162         return result;
24163     }
24164     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
24165                                                  PyBUF_RECORDS_RO | writable_flag, 2,
24166                                                  &__Pyx_TypeInfo___pyx_t_double_complex, stack,
24167                                                  &result, obj);
24168     if (unlikely(retcode == -1))
24169         goto __pyx_fail;
24170     return result;
24171 __pyx_fail:
24172     result.memview = NULL;
24173     result.data = NULL;
24174     return result;
24175 }
24176 
24177 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject * obj,int writable_flag)24178   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
24179     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
24180     __Pyx_BufFmt_StackElem stack[1];
24181     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
24182     int retcode;
24183     if (obj == Py_None) {
24184         result.memview = (struct __pyx_memoryview_obj *) Py_None;
24185         return result;
24186     }
24187     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
24188                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
24189                                                  &__Pyx_TypeInfo_double, stack,
24190                                                  &result, obj);
24191     if (unlikely(retcode == -1))
24192         goto __pyx_fail;
24193     return result;
24194 __pyx_fail:
24195     result.memview = NULL;
24196     result.data = NULL;
24197     return result;
24198 }
24199 
24200 /* Declarations */
24201   #if CYTHON_CCOMPLEX
24202   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)24203     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24204       return ::std::complex< float >(x, y);
24205     }
24206   #else
__pyx_t_float_complex_from_parts(float x,float y)24207     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24208       return x + y*(__pyx_t_float_complex)_Complex_I;
24209     }
24210   #endif
24211 #else
__pyx_t_float_complex_from_parts(float x,float y)24212     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24213       __pyx_t_float_complex z;
24214       z.real = x;
24215       z.imag = y;
24216       return z;
24217     }
24218 #endif
24219 
24220 /* Arithmetic */
24221   #if CYTHON_CCOMPLEX
24222 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24223     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24224        return (a.real == b.real) && (a.imag == b.imag);
24225     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24226     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24227         __pyx_t_float_complex z;
24228         z.real = a.real + b.real;
24229         z.imag = a.imag + b.imag;
24230         return z;
24231     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24232     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24233         __pyx_t_float_complex z;
24234         z.real = a.real - b.real;
24235         z.imag = a.imag - b.imag;
24236         return z;
24237     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24238     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24239         __pyx_t_float_complex z;
24240         z.real = a.real * b.real - a.imag * b.imag;
24241         z.imag = a.real * b.imag + a.imag * b.real;
24242         return z;
24243     }
24244     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24245     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24246         if (b.imag == 0) {
24247             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24248         } else if (fabsf(b.real) >= fabsf(b.imag)) {
24249             if (b.real == 0 && b.imag == 0) {
24250                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
24251             } else {
24252                 float r = b.imag / b.real;
24253                 float s = (float)(1.0) / (b.real + b.imag * r);
24254                 return __pyx_t_float_complex_from_parts(
24255                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24256             }
24257         } else {
24258             float r = b.real / b.imag;
24259             float s = (float)(1.0) / (b.imag + b.real * r);
24260             return __pyx_t_float_complex_from_parts(
24261                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24262         }
24263     }
24264     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24265     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24266         if (b.imag == 0) {
24267             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24268         } else {
24269             float denom = b.real * b.real + b.imag * b.imag;
24270             return __pyx_t_float_complex_from_parts(
24271                 (a.real * b.real + a.imag * b.imag) / denom,
24272                 (a.imag * b.real - a.real * b.imag) / denom);
24273         }
24274     }
24275     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)24276     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
24277         __pyx_t_float_complex z;
24278         z.real = -a.real;
24279         z.imag = -a.imag;
24280         return z;
24281     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)24282     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
24283        return (a.real == 0) && (a.imag == 0);
24284     }
__Pyx_c_conj_float(__pyx_t_float_complex a)24285     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
24286         __pyx_t_float_complex z;
24287         z.real =  a.real;
24288         z.imag = -a.imag;
24289         return z;
24290     }
24291     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)24292         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
24293           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24294             return sqrtf(z.real*z.real + z.imag*z.imag);
24295           #else
24296             return hypotf(z.real, z.imag);
24297           #endif
24298         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24299         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24300             __pyx_t_float_complex z;
24301             float r, lnr, theta, z_r, z_theta;
24302             if (b.imag == 0 && b.real == (int)b.real) {
24303                 if (b.real < 0) {
24304                     float denom = a.real * a.real + a.imag * a.imag;
24305                     a.real = a.real / denom;
24306                     a.imag = -a.imag / denom;
24307                     b.real = -b.real;
24308                 }
24309                 switch ((int)b.real) {
24310                     case 0:
24311                         z.real = 1;
24312                         z.imag = 0;
24313                         return z;
24314                     case 1:
24315                         return a;
24316                     case 2:
24317                         return __Pyx_c_prod_float(a, a);
24318                     case 3:
24319                         z = __Pyx_c_prod_float(a, a);
24320                         return __Pyx_c_prod_float(z, a);
24321                     case 4:
24322                         z = __Pyx_c_prod_float(a, a);
24323                         return __Pyx_c_prod_float(z, z);
24324                 }
24325             }
24326             if (a.imag == 0) {
24327                 if (a.real == 0) {
24328                     return a;
24329                 } else if (b.imag == 0) {
24330                     z.real = powf(a.real, b.real);
24331                     z.imag = 0;
24332                     return z;
24333                 } else if (a.real > 0) {
24334                     r = a.real;
24335                     theta = 0;
24336                 } else {
24337                     r = -a.real;
24338                     theta = atan2f(0.0, -1.0);
24339                 }
24340             } else {
24341                 r = __Pyx_c_abs_float(a);
24342                 theta = atan2f(a.imag, a.real);
24343             }
24344             lnr = logf(r);
24345             z_r = expf(lnr * b.real - theta * b.imag);
24346             z_theta = theta * b.real + lnr * b.imag;
24347             z.real = z_r * cosf(z_theta);
24348             z.imag = z_r * sinf(z_theta);
24349             return z;
24350         }
24351     #endif
24352 #endif
24353 
24354 /* CIntFromPyVerify */
24355   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
24356     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
24357 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
24358     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
24359 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
24360     {\
24361         func_type value = func_value;\
24362         if (sizeof(target_type) < sizeof(func_type)) {\
24363             if (unlikely(value != (func_type) (target_type) value)) {\
24364                 func_type zero = 0;\
24365                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
24366                     return (target_type) -1;\
24367                 if (is_unsigned && unlikely(value < zero))\
24368                     goto raise_neg_overflow;\
24369                 else\
24370                     goto raise_overflow;\
24371             }\
24372         }\
24373         return (target_type) value;\
24374     }
24375 
24376 /* MemviewSliceCopyTemplate */
24377   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)24378 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
24379                                  const char *mode, int ndim,
24380                                  size_t sizeof_dtype, int contig_flag,
24381                                  int dtype_is_object)
24382 {
24383     __Pyx_RefNannyDeclarations
24384     int i;
24385     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
24386     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
24387     Py_buffer *buf = &from_memview->view;
24388     PyObject *shape_tuple = NULL;
24389     PyObject *temp_int = NULL;
24390     struct __pyx_array_obj *array_obj = NULL;
24391     struct __pyx_memoryview_obj *memview_obj = NULL;
24392     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
24393     for (i = 0; i < ndim; i++) {
24394         if (unlikely(from_mvs->suboffsets[i] >= 0)) {
24395             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
24396                                            "indirect dimensions (axis %d)", i);
24397             goto fail;
24398         }
24399     }
24400     shape_tuple = PyTuple_New(ndim);
24401     if (unlikely(!shape_tuple)) {
24402         goto fail;
24403     }
24404     __Pyx_GOTREF(shape_tuple);
24405     for(i = 0; i < ndim; i++) {
24406         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
24407         if(unlikely(!temp_int)) {
24408             goto fail;
24409         } else {
24410             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
24411             temp_int = NULL;
24412         }
24413     }
24414     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
24415     if (unlikely(!array_obj)) {
24416         goto fail;
24417     }
24418     __Pyx_GOTREF(array_obj);
24419     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
24420                                     (PyObject *) array_obj, contig_flag,
24421                                     dtype_is_object,
24422                                     from_mvs->memview->typeinfo);
24423     if (unlikely(!memview_obj))
24424         goto fail;
24425     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
24426         goto fail;
24427     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
24428                                                 dtype_is_object) < 0))
24429         goto fail;
24430     goto no_fail;
24431 fail:
24432     __Pyx_XDECREF(new_mvs.memview);
24433     new_mvs.memview = NULL;
24434     new_mvs.data = NULL;
24435 no_fail:
24436     __Pyx_XDECREF(shape_tuple);
24437     __Pyx_XDECREF(temp_int);
24438     __Pyx_XDECREF(array_obj);
24439     __Pyx_RefNannyFinishContext();
24440     return new_mvs;
24441 }
24442 
24443 /* CIntToPy */
__Pyx_PyInt_From_int(int value)24444   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
24445 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24446 #pragma GCC diagnostic push
24447 #pragma GCC diagnostic ignored "-Wconversion"
24448 #endif
24449     const int neg_one = (int) -1, const_zero = (int) 0;
24450 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24451 #pragma GCC diagnostic pop
24452 #endif
24453     const int is_unsigned = neg_one > const_zero;
24454     if (is_unsigned) {
24455         if (sizeof(int) < sizeof(long)) {
24456             return PyInt_FromLong((long) value);
24457         } else if (sizeof(int) <= sizeof(unsigned long)) {
24458             return PyLong_FromUnsignedLong((unsigned long) value);
24459 #ifdef HAVE_LONG_LONG
24460         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24461             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24462 #endif
24463         }
24464     } else {
24465         if (sizeof(int) <= sizeof(long)) {
24466             return PyInt_FromLong((long) value);
24467 #ifdef HAVE_LONG_LONG
24468         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24469             return PyLong_FromLongLong((PY_LONG_LONG) value);
24470 #endif
24471         }
24472     }
24473     {
24474         int one = 1; int little = (int)*(unsigned char *)&one;
24475         unsigned char *bytes = (unsigned char *)&value;
24476         return _PyLong_FromByteArray(bytes, sizeof(int),
24477                                      little, !is_unsigned);
24478     }
24479 }
24480 
24481 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)24482   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
24483 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24484 #pragma GCC diagnostic push
24485 #pragma GCC diagnostic ignored "-Wconversion"
24486 #endif
24487     const int neg_one = (int) -1, const_zero = (int) 0;
24488 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24489 #pragma GCC diagnostic pop
24490 #endif
24491     const int is_unsigned = neg_one > const_zero;
24492 #if PY_MAJOR_VERSION < 3
24493     if (likely(PyInt_Check(x))) {
24494         if (sizeof(int) < sizeof(long)) {
24495             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
24496         } else {
24497             long val = PyInt_AS_LONG(x);
24498             if (is_unsigned && unlikely(val < 0)) {
24499                 goto raise_neg_overflow;
24500             }
24501             return (int) val;
24502         }
24503     } else
24504 #endif
24505     if (likely(PyLong_Check(x))) {
24506         if (is_unsigned) {
24507 #if CYTHON_USE_PYLONG_INTERNALS
24508             const digit* digits = ((PyLongObject*)x)->ob_digit;
24509             switch (Py_SIZE(x)) {
24510                 case  0: return (int) 0;
24511                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
24512                 case 2:
24513                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24514                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24515                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24516                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
24517                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24518                         }
24519                     }
24520                     break;
24521                 case 3:
24522                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24523                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24524                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24525                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
24526                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24527                         }
24528                     }
24529                     break;
24530                 case 4:
24531                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24532                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24533                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24534                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
24535                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24536                         }
24537                     }
24538                     break;
24539             }
24540 #endif
24541 #if CYTHON_COMPILING_IN_CPYTHON
24542             if (unlikely(Py_SIZE(x) < 0)) {
24543                 goto raise_neg_overflow;
24544             }
24545 #else
24546             {
24547                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24548                 if (unlikely(result < 0))
24549                     return (int) -1;
24550                 if (unlikely(result == 1))
24551                     goto raise_neg_overflow;
24552             }
24553 #endif
24554             if (sizeof(int) <= sizeof(unsigned long)) {
24555                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
24556 #ifdef HAVE_LONG_LONG
24557             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24558                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24559 #endif
24560             }
24561         } else {
24562 #if CYTHON_USE_PYLONG_INTERNALS
24563             const digit* digits = ((PyLongObject*)x)->ob_digit;
24564             switch (Py_SIZE(x)) {
24565                 case  0: return (int) 0;
24566                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
24567                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
24568                 case -2:
24569                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
24570                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24571                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24572                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24573                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24574                         }
24575                     }
24576                     break;
24577                 case 2:
24578                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24579                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24580                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24581                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24582                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24583                         }
24584                     }
24585                     break;
24586                 case -3:
24587                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24588                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24589                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24590                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24591                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24592                         }
24593                     }
24594                     break;
24595                 case 3:
24596                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24597                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24598                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24599                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24600                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24601                         }
24602                     }
24603                     break;
24604                 case -4:
24605                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24606                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24607                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24608                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24609                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24610                         }
24611                     }
24612                     break;
24613                 case 4:
24614                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24615                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24616                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24617                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24618                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24619                         }
24620                     }
24621                     break;
24622             }
24623 #endif
24624             if (sizeof(int) <= sizeof(long)) {
24625                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
24626 #ifdef HAVE_LONG_LONG
24627             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24628                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
24629 #endif
24630             }
24631         }
24632         {
24633 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24634             PyErr_SetString(PyExc_RuntimeError,
24635                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24636 #else
24637             int val;
24638             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24639  #if PY_MAJOR_VERSION < 3
24640             if (likely(v) && !PyLong_Check(v)) {
24641                 PyObject *tmp = v;
24642                 v = PyNumber_Long(tmp);
24643                 Py_DECREF(tmp);
24644             }
24645  #endif
24646             if (likely(v)) {
24647                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24648                 unsigned char *bytes = (unsigned char *)&val;
24649                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24650                                               bytes, sizeof(val),
24651                                               is_little, !is_unsigned);
24652                 Py_DECREF(v);
24653                 if (likely(!ret))
24654                     return val;
24655             }
24656 #endif
24657             return (int) -1;
24658         }
24659     } else {
24660         int val;
24661         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24662         if (!tmp) return (int) -1;
24663         val = __Pyx_PyInt_As_int(tmp);
24664         Py_DECREF(tmp);
24665         return val;
24666     }
24667 raise_overflow:
24668     PyErr_SetString(PyExc_OverflowError,
24669         "value too large to convert to int");
24670     return (int) -1;
24671 raise_neg_overflow:
24672     PyErr_SetString(PyExc_OverflowError,
24673         "can't convert negative value to int");
24674     return (int) -1;
24675 }
24676 
24677 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)24678   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
24679 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24680 #pragma GCC diagnostic push
24681 #pragma GCC diagnostic ignored "-Wconversion"
24682 #endif
24683     const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
24684 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24685 #pragma GCC diagnostic pop
24686 #endif
24687     const int is_unsigned = neg_one > const_zero;
24688     if (is_unsigned) {
24689         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
24690             return PyInt_FromLong((long) value);
24691         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
24692             return PyLong_FromUnsignedLong((unsigned long) value);
24693 #ifdef HAVE_LONG_LONG
24694         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
24695             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24696 #endif
24697         }
24698     } else {
24699         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
24700             return PyInt_FromLong((long) value);
24701 #ifdef HAVE_LONG_LONG
24702         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
24703             return PyLong_FromLongLong((PY_LONG_LONG) value);
24704 #endif
24705         }
24706     }
24707     {
24708         int one = 1; int little = (int)*(unsigned char *)&one;
24709         unsigned char *bytes = (unsigned char *)&value;
24710         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
24711                                      little, !is_unsigned);
24712     }
24713 }
24714 
24715 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)24716   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
24717 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24718 #pragma GCC diagnostic push
24719 #pragma GCC diagnostic ignored "-Wconversion"
24720 #endif
24721     const long neg_one = (long) -1, const_zero = (long) 0;
24722 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24723 #pragma GCC diagnostic pop
24724 #endif
24725     const int is_unsigned = neg_one > const_zero;
24726 #if PY_MAJOR_VERSION < 3
24727     if (likely(PyInt_Check(x))) {
24728         if (sizeof(long) < sizeof(long)) {
24729             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
24730         } else {
24731             long val = PyInt_AS_LONG(x);
24732             if (is_unsigned && unlikely(val < 0)) {
24733                 goto raise_neg_overflow;
24734             }
24735             return (long) val;
24736         }
24737     } else
24738 #endif
24739     if (likely(PyLong_Check(x))) {
24740         if (is_unsigned) {
24741 #if CYTHON_USE_PYLONG_INTERNALS
24742             const digit* digits = ((PyLongObject*)x)->ob_digit;
24743             switch (Py_SIZE(x)) {
24744                 case  0: return (long) 0;
24745                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
24746                 case 2:
24747                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24748                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24749                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24750                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
24751                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24752                         }
24753                     }
24754                     break;
24755                 case 3:
24756                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24757                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24758                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24759                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
24760                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24761                         }
24762                     }
24763                     break;
24764                 case 4:
24765                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24766                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24767                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24768                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
24769                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24770                         }
24771                     }
24772                     break;
24773             }
24774 #endif
24775 #if CYTHON_COMPILING_IN_CPYTHON
24776             if (unlikely(Py_SIZE(x) < 0)) {
24777                 goto raise_neg_overflow;
24778             }
24779 #else
24780             {
24781                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24782                 if (unlikely(result < 0))
24783                     return (long) -1;
24784                 if (unlikely(result == 1))
24785                     goto raise_neg_overflow;
24786             }
24787 #endif
24788             if (sizeof(long) <= sizeof(unsigned long)) {
24789                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
24790 #ifdef HAVE_LONG_LONG
24791             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24792                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24793 #endif
24794             }
24795         } else {
24796 #if CYTHON_USE_PYLONG_INTERNALS
24797             const digit* digits = ((PyLongObject*)x)->ob_digit;
24798             switch (Py_SIZE(x)) {
24799                 case  0: return (long) 0;
24800                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
24801                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
24802                 case -2:
24803                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
24804                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24805                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24806                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24807                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24808                         }
24809                     }
24810                     break;
24811                 case 2:
24812                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24813                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24814                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24815                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24816                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24817                         }
24818                     }
24819                     break;
24820                 case -3:
24821                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24822                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24823                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24824                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24825                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24826                         }
24827                     }
24828                     break;
24829                 case 3:
24830                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24831                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24832                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24833                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24834                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24835                         }
24836                     }
24837                     break;
24838                 case -4:
24839                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24840                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24841                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24842                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24843                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24844                         }
24845                     }
24846                     break;
24847                 case 4:
24848                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24849                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24850                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24851                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24852                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24853                         }
24854                     }
24855                     break;
24856             }
24857 #endif
24858             if (sizeof(long) <= sizeof(long)) {
24859                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
24860 #ifdef HAVE_LONG_LONG
24861             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24862                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
24863 #endif
24864             }
24865         }
24866         {
24867 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24868             PyErr_SetString(PyExc_RuntimeError,
24869                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24870 #else
24871             long val;
24872             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24873  #if PY_MAJOR_VERSION < 3
24874             if (likely(v) && !PyLong_Check(v)) {
24875                 PyObject *tmp = v;
24876                 v = PyNumber_Long(tmp);
24877                 Py_DECREF(tmp);
24878             }
24879  #endif
24880             if (likely(v)) {
24881                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24882                 unsigned char *bytes = (unsigned char *)&val;
24883                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24884                                               bytes, sizeof(val),
24885                                               is_little, !is_unsigned);
24886                 Py_DECREF(v);
24887                 if (likely(!ret))
24888                     return val;
24889             }
24890 #endif
24891             return (long) -1;
24892         }
24893     } else {
24894         long val;
24895         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24896         if (!tmp) return (long) -1;
24897         val = __Pyx_PyInt_As_long(tmp);
24898         Py_DECREF(tmp);
24899         return val;
24900     }
24901 raise_overflow:
24902     PyErr_SetString(PyExc_OverflowError,
24903         "value too large to convert to long");
24904     return (long) -1;
24905 raise_neg_overflow:
24906     PyErr_SetString(PyExc_OverflowError,
24907         "can't convert negative value to long");
24908     return (long) -1;
24909 }
24910 
24911 /* CIntToPy */
__Pyx_PyInt_From_long(long value)24912   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
24913 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24914 #pragma GCC diagnostic push
24915 #pragma GCC diagnostic ignored "-Wconversion"
24916 #endif
24917     const long neg_one = (long) -1, const_zero = (long) 0;
24918 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24919 #pragma GCC diagnostic pop
24920 #endif
24921     const int is_unsigned = neg_one > const_zero;
24922     if (is_unsigned) {
24923         if (sizeof(long) < sizeof(long)) {
24924             return PyInt_FromLong((long) value);
24925         } else if (sizeof(long) <= sizeof(unsigned long)) {
24926             return PyLong_FromUnsignedLong((unsigned long) value);
24927 #ifdef HAVE_LONG_LONG
24928         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24929             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24930 #endif
24931         }
24932     } else {
24933         if (sizeof(long) <= sizeof(long)) {
24934             return PyInt_FromLong((long) value);
24935 #ifdef HAVE_LONG_LONG
24936         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24937             return PyLong_FromLongLong((PY_LONG_LONG) value);
24938 #endif
24939         }
24940     }
24941     {
24942         int one = 1; int little = (int)*(unsigned char *)&one;
24943         unsigned char *bytes = (unsigned char *)&value;
24944         return _PyLong_FromByteArray(bytes, sizeof(long),
24945                                      little, !is_unsigned);
24946     }
24947 }
24948 
24949 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)24950   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
24951 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24952 #pragma GCC diagnostic push
24953 #pragma GCC diagnostic ignored "-Wconversion"
24954 #endif
24955     const char neg_one = (char) -1, const_zero = (char) 0;
24956 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24957 #pragma GCC diagnostic pop
24958 #endif
24959     const int is_unsigned = neg_one > const_zero;
24960 #if PY_MAJOR_VERSION < 3
24961     if (likely(PyInt_Check(x))) {
24962         if (sizeof(char) < sizeof(long)) {
24963             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
24964         } else {
24965             long val = PyInt_AS_LONG(x);
24966             if (is_unsigned && unlikely(val < 0)) {
24967                 goto raise_neg_overflow;
24968             }
24969             return (char) val;
24970         }
24971     } else
24972 #endif
24973     if (likely(PyLong_Check(x))) {
24974         if (is_unsigned) {
24975 #if CYTHON_USE_PYLONG_INTERNALS
24976             const digit* digits = ((PyLongObject*)x)->ob_digit;
24977             switch (Py_SIZE(x)) {
24978                 case  0: return (char) 0;
24979                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
24980                 case 2:
24981                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
24982                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24983                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24984                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
24985                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24986                         }
24987                     }
24988                     break;
24989                 case 3:
24990                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
24991                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24992                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24993                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
24994                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24995                         }
24996                     }
24997                     break;
24998                 case 4:
24999                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25000                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25001                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25002                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
25003                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25004                         }
25005                     }
25006                     break;
25007             }
25008 #endif
25009 #if CYTHON_COMPILING_IN_CPYTHON
25010             if (unlikely(Py_SIZE(x) < 0)) {
25011                 goto raise_neg_overflow;
25012             }
25013 #else
25014             {
25015                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25016                 if (unlikely(result < 0))
25017                     return (char) -1;
25018                 if (unlikely(result == 1))
25019                     goto raise_neg_overflow;
25020             }
25021 #endif
25022             if (sizeof(char) <= sizeof(unsigned long)) {
25023                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
25024 #ifdef HAVE_LONG_LONG
25025             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
25026                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25027 #endif
25028             }
25029         } else {
25030 #if CYTHON_USE_PYLONG_INTERNALS
25031             const digit* digits = ((PyLongObject*)x)->ob_digit;
25032             switch (Py_SIZE(x)) {
25033                 case  0: return (char) 0;
25034                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
25035                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
25036                 case -2:
25037                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
25038                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25039                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25040                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25041                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25042                         }
25043                     }
25044                     break;
25045                 case 2:
25046                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
25047                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25048                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25049                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25050                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25051                         }
25052                     }
25053                     break;
25054                 case -3:
25055                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25056                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25057                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25058                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25059                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25060                         }
25061                     }
25062                     break;
25063                 case 3:
25064                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
25065                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25066                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25067                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25068                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25069                         }
25070                     }
25071                     break;
25072                 case -4:
25073                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25074                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25075                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25076                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25077                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25078                         }
25079                     }
25080                     break;
25081                 case 4:
25082                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25083                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25084                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25085                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25086                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25087                         }
25088                     }
25089                     break;
25090             }
25091 #endif
25092             if (sizeof(char) <= sizeof(long)) {
25093                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
25094 #ifdef HAVE_LONG_LONG
25095             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
25096                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
25097 #endif
25098             }
25099         }
25100         {
25101 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25102             PyErr_SetString(PyExc_RuntimeError,
25103                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25104 #else
25105             char val;
25106             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25107  #if PY_MAJOR_VERSION < 3
25108             if (likely(v) && !PyLong_Check(v)) {
25109                 PyObject *tmp = v;
25110                 v = PyNumber_Long(tmp);
25111                 Py_DECREF(tmp);
25112             }
25113  #endif
25114             if (likely(v)) {
25115                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25116                 unsigned char *bytes = (unsigned char *)&val;
25117                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25118                                               bytes, sizeof(val),
25119                                               is_little, !is_unsigned);
25120                 Py_DECREF(v);
25121                 if (likely(!ret))
25122                     return val;
25123             }
25124 #endif
25125             return (char) -1;
25126         }
25127     } else {
25128         char val;
25129         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25130         if (!tmp) return (char) -1;
25131         val = __Pyx_PyInt_As_char(tmp);
25132         Py_DECREF(tmp);
25133         return val;
25134     }
25135 raise_overflow:
25136     PyErr_SetString(PyExc_OverflowError,
25137         "value too large to convert to char");
25138     return (char) -1;
25139 raise_neg_overflow:
25140     PyErr_SetString(PyExc_OverflowError,
25141         "can't convert negative value to char");
25142     return (char) -1;
25143 }
25144 
25145 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)25146   static int __Pyx_check_binary_version(void) {
25147     char ctversion[4], rtversion[4];
25148     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25149     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
25150     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
25151         char message[200];
25152         PyOS_snprintf(message, sizeof(message),
25153                       "compiletime version %s of module '%.100s' "
25154                       "does not match runtime version %s",
25155                       ctversion, __Pyx_MODULE_NAME, rtversion);
25156         return PyErr_WarnEx(NULL, message, 1);
25157     }
25158     return 0;
25159 }
25160 
25161 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)25162   static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
25163     PyObject *d = 0;
25164     PyObject *cobj = 0;
25165     union {
25166         void (*fp)(void);
25167         void *p;
25168     } tmp;
25169     d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
25170     if (!d) {
25171         PyErr_Clear();
25172         d = PyDict_New();
25173         if (!d)
25174             goto bad;
25175         Py_INCREF(d);
25176         if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
25177             goto bad;
25178     }
25179     tmp.fp = f;
25180 #if PY_VERSION_HEX >= 0x02070000
25181     cobj = PyCapsule_New(tmp.p, sig, 0);
25182 #else
25183     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
25184 #endif
25185     if (!cobj)
25186         goto bad;
25187     if (PyDict_SetItemString(d, name, cobj) < 0)
25188         goto bad;
25189     Py_DECREF(cobj);
25190     Py_DECREF(d);
25191     return 0;
25192 bad:
25193     Py_XDECREF(cobj);
25194     Py_XDECREF(d);
25195     return -1;
25196 }
25197 
25198 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)25199   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25200     while (t->p) {
25201         #if PY_MAJOR_VERSION < 3
25202         if (t->is_unicode) {
25203             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25204         } else if (t->intern) {
25205             *t->p = PyString_InternFromString(t->s);
25206         } else {
25207             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25208         }
25209         #else
25210         if (t->is_unicode | t->is_str) {
25211             if (t->intern) {
25212                 *t->p = PyUnicode_InternFromString(t->s);
25213             } else if (t->encoding) {
25214                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25215             } else {
25216                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25217             }
25218         } else {
25219             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25220         }
25221         #endif
25222         if (!*t->p)
25223             return -1;
25224         if (PyObject_Hash(*t->p) == -1)
25225             return -1;
25226         ++t;
25227     }
25228     return 0;
25229 }
25230 
__Pyx_PyUnicode_FromString(const char * c_str)25231 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
25232     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25233 }
__Pyx_PyObject_AsString(PyObject * o)25234 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
25235     Py_ssize_t ignore;
25236     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25237 }
25238 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25239 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25240 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25241     char* defenc_c;
25242     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25243     if (!defenc) return NULL;
25244     defenc_c = PyBytes_AS_STRING(defenc);
25245 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25246     {
25247         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25248         char* c;
25249         for (c = defenc_c; c < end; c++) {
25250             if ((unsigned char) (*c) >= 128) {
25251                 PyUnicode_AsASCIIString(o);
25252                 return NULL;
25253             }
25254         }
25255     }
25256 #endif
25257     *length = PyBytes_GET_SIZE(defenc);
25258     return defenc_c;
25259 }
25260 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25261 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25262     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
25263 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25264     if (likely(PyUnicode_IS_ASCII(o))) {
25265         *length = PyUnicode_GET_LENGTH(o);
25266         return PyUnicode_AsUTF8(o);
25267     } else {
25268         PyUnicode_AsASCIIString(o);
25269         return NULL;
25270     }
25271 #else
25272     return PyUnicode_AsUTF8AndSize(o, length);
25273 #endif
25274 }
25275 #endif
25276 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)25277 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25278 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25279     if (
25280 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25281             __Pyx_sys_getdefaultencoding_not_ascii &&
25282 #endif
25283             PyUnicode_Check(o)) {
25284         return __Pyx_PyUnicode_AsStringAndSize(o, length);
25285     } else
25286 #endif
25287 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25288     if (PyByteArray_Check(o)) {
25289         *length = PyByteArray_GET_SIZE(o);
25290         return PyByteArray_AS_STRING(o);
25291     } else
25292 #endif
25293     {
25294         char* result;
25295         int r = PyBytes_AsStringAndSize(o, &result, length);
25296         if (unlikely(r < 0)) {
25297             return NULL;
25298         } else {
25299             return result;
25300         }
25301     }
25302 }
__Pyx_PyObject_IsTrue(PyObject * x)25303 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
25304    int is_true = x == Py_True;
25305    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
25306    else return PyObject_IsTrue(x);
25307 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)25308 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25309     int retval;
25310     if (unlikely(!x)) return -1;
25311     retval = __Pyx_PyObject_IsTrue(x);
25312     Py_DECREF(x);
25313     return retval;
25314 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)25315 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
25316 #if PY_MAJOR_VERSION >= 3
25317     if (PyLong_Check(result)) {
25318         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25319                 "__int__ returned non-int (type %.200s).  "
25320                 "The ability to return an instance of a strict subclass of int "
25321                 "is deprecated, and may be removed in a future version of Python.",
25322                 Py_TYPE(result)->tp_name)) {
25323             Py_DECREF(result);
25324             return NULL;
25325         }
25326         return result;
25327     }
25328 #endif
25329     PyErr_Format(PyExc_TypeError,
25330                  "__%.4s__ returned non-%.4s (type %.200s)",
25331                  type_name, type_name, Py_TYPE(result)->tp_name);
25332     Py_DECREF(result);
25333     return NULL;
25334 }
__Pyx_PyNumber_IntOrLong(PyObject * x)25335 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25336 #if CYTHON_USE_TYPE_SLOTS
25337   PyNumberMethods *m;
25338 #endif
25339   const char *name = NULL;
25340   PyObject *res = NULL;
25341 #if PY_MAJOR_VERSION < 3
25342   if (likely(PyInt_Check(x) || PyLong_Check(x)))
25343 #else
25344   if (likely(PyLong_Check(x)))
25345 #endif
25346     return __Pyx_NewRef(x);
25347 #if CYTHON_USE_TYPE_SLOTS
25348   m = Py_TYPE(x)->tp_as_number;
25349   #if PY_MAJOR_VERSION < 3
25350   if (m && m->nb_int) {
25351     name = "int";
25352     res = m->nb_int(x);
25353   }
25354   else if (m && m->nb_long) {
25355     name = "long";
25356     res = m->nb_long(x);
25357   }
25358   #else
25359   if (likely(m && m->nb_int)) {
25360     name = "int";
25361     res = m->nb_int(x);
25362   }
25363   #endif
25364 #else
25365   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25366     res = PyNumber_Int(x);
25367   }
25368 #endif
25369   if (likely(res)) {
25370 #if PY_MAJOR_VERSION < 3
25371     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25372 #else
25373     if (unlikely(!PyLong_CheckExact(res))) {
25374 #endif
25375         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25376     }
25377   }
25378   else if (!PyErr_Occurred()) {
25379     PyErr_SetString(PyExc_TypeError,
25380                     "an integer is required");
25381   }
25382   return res;
25383 }
25384 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25385   Py_ssize_t ival;
25386   PyObject *x;
25387 #if PY_MAJOR_VERSION < 3
25388   if (likely(PyInt_CheckExact(b))) {
25389     if (sizeof(Py_ssize_t) >= sizeof(long))
25390         return PyInt_AS_LONG(b);
25391     else
25392         return PyInt_AsSsize_t(b);
25393   }
25394 #endif
25395   if (likely(PyLong_CheckExact(b))) {
25396     #if CYTHON_USE_PYLONG_INTERNALS
25397     const digit* digits = ((PyLongObject*)b)->ob_digit;
25398     const Py_ssize_t size = Py_SIZE(b);
25399     if (likely(__Pyx_sst_abs(size) <= 1)) {
25400         ival = likely(size) ? digits[0] : 0;
25401         if (size == -1) ival = -ival;
25402         return ival;
25403     } else {
25404       switch (size) {
25405          case 2:
25406            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25407              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25408            }
25409            break;
25410          case -2:
25411            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25412              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25413            }
25414            break;
25415          case 3:
25416            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25417              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25418            }
25419            break;
25420          case -3:
25421            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25422              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25423            }
25424            break;
25425          case 4:
25426            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25427              return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25428            }
25429            break;
25430          case -4:
25431            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25432              return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25433            }
25434            break;
25435       }
25436     }
25437     #endif
25438     return PyLong_AsSsize_t(b);
25439   }
25440   x = PyNumber_Index(b);
25441   if (!x) return -1;
25442   ival = PyInt_AsSsize_t(x);
25443   Py_DECREF(x);
25444   return ival;
25445 }
25446 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
25447   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25448 }
25449 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
25450     return PyInt_FromSize_t(ival);
25451 }
25452 
25453 
25454 #endif /* Py_PYTHON_H */
25455