1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/_octree_raytracing.hpp"
8         ],
9         "extra_compile_args": [
10             "-std=c++14"
11         ],
12         "include_dirs": [
13             "yt/utilities/lib"
14         ],
15         "language": "c++",
16         "name": "yt.utilities.lib._octree_raytracing",
17         "sources": [
18             "yt/utilities/lib/_octree_raytracing.pyx"
19         ]
20     },
21     "module_name": "yt.utilities.lib._octree_raytracing"
22 }
23 END: Cython Metadata */
24 
25 #define PY_SSIZE_T_CLEAN
26 #include "Python.h"
27 #ifndef Py_PYTHON_H
28     #error Python headers needed to compile C extensions, please install development version of Python.
29 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
30     #error Cython requires Python 2.6+ or Python 3.3+.
31 #else
32 #define CYTHON_ABI "0_29_12"
33 #define CYTHON_HEX_VERSION 0x001D0CF0
34 #define CYTHON_FUTURE_DIVISION 0
35 #include <stddef.h>
36 #ifndef offsetof
37   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
38 #endif
39 #if !defined(WIN32) && !defined(MS_WINDOWS)
40   #ifndef __stdcall
41     #define __stdcall
42   #endif
43   #ifndef __cdecl
44     #define __cdecl
45   #endif
46   #ifndef __fastcall
47     #define __fastcall
48   #endif
49 #endif
50 #ifndef DL_IMPORT
51   #define DL_IMPORT(t) t
52 #endif
53 #ifndef DL_EXPORT
54   #define DL_EXPORT(t) t
55 #endif
56 #define __PYX_COMMA ,
57 #ifndef HAVE_LONG_LONG
58   #if PY_VERSION_HEX >= 0x02070000
59     #define HAVE_LONG_LONG
60   #endif
61 #endif
62 #ifndef PY_LONG_LONG
63   #define PY_LONG_LONG LONG_LONG
64 #endif
65 #ifndef Py_HUGE_VAL
66   #define Py_HUGE_VAL HUGE_VAL
67 #endif
68 #ifdef PYPY_VERSION
69   #define CYTHON_COMPILING_IN_PYPY 1
70   #define CYTHON_COMPILING_IN_PYSTON 0
71   #define CYTHON_COMPILING_IN_CPYTHON 0
72   #undef CYTHON_USE_TYPE_SLOTS
73   #define CYTHON_USE_TYPE_SLOTS 0
74   #undef CYTHON_USE_PYTYPE_LOOKUP
75   #define CYTHON_USE_PYTYPE_LOOKUP 0
76   #if PY_VERSION_HEX < 0x03050000
77     #undef CYTHON_USE_ASYNC_SLOTS
78     #define CYTHON_USE_ASYNC_SLOTS 0
79   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
80     #define CYTHON_USE_ASYNC_SLOTS 1
81   #endif
82   #undef CYTHON_USE_PYLIST_INTERNALS
83   #define CYTHON_USE_PYLIST_INTERNALS 0
84   #undef CYTHON_USE_UNICODE_INTERNALS
85   #define CYTHON_USE_UNICODE_INTERNALS 0
86   #undef CYTHON_USE_UNICODE_WRITER
87   #define CYTHON_USE_UNICODE_WRITER 0
88   #undef CYTHON_USE_PYLONG_INTERNALS
89   #define CYTHON_USE_PYLONG_INTERNALS 0
90   #undef CYTHON_AVOID_BORROWED_REFS
91   #define CYTHON_AVOID_BORROWED_REFS 1
92   #undef CYTHON_ASSUME_SAFE_MACROS
93   #define CYTHON_ASSUME_SAFE_MACROS 0
94   #undef CYTHON_UNPACK_METHODS
95   #define CYTHON_UNPACK_METHODS 0
96   #undef CYTHON_FAST_THREAD_STATE
97   #define CYTHON_FAST_THREAD_STATE 0
98   #undef CYTHON_FAST_PYCALL
99   #define CYTHON_FAST_PYCALL 0
100   #undef CYTHON_PEP489_MULTI_PHASE_INIT
101   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
102   #undef CYTHON_USE_TP_FINALIZE
103   #define CYTHON_USE_TP_FINALIZE 0
104   #undef CYTHON_USE_DICT_VERSIONS
105   #define CYTHON_USE_DICT_VERSIONS 0
106   #undef CYTHON_USE_EXC_INFO_STACK
107   #define CYTHON_USE_EXC_INFO_STACK 0
108 #elif defined(PYSTON_VERSION)
109   #define CYTHON_COMPILING_IN_PYPY 0
110   #define CYTHON_COMPILING_IN_PYSTON 1
111   #define CYTHON_COMPILING_IN_CPYTHON 0
112   #ifndef CYTHON_USE_TYPE_SLOTS
113     #define CYTHON_USE_TYPE_SLOTS 1
114   #endif
115   #undef CYTHON_USE_PYTYPE_LOOKUP
116   #define CYTHON_USE_PYTYPE_LOOKUP 0
117   #undef CYTHON_USE_ASYNC_SLOTS
118   #define CYTHON_USE_ASYNC_SLOTS 0
119   #undef CYTHON_USE_PYLIST_INTERNALS
120   #define CYTHON_USE_PYLIST_INTERNALS 0
121   #ifndef CYTHON_USE_UNICODE_INTERNALS
122     #define CYTHON_USE_UNICODE_INTERNALS 1
123   #endif
124   #undef CYTHON_USE_UNICODE_WRITER
125   #define CYTHON_USE_UNICODE_WRITER 0
126   #undef CYTHON_USE_PYLONG_INTERNALS
127   #define CYTHON_USE_PYLONG_INTERNALS 0
128   #ifndef CYTHON_AVOID_BORROWED_REFS
129     #define CYTHON_AVOID_BORROWED_REFS 0
130   #endif
131   #ifndef CYTHON_ASSUME_SAFE_MACROS
132     #define CYTHON_ASSUME_SAFE_MACROS 1
133   #endif
134   #ifndef CYTHON_UNPACK_METHODS
135     #define CYTHON_UNPACK_METHODS 1
136   #endif
137   #undef CYTHON_FAST_THREAD_STATE
138   #define CYTHON_FAST_THREAD_STATE 0
139   #undef CYTHON_FAST_PYCALL
140   #define CYTHON_FAST_PYCALL 0
141   #undef CYTHON_PEP489_MULTI_PHASE_INIT
142   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
143   #undef CYTHON_USE_TP_FINALIZE
144   #define CYTHON_USE_TP_FINALIZE 0
145   #undef CYTHON_USE_DICT_VERSIONS
146   #define CYTHON_USE_DICT_VERSIONS 0
147   #undef CYTHON_USE_EXC_INFO_STACK
148   #define CYTHON_USE_EXC_INFO_STACK 0
149 #else
150   #define CYTHON_COMPILING_IN_PYPY 0
151   #define CYTHON_COMPILING_IN_PYSTON 0
152   #define CYTHON_COMPILING_IN_CPYTHON 1
153   #ifndef CYTHON_USE_TYPE_SLOTS
154     #define CYTHON_USE_TYPE_SLOTS 1
155   #endif
156   #if PY_VERSION_HEX < 0x02070000
157     #undef CYTHON_USE_PYTYPE_LOOKUP
158     #define CYTHON_USE_PYTYPE_LOOKUP 0
159   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
160     #define CYTHON_USE_PYTYPE_LOOKUP 1
161   #endif
162   #if PY_MAJOR_VERSION < 3
163     #undef CYTHON_USE_ASYNC_SLOTS
164     #define CYTHON_USE_ASYNC_SLOTS 0
165   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
166     #define CYTHON_USE_ASYNC_SLOTS 1
167   #endif
168   #if PY_VERSION_HEX < 0x02070000
169     #undef CYTHON_USE_PYLONG_INTERNALS
170     #define CYTHON_USE_PYLONG_INTERNALS 0
171   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
172     #define CYTHON_USE_PYLONG_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_PYLIST_INTERNALS
175     #define CYTHON_USE_PYLIST_INTERNALS 1
176   #endif
177   #ifndef CYTHON_USE_UNICODE_INTERNALS
178     #define CYTHON_USE_UNICODE_INTERNALS 1
179   #endif
180   #if PY_VERSION_HEX < 0x030300F0
181     #undef CYTHON_USE_UNICODE_WRITER
182     #define CYTHON_USE_UNICODE_WRITER 0
183   #elif !defined(CYTHON_USE_UNICODE_WRITER)
184     #define CYTHON_USE_UNICODE_WRITER 1
185   #endif
186   #ifndef CYTHON_AVOID_BORROWED_REFS
187     #define CYTHON_AVOID_BORROWED_REFS 0
188   #endif
189   #ifndef CYTHON_ASSUME_SAFE_MACROS
190     #define CYTHON_ASSUME_SAFE_MACROS 1
191   #endif
192   #ifndef CYTHON_UNPACK_METHODS
193     #define CYTHON_UNPACK_METHODS 1
194   #endif
195   #ifndef CYTHON_FAST_THREAD_STATE
196     #define CYTHON_FAST_THREAD_STATE 1
197   #endif
198   #ifndef CYTHON_FAST_PYCALL
199     #define CYTHON_FAST_PYCALL 1
200   #endif
201   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
203   #endif
204   #ifndef CYTHON_USE_TP_FINALIZE
205     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
206   #endif
207   #ifndef CYTHON_USE_DICT_VERSIONS
208     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
209   #endif
210   #ifndef CYTHON_USE_EXC_INFO_STACK
211     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
212   #endif
213 #endif
214 #if !defined(CYTHON_FAST_PYCCALL)
215 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
216 #endif
217 #if CYTHON_USE_PYLONG_INTERNALS
218   #include "longintrepr.h"
219   #undef SHIFT
220   #undef BASE
221   #undef MASK
222   #ifdef SIZEOF_VOID_P
223     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
224   #endif
225 #endif
226 #ifndef __has_attribute
227   #define __has_attribute(x) 0
228 #endif
229 #ifndef __has_cpp_attribute
230   #define __has_cpp_attribute(x) 0
231 #endif
232 #ifndef CYTHON_RESTRICT
233   #if defined(__GNUC__)
234     #define CYTHON_RESTRICT __restrict__
235   #elif defined(_MSC_VER) && _MSC_VER >= 1400
236     #define CYTHON_RESTRICT __restrict
237   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
238     #define CYTHON_RESTRICT restrict
239   #else
240     #define CYTHON_RESTRICT
241   #endif
242 #endif
243 #ifndef CYTHON_UNUSED
244 # if defined(__GNUC__)
245 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
246 #     define CYTHON_UNUSED __attribute__ ((__unused__))
247 #   else
248 #     define CYTHON_UNUSED
249 #   endif
250 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
251 #   define CYTHON_UNUSED __attribute__ ((__unused__))
252 # else
253 #   define CYTHON_UNUSED
254 # endif
255 #endif
256 #ifndef CYTHON_MAYBE_UNUSED_VAR
257 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)258      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
259 #  else
260 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
261 #  endif
262 #endif
263 #ifndef CYTHON_NCP_UNUSED
264 # if CYTHON_COMPILING_IN_CPYTHON
265 #  define CYTHON_NCP_UNUSED
266 # else
267 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
268 # endif
269 #endif
270 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
271 #ifdef _MSC_VER
272     #ifndef _MSC_STDINT_H_
273         #if _MSC_VER < 1300
274            typedef unsigned char     uint8_t;
275            typedef unsigned int      uint32_t;
276         #else
277            typedef unsigned __int8   uint8_t;
278            typedef unsigned __int32  uint32_t;
279         #endif
280     #endif
281 #else
282    #include <stdint.h>
283 #endif
284 #ifndef CYTHON_FALLTHROUGH
285   #if defined(__cplusplus) && __cplusplus >= 201103L
286     #if __has_cpp_attribute(fallthrough)
287       #define CYTHON_FALLTHROUGH [[fallthrough]]
288     #elif __has_cpp_attribute(clang::fallthrough)
289       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
290     #elif __has_cpp_attribute(gnu::fallthrough)
291       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
292     #endif
293   #endif
294   #ifndef CYTHON_FALLTHROUGH
295     #if __has_attribute(fallthrough)
296       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
297     #else
298       #define CYTHON_FALLTHROUGH
299     #endif
300   #endif
301   #if defined(__clang__ ) && defined(__apple_build_version__)
302     #if __apple_build_version__ < 7000000
303       #undef  CYTHON_FALLTHROUGH
304       #define CYTHON_FALLTHROUGH
305     #endif
306   #endif
307 #endif
308 
309 #ifndef __cplusplus
310   #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
311 #endif
312 #ifndef CYTHON_INLINE
313   #if defined(__clang__)
314     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
315   #else
316     #define CYTHON_INLINE inline
317   #endif
318 #endif
319 template<typename T>
__Pyx_call_destructor(T & x)320 void __Pyx_call_destructor(T& x) {
321     x.~T();
322 }
323 template<typename T>
324 class __Pyx_FakeReference {
325   public:
__Pyx_FakeReference()326     __Pyx_FakeReference() : ptr(NULL) { }
__Pyx_FakeReference(const T & ref)327     __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
operator ->()328     T *operator->() { return ptr; }
operator &()329     T *operator&() { return ptr; }
operator T&()330     operator T&() { return *ptr; }
operator ==(U other)331     template<typename U> bool operator ==(U other) { return *ptr == other; }
operator !=(U other)332     template<typename U> bool operator !=(U other) { return *ptr != other; }
333   private:
334     T *ptr;
335 };
336 
337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
338   #define Py_OptimizeFlag 0
339 #endif
340 #define __PYX_BUILD_PY_SSIZE_T "n"
341 #define CYTHON_FORMAT_SSIZE_T "z"
342 #if PY_MAJOR_VERSION < 3
343   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
344   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
345           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
346   #define __Pyx_DefaultClassType PyClass_Type
347 #else
348   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
349 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
350   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
351           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
352 #else
353   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
354           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
355 #endif
356   #define __Pyx_DefaultClassType PyType_Type
357 #endif
358 #ifndef Py_TPFLAGS_CHECKTYPES
359   #define Py_TPFLAGS_CHECKTYPES 0
360 #endif
361 #ifndef Py_TPFLAGS_HAVE_INDEX
362   #define Py_TPFLAGS_HAVE_INDEX 0
363 #endif
364 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
365   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
366 #endif
367 #ifndef Py_TPFLAGS_HAVE_FINALIZE
368   #define Py_TPFLAGS_HAVE_FINALIZE 0
369 #endif
370 #ifndef METH_STACKLESS
371   #define METH_STACKLESS 0
372 #endif
373 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
374   #ifndef METH_FASTCALL
375      #define METH_FASTCALL 0x80
376   #endif
377   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
378   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
379                                                           Py_ssize_t nargs, PyObject *kwnames);
380 #else
381   #define __Pyx_PyCFunctionFast _PyCFunctionFast
382   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
383 #endif
384 #if CYTHON_FAST_PYCCALL
385 #define __Pyx_PyFastCFunction_Check(func)\
386     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
387 #else
388 #define __Pyx_PyFastCFunction_Check(func) 0
389 #endif
390 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
391   #define PyObject_Malloc(s)   PyMem_Malloc(s)
392   #define PyObject_Free(p)     PyMem_Free(p)
393   #define PyObject_Realloc(p)  PyMem_Realloc(p)
394 #endif
395 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
396   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
397   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
398   #define PyMem_RawFree(p)             PyMem_Free(p)
399 #endif
400 #if CYTHON_COMPILING_IN_PYSTON
401   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
402   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
403 #else
404   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
405   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
406 #endif
407 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
408   #define __Pyx_PyThreadState_Current PyThreadState_GET()
409 #elif PY_VERSION_HEX >= 0x03060000
410   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
411 #elif PY_VERSION_HEX >= 0x03000000
412   #define __Pyx_PyThreadState_Current PyThreadState_GET()
413 #else
414   #define __Pyx_PyThreadState_Current _PyThreadState_Current
415 #endif
416 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
417 #include "pythread.h"
418 #define Py_tss_NEEDS_INIT 0
419 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)420 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
421   *key = PyThread_create_key();
422   return 0;
423 }
PyThread_tss_alloc(void)424 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
425   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
426   *key = Py_tss_NEEDS_INIT;
427   return key;
428 }
PyThread_tss_free(Py_tss_t * key)429 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
430   PyObject_Free(key);
431 }
PyThread_tss_is_created(Py_tss_t * key)432 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
433   return *key != Py_tss_NEEDS_INIT;
434 }
PyThread_tss_delete(Py_tss_t * key)435 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
436   PyThread_delete_key(*key);
437   *key = Py_tss_NEEDS_INIT;
438 }
PyThread_tss_set(Py_tss_t * key,void * value)439 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
440   return PyThread_set_key_value(*key, value);
441 }
PyThread_tss_get(Py_tss_t * key)442 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
443   return PyThread_get_key_value(*key);
444 }
445 #endif
446 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
447 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
448 #else
449 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
450 #endif
451 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
452   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
453   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
454 #else
455   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
456   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
457 #endif
458 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
459 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
460 #else
461 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
462 #endif
463 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
464   #define CYTHON_PEP393_ENABLED 1
465   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
466                                               0 : _PyUnicode_Ready((PyObject *)(op)))
467   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
468   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
469   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
470   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
471   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
472   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
473   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
475 #else
476   #define CYTHON_PEP393_ENABLED 0
477   #define PyUnicode_1BYTE_KIND  1
478   #define PyUnicode_2BYTE_KIND  2
479   #define PyUnicode_4BYTE_KIND  4
480   #define __Pyx_PyUnicode_READY(op)       (0)
481   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
482   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
483   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
484   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
485   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
486   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
487   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
488   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY
491   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
492   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
493 #else
494   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
495   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
496       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
497 #endif
498 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
499   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
500 #endif
501 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
502   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
503 #endif
504 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
505   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
506 #endif
507 #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))
508 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
509 #if PY_MAJOR_VERSION >= 3
510   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
511 #else
512   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
513 #endif
514 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
515   #define PyObject_ASCII(o)            PyObject_Repr(o)
516 #endif
517 #if PY_MAJOR_VERSION >= 3
518   #define PyBaseString_Type            PyUnicode_Type
519   #define PyStringObject               PyUnicodeObject
520   #define PyString_Type                PyUnicode_Type
521   #define PyString_Check               PyUnicode_Check
522   #define PyString_CheckExact          PyUnicode_CheckExact
523   #define PyObject_Unicode             PyObject_Str
524 #endif
525 #if PY_MAJOR_VERSION >= 3
526   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
527   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
528 #else
529   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
530   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
531 #endif
532 #ifndef PySet_CheckExact
533   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
534 #endif
535 #if CYTHON_ASSUME_SAFE_MACROS
536   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
537 #else
538   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
539 #endif
540 #if PY_MAJOR_VERSION >= 3
541   #define PyIntObject                  PyLongObject
542   #define PyInt_Type                   PyLong_Type
543   #define PyInt_Check(op)              PyLong_Check(op)
544   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
545   #define PyInt_FromString             PyLong_FromString
546   #define PyInt_FromUnicode            PyLong_FromUnicode
547   #define PyInt_FromLong               PyLong_FromLong
548   #define PyInt_FromSize_t             PyLong_FromSize_t
549   #define PyInt_FromSsize_t            PyLong_FromSsize_t
550   #define PyInt_AsLong                 PyLong_AsLong
551   #define PyInt_AS_LONG                PyLong_AS_LONG
552   #define PyInt_AsSsize_t              PyLong_AsSsize_t
553   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
554   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
555   #define PyNumber_Int                 PyNumber_Long
556 #endif
557 #if PY_MAJOR_VERSION >= 3
558   #define PyBoolObject                 PyLongObject
559 #endif
560 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
561   #ifndef PyUnicode_InternFromString
562     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
563   #endif
564 #endif
565 #if PY_VERSION_HEX < 0x030200A4
566   typedef long Py_hash_t;
567   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
568   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
569 #else
570   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
571   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
572 #endif
573 #if PY_MAJOR_VERSION >= 3
574   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
575 #else
576   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
577 #endif
578 #if CYTHON_USE_ASYNC_SLOTS
579   #if PY_VERSION_HEX >= 0x030500B1
580     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
581     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
582   #else
583     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
584   #endif
585 #else
586   #define __Pyx_PyType_AsAsync(obj) NULL
587 #endif
588 #ifndef __Pyx_PyAsyncMethodsStruct
589     typedef struct {
590         unaryfunc am_await;
591         unaryfunc am_aiter;
592         unaryfunc am_anext;
593     } __Pyx_PyAsyncMethodsStruct;
594 #endif
595 
596 #if defined(WIN32) || defined(MS_WINDOWS)
597   #define _USE_MATH_DEFINES
598 #endif
599 #include <math.h>
600 #ifdef NAN
601 #define __PYX_NAN() ((float) NAN)
602 #else
__PYX_NAN()603 static CYTHON_INLINE float __PYX_NAN() {
604   float value;
605   memset(&value, 0xFF, sizeof(value));
606   return value;
607 }
608 #endif
609 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
610 #define __Pyx_truncl trunc
611 #else
612 #define __Pyx_truncl truncl
613 #endif
614 
615 
616 #define __PYX_ERR(f_index, lineno, Ln_error) \
617 { \
618   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
619 }
620 
621 #ifndef __PYX_EXTERN_C
622   #ifdef __cplusplus
623     #define __PYX_EXTERN_C extern "C"
624   #else
625     #define __PYX_EXTERN_C extern
626   #endif
627 #endif
628 
629 #define __PYX_HAVE__yt__utilities__lib___octree_raytracing
630 #define __PYX_HAVE_API__yt__utilities__lib___octree_raytracing
631 /* Early includes */
632 #include <string.h>
633 #include <stdio.h>
634 #include "numpy/arrayobject.h"
635 #include "numpy/ufuncobject.h"
636 #include "ios"
637 #include "new"
638 #include "stdexcept"
639 #include "typeinfo"
640 #include <vector>
641 #include <stdlib.h>
642 #include "_octree_raytracing.hpp"
643 #include "pythread.h"
644 #include "pystate.h"
645 #ifdef _OPENMP
646 #include <omp.h>
647 #endif /* _OPENMP */
648 
649 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
650 #define CYTHON_WITHOUT_ASSERTIONS
651 #endif
652 
653 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
654                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
655 
656 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
657 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
658 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
659 #define __PYX_DEFAULT_STRING_ENCODING ""
660 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
661 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
662 #define __Pyx_uchar_cast(c) ((unsigned char)c)
663 #define __Pyx_long_cast(x) ((long)x)
664 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
665     (sizeof(type) < sizeof(Py_ssize_t))  ||\
666     (sizeof(type) > sizeof(Py_ssize_t) &&\
667           likely(v < (type)PY_SSIZE_T_MAX ||\
668                  v == (type)PY_SSIZE_T_MAX)  &&\
669           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
670                                 v == (type)PY_SSIZE_T_MIN)))  ||\
671     (sizeof(type) == sizeof(Py_ssize_t) &&\
672           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
673                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)674 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
675     return (size_t) i < (size_t) limit;
676 }
677 #if defined (__cplusplus) && __cplusplus >= 201103L
678     #include <cstdlib>
679     #define __Pyx_sst_abs(value) std::abs(value)
680 #elif SIZEOF_INT >= SIZEOF_SIZE_T
681     #define __Pyx_sst_abs(value) abs(value)
682 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
683     #define __Pyx_sst_abs(value) labs(value)
684 #elif defined (_MSC_VER)
685     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
686 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
687     #define __Pyx_sst_abs(value) llabs(value)
688 #elif defined (__GNUC__)
689     #define __Pyx_sst_abs(value) __builtin_llabs(value)
690 #else
691     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
692 #endif
693 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
694 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
695 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
696 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
697 #define __Pyx_PyBytes_FromString        PyBytes_FromString
698 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
699 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
700 #if PY_MAJOR_VERSION < 3
701     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
702     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
703 #else
704     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
705     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
706 #endif
707 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
708 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
709 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
710 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
714 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
715 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
716 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
719 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
720 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
721 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
722 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)723 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
724     const Py_UNICODE *u_end = u;
725     while (*u_end++) ;
726     return (size_t)(u_end - u - 1);
727 }
728 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
729 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
730 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
731 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
732 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
733 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
734 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
735 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
736 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
737 #define __Pyx_PySequence_Tuple(obj)\
738     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
739 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
740 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
741 #if CYTHON_ASSUME_SAFE_MACROS
742 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
743 #else
744 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
745 #endif
746 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
747 #if PY_MAJOR_VERSION >= 3
748 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
749 #else
750 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
751 #endif
752 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
753 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
754 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)755 static int __Pyx_init_sys_getdefaultencoding_params(void) {
756     PyObject* sys;
757     PyObject* default_encoding = NULL;
758     PyObject* ascii_chars_u = NULL;
759     PyObject* ascii_chars_b = NULL;
760     const char* default_encoding_c;
761     sys = PyImport_ImportModule("sys");
762     if (!sys) goto bad;
763     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
764     Py_DECREF(sys);
765     if (!default_encoding) goto bad;
766     default_encoding_c = PyBytes_AsString(default_encoding);
767     if (!default_encoding_c) goto bad;
768     if (strcmp(default_encoding_c, "ascii") == 0) {
769         __Pyx_sys_getdefaultencoding_not_ascii = 0;
770     } else {
771         char ascii_chars[128];
772         int c;
773         for (c = 0; c < 128; c++) {
774             ascii_chars[c] = c;
775         }
776         __Pyx_sys_getdefaultencoding_not_ascii = 1;
777         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
778         if (!ascii_chars_u) goto bad;
779         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
780         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
781             PyErr_Format(
782                 PyExc_ValueError,
783                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
784                 default_encoding_c);
785             goto bad;
786         }
787         Py_DECREF(ascii_chars_u);
788         Py_DECREF(ascii_chars_b);
789     }
790     Py_DECREF(default_encoding);
791     return 0;
792 bad:
793     Py_XDECREF(default_encoding);
794     Py_XDECREF(ascii_chars_u);
795     Py_XDECREF(ascii_chars_b);
796     return -1;
797 }
798 #endif
799 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
800 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
801 #else
802 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
803 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
804 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)805 static int __Pyx_init_sys_getdefaultencoding_params(void) {
806     PyObject* sys;
807     PyObject* default_encoding = NULL;
808     char* default_encoding_c;
809     sys = PyImport_ImportModule("sys");
810     if (!sys) goto bad;
811     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
812     Py_DECREF(sys);
813     if (!default_encoding) goto bad;
814     default_encoding_c = PyBytes_AsString(default_encoding);
815     if (!default_encoding_c) goto bad;
816     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
817     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
818     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
819     Py_DECREF(default_encoding);
820     return 0;
821 bad:
822     Py_XDECREF(default_encoding);
823     return -1;
824 }
825 #endif
826 #endif
827 
828 
829 /* Test for GCC > 2.95 */
830 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
831   #define likely(x)   __builtin_expect(!!(x), 1)
832   #define unlikely(x) __builtin_expect(!!(x), 0)
833 #else /* !__GNUC__ or GCC < 2.95 */
834   #define likely(x)   (x)
835   #define unlikely(x) (x)
836 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)837 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
838 
839 static PyObject *__pyx_m = NULL;
840 static PyObject *__pyx_d;
841 static PyObject *__pyx_b;
842 static PyObject *__pyx_cython_runtime = NULL;
843 static PyObject *__pyx_empty_tuple;
844 static PyObject *__pyx_empty_bytes;
845 static PyObject *__pyx_empty_unicode;
846 static int __pyx_lineno;
847 static int __pyx_clineno = 0;
848 static const char * __pyx_cfilenm= __FILE__;
849 static const char *__pyx_filename;
850 
851 /* Header.proto */
852 #if !defined(CYTHON_CCOMPLEX)
853   #if defined(__cplusplus)
854     #define CYTHON_CCOMPLEX 1
855   #elif defined(_Complex_I)
856     #define CYTHON_CCOMPLEX 1
857   #else
858     #define CYTHON_CCOMPLEX 0
859   #endif
860 #endif
861 #if CYTHON_CCOMPLEX
862   #ifdef __cplusplus
863     #include <complex>
864   #else
865     #include <complex.h>
866   #endif
867 #endif
868 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
869   #undef _Complex_I
870   #define _Complex_I 1.0fj
871 #endif
872 
873 
874 static const char *__pyx_f[] = {
875   "yt/utilities/lib/_octree_raytracing.pyx",
876   "stringsource",
877   "__init__.pxd",
878   "type.pxd",
879   "yt/utilities/lib/partitioned_grid.pxd",
880   "yt/utilities/lib/image_samplers.pxd",
881 };
882 /* MemviewSliceStruct.proto */
883 struct __pyx_memoryview_obj;
884 typedef struct {
885   struct __pyx_memoryview_obj *memview;
886   char *data;
887   Py_ssize_t shape[8];
888   Py_ssize_t strides[8];
889   Py_ssize_t suboffsets[8];
890 } __Pyx_memviewslice;
891 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
892 
893 /* Atomics.proto */
894 #include <pythread.h>
895 #ifndef CYTHON_ATOMICS
896     #define CYTHON_ATOMICS 1
897 #endif
898 #define __pyx_atomic_int_type int
899 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
900                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
901                     !defined(__i386__)
902     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
903     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
904     #ifdef __PYX_DEBUG_ATOMICS
905         #warning "Using GNU atomics"
906     #endif
907 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
908     #include <Windows.h>
909     #undef __pyx_atomic_int_type
910     #define __pyx_atomic_int_type LONG
911     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
912     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
913     #ifdef __PYX_DEBUG_ATOMICS
914         #pragma message ("Using MSVC atomics")
915     #endif
916 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
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         #warning "Using Intel atomics"
921     #endif
922 #else
923     #undef CYTHON_ATOMICS
924     #define CYTHON_ATOMICS 0
925     #ifdef __PYX_DEBUG_ATOMICS
926         #warning "Not using atomics"
927     #endif
928 #endif
929 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
930 #if CYTHON_ATOMICS
931     #define __pyx_add_acquisition_count(memview)\
932              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
933     #define __pyx_sub_acquisition_count(memview)\
934             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
935 #else
936     #define __pyx_add_acquisition_count(memview)\
937             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
938     #define __pyx_sub_acquisition_count(memview)\
939             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
940 #endif
941 
942 /* ForceInitThreads.proto */
943 #ifndef __PYX_FORCE_INIT_THREADS
944   #define __PYX_FORCE_INIT_THREADS 0
945 #endif
946 
947 /* NoFastGil.proto */
948 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
949 #define __Pyx_PyGILState_Release PyGILState_Release
950 #define __Pyx_FastGIL_Remember()
951 #define __Pyx_FastGIL_Forget()
952 #define __Pyx_FastGilFuncInit()
953 
954 /* BufferFormatStructs.proto */
955 #define IS_UNSIGNED(type) (((type) -1) > 0)
956 struct __Pyx_StructField_;
957 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
958 typedef struct {
959   const char* name;
960   struct __Pyx_StructField_* fields;
961   size_t size;
962   size_t arraysize[8];
963   int ndim;
964   char typegroup;
965   char is_unsigned;
966   int flags;
967 } __Pyx_TypeInfo;
968 typedef struct __Pyx_StructField_ {
969   __Pyx_TypeInfo* type;
970   const char* name;
971   size_t offset;
972 } __Pyx_StructField;
973 typedef struct {
974   __Pyx_StructField* field;
975   size_t parent_offset;
976 } __Pyx_BufFmt_StackElem;
977 typedef struct {
978   __Pyx_StructField root;
979   __Pyx_BufFmt_StackElem* head;
980   size_t fmt_offset;
981   size_t new_count, enc_count;
982   size_t struct_alignment;
983   int is_complex;
984   char enc_type;
985   char new_packmode;
986   char enc_packmode;
987   char is_valid_array;
988 } __Pyx_BufFmt_Context;
989 
990 
991 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
992  * # in Cython to enable them only on the right systems.
993  *
994  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
995  * ctypedef npy_int16      int16_t
996  * ctypedef npy_int32      int32_t
997  */
998 typedef npy_int8 __pyx_t_5numpy_int8_t;
999 
1000 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
1001  *
1002  * ctypedef npy_int8       int8_t
1003  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1004  * ctypedef npy_int32      int32_t
1005  * ctypedef npy_int64      int64_t
1006  */
1007 typedef npy_int16 __pyx_t_5numpy_int16_t;
1008 
1009 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
1010  * ctypedef npy_int8       int8_t
1011  * ctypedef npy_int16      int16_t
1012  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1013  * ctypedef npy_int64      int64_t
1014  * #ctypedef npy_int96      int96_t
1015  */
1016 typedef npy_int32 __pyx_t_5numpy_int32_t;
1017 
1018 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1019  * ctypedef npy_int16      int16_t
1020  * ctypedef npy_int32      int32_t
1021  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1022  * #ctypedef npy_int96      int96_t
1023  * #ctypedef npy_int128     int128_t
1024  */
1025 typedef npy_int64 __pyx_t_5numpy_int64_t;
1026 
1027 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1028  * #ctypedef npy_int128     int128_t
1029  *
1030  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1031  * ctypedef npy_uint16     uint16_t
1032  * ctypedef npy_uint32     uint32_t
1033  */
1034 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1035 
1036 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1037  *
1038  * ctypedef npy_uint8      uint8_t
1039  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1040  * ctypedef npy_uint32     uint32_t
1041  * ctypedef npy_uint64     uint64_t
1042  */
1043 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1044 
1045 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1046  * ctypedef npy_uint8      uint8_t
1047  * ctypedef npy_uint16     uint16_t
1048  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1049  * ctypedef npy_uint64     uint64_t
1050  * #ctypedef npy_uint96     uint96_t
1051  */
1052 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1053 
1054 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1055  * ctypedef npy_uint16     uint16_t
1056  * ctypedef npy_uint32     uint32_t
1057  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1058  * #ctypedef npy_uint96     uint96_t
1059  * #ctypedef npy_uint128    uint128_t
1060  */
1061 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1062 
1063 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1064  * #ctypedef npy_uint128    uint128_t
1065  *
1066  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1067  * ctypedef npy_float64    float64_t
1068  * #ctypedef npy_float80    float80_t
1069  */
1070 typedef npy_float32 __pyx_t_5numpy_float32_t;
1071 
1072 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1073  *
1074  * ctypedef npy_float32    float32_t
1075  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1076  * #ctypedef npy_float80    float80_t
1077  * #ctypedef npy_float128   float128_t
1078  */
1079 typedef npy_float64 __pyx_t_5numpy_float64_t;
1080 
1081 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1082  * # The int types are mapped a bit surprising --
1083  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1084  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1085  * ctypedef npy_longlong   long_t
1086  * ctypedef npy_longlong   longlong_t
1087  */
1088 typedef npy_long __pyx_t_5numpy_int_t;
1089 
1090 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1091  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1092  * ctypedef npy_long       int_t
1093  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1094  * ctypedef npy_longlong   longlong_t
1095  *
1096  */
1097 typedef npy_longlong __pyx_t_5numpy_long_t;
1098 
1099 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1100  * ctypedef npy_long       int_t
1101  * ctypedef npy_longlong   long_t
1102  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1103  *
1104  * ctypedef npy_ulong      uint_t
1105  */
1106 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1107 
1108 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1109  * ctypedef npy_longlong   longlong_t
1110  *
1111  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1112  * ctypedef npy_ulonglong  ulong_t
1113  * ctypedef npy_ulonglong  ulonglong_t
1114  */
1115 typedef npy_ulong __pyx_t_5numpy_uint_t;
1116 
1117 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1118  *
1119  * ctypedef npy_ulong      uint_t
1120  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1121  * ctypedef npy_ulonglong  ulonglong_t
1122  *
1123  */
1124 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1125 
1126 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1127  * ctypedef npy_ulong      uint_t
1128  * ctypedef npy_ulonglong  ulong_t
1129  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1130  *
1131  * ctypedef npy_intp       intp_t
1132  */
1133 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1134 
1135 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1136  * ctypedef npy_ulonglong  ulonglong_t
1137  *
1138  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1139  * ctypedef npy_uintp      uintp_t
1140  *
1141  */
1142 typedef npy_intp __pyx_t_5numpy_intp_t;
1143 
1144 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1145  *
1146  * ctypedef npy_intp       intp_t
1147  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1148  *
1149  * ctypedef npy_double     float_t
1150  */
1151 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1152 
1153 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1154  * ctypedef npy_uintp      uintp_t
1155  *
1156  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1157  * ctypedef npy_double     double_t
1158  * ctypedef npy_longdouble longdouble_t
1159  */
1160 typedef npy_double __pyx_t_5numpy_float_t;
1161 
1162 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1163  *
1164  * ctypedef npy_double     float_t
1165  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1166  * ctypedef npy_longdouble longdouble_t
1167  *
1168  */
1169 typedef npy_double __pyx_t_5numpy_double_t;
1170 
1171 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1172  * ctypedef npy_double     float_t
1173  * ctypedef npy_double     double_t
1174  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1175  *
1176  * ctypedef npy_cfloat      cfloat_t
1177  */
1178 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1179 /* Declarations.proto */
1180 #if CYTHON_CCOMPLEX
1181   #ifdef __cplusplus
1182     typedef ::std::complex< float > __pyx_t_float_complex;
1183   #else
1184     typedef float _Complex __pyx_t_float_complex;
1185   #endif
1186 #else
1187     typedef struct { float real, imag; } __pyx_t_float_complex;
1188 #endif
1189 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1190 
1191 /* Declarations.proto */
1192 #if CYTHON_CCOMPLEX
1193   #ifdef __cplusplus
1194     typedef ::std::complex< double > __pyx_t_double_complex;
1195   #else
1196     typedef double _Complex __pyx_t_double_complex;
1197   #endif
1198 #else
1199     typedef struct { double real, imag; } __pyx_t_double_complex;
1200 #endif
1201 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1202 
1203 
1204 /*--- Type declarations ---*/
1205 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1206 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler;
1207 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler;
1208 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler;
1209 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler;
1210 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler;
1211 struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing;
1212 struct __pyx_array_obj;
1213 struct __pyx_MemviewEnum_obj;
1214 struct __pyx_memoryview_obj;
1215 struct __pyx_memoryviewslice_obj;
1216 
1217 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1218  * ctypedef npy_longdouble longdouble_t
1219  *
1220  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1221  * ctypedef npy_cdouble     cdouble_t
1222  * ctypedef npy_clongdouble clongdouble_t
1223  */
1224 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1225 
1226 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1227  *
1228  * ctypedef npy_cfloat      cfloat_t
1229  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1230  * ctypedef npy_clongdouble clongdouble_t
1231  *
1232  */
1233 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1234 
1235 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1236  * ctypedef npy_cfloat      cfloat_t
1237  * ctypedef npy_cdouble     cdouble_t
1238  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1239  *
1240  * ctypedef npy_cdouble     complex_t
1241  */
1242 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1243 
1244 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1245  * ctypedef npy_clongdouble clongdouble_t
1246  *
1247  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1248  *
1249  * cdef inline object PyArray_MultiIterNew1(a):
1250  */
1251 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1252 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer;
1253 
1254 /* "volume_container.pxd":13
1255  *
1256  *
1257  * cdef struct VolumeContainer:             # <<<<<<<<<<<<<<
1258  *     #-----------------------------------------------------------------------------
1259  *     # Encapsulates a volume container used for volume rendering.
1260  */
1261 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer {
1262   int n_fields;
1263   __pyx_t_5numpy_float64_t **data;
1264   __pyx_t_5numpy_uint8_t *mask;
1265   __pyx_t_5numpy_float64_t left_edge[3];
1266   __pyx_t_5numpy_float64_t right_edge[3];
1267   __pyx_t_5numpy_float64_t dds[3];
1268   __pyx_t_5numpy_float64_t idds[3];
1269   int dims[3];
1270 };
1271 struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator;
1272 
1273 /* "image_samplers.pxd":25
1274  * cdef struct VolumeRenderAccumulator
1275  *
1276  * ctypedef int calculate_extent_function(ImageSampler image,             # <<<<<<<<<<<<<<
1277  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
1278  *
1279  */
1280 typedef int __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *);
1281 
1282 /* "image_samplers.pxd":28
1283  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
1284  *
1285  * ctypedef void generate_vector_info_function(ImageSampler im,             # <<<<<<<<<<<<<<
1286  *             np.int64_t vi, np.int64_t vj,
1287  *             np.float64_t width[2],
1288  */
1289 typedef void __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
1290 
1291 /* "image_samplers.pxd":33
1292  *             np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil
1293  *
1294  * cdef struct ImageAccumulator:             # <<<<<<<<<<<<<<
1295  *     np.float64_t rgba[Nch]
1296  *     void *supp_data
1297  */
1298 struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator {
1299   __pyx_t_5numpy_float64_t rgba[4];
1300   void *supp_data;
1301 };
1302 struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume;
1303 
1304 /* "grid_traversal.pxd":18
1305  * from .volume_container cimport VolumeContainer, vc_index, vc_pos_index
1306  *
1307  * ctypedef void sampler_function(             # <<<<<<<<<<<<<<
1308  *                 VolumeContainer *vc,
1309  *                 np.float64_t v_pos[3],
1310  */
1311 typedef void __pyx_t_2yt_9utilities_3lib_14grid_traversal_sampler_function(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *);
1312 
1313 /* "grid_traversal.pxd":47
1314  * # Returns: The number of voxels hit during the traversal phase. If the traversal phase is not reached, returns 0.
1315  * #-----------------------------------------------------------------------------
1316  * cdef int walk_volume(VolumeContainer *vc,             # <<<<<<<<<<<<<<
1317  *                      np.float64_t v_pos[3],
1318  *                      np.float64_t v_dir[3],
1319  */
1320 struct __pyx_opt_args_2yt_9utilities_3lib_14grid_traversal_walk_volume {
1321   int __pyx_n;
1322   __pyx_t_5numpy_float64_t *return_t;
1323   __pyx_t_5numpy_float64_t max_t;
1324 };
1325 
1326 /* "partitioned_grid.pxd":18
1327  *
1328  *
1329  * cdef class PartitionedGrid:             # <<<<<<<<<<<<<<
1330  *     cdef public object my_data
1331  *     cdef public object source_mask
1332  */
1333 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1334   PyObject_HEAD
1335   struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtab;
1336   PyObject *my_data;
1337   PyObject *source_mask;
1338   PyObject *LeftEdge;
1339   PyObject *RightEdge;
1340   int parent_grid_id;
1341   struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *container;
1342   __pyx_t_5numpy_float64_t star_er;
1343   __pyx_t_5numpy_float64_t star_sigma_num;
1344   __pyx_t_5numpy_float64_t star_coeff;
1345 };
1346 
1347 
1348 /* "image_samplers.pxd":37
1349  *     void *supp_data
1350  *
1351  * cdef class ImageSampler:             # <<<<<<<<<<<<<<
1352  *     cdef np.float64_t[:,:,:] vp_pos
1353  *     cdef np.float64_t[:,:,:] vp_dir
1354  */
1355 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler {
1356   PyObject_HEAD
1357   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab;
1358   __Pyx_memviewslice vp_pos;
1359   __Pyx_memviewslice vp_dir;
1360   __pyx_t_5numpy_float64_t *center;
1361   __Pyx_memviewslice image;
1362   __Pyx_memviewslice zbuffer;
1363   __Pyx_memviewslice image_used;
1364   __Pyx_memviewslice mesh_lines;
1365   __pyx_t_5numpy_float64_t pdx;
1366   __pyx_t_5numpy_float64_t pdy;
1367   __pyx_t_5numpy_float64_t bounds[4];
1368   __Pyx_memviewslice camera_data;
1369   int nv[2];
1370   __pyx_t_5numpy_float64_t *x_vec;
1371   __pyx_t_5numpy_float64_t *y_vec;
1372   PyObject *acenter;
1373   PyObject *aimage;
1374   PyObject *ax_vec;
1375   PyObject *ay_vec;
1376   PyObject *azbuffer;
1377   PyObject *aimage_used;
1378   PyObject *amesh_lines;
1379   void *supp_data;
1380   __pyx_t_5numpy_float64_t width[3];
1381   PyObject *lens_type;
1382   PyObject *volume_method;
1383   __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function;
1384   __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function;
1385 };
1386 
1387 
1388 /* "image_samplers.pxd":71
1389  *                 void *data) nogil
1390  *
1391  * cdef class ProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1392  *     pass
1393  *
1394  */
1395 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler {
1396   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1397 };
1398 
1399 
1400 /* "image_samplers.pxd":74
1401  *     pass
1402  *
1403  * cdef class InterpolatedProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1404  *     cdef VolumeRenderAccumulator *vra
1405  *     cdef public object tf_obj
1406  */
1407 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler {
1408   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1409   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1410   PyObject *tf_obj;
1411   PyObject *my_field_tables;
1412 };
1413 
1414 
1415 /* "image_samplers.pxd":79
1416  *     cdef public object my_field_tables
1417  *
1418  * cdef class VolumeRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1419  *     cdef VolumeRenderAccumulator *vra
1420  *     cdef public object tf_obj
1421  */
1422 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler {
1423   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1424   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1425   PyObject *tf_obj;
1426   PyObject *my_field_tables;
1427   PyObject *tree_containers;
1428 };
1429 
1430 
1431 /* "image_samplers.pxd":85
1432  *     cdef object tree_containers
1433  *
1434  * cdef class LightSourceRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1435  *     cdef VolumeRenderAccumulator *vra
1436  *     cdef public object tf_obj
1437  */
1438 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler {
1439   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1440   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1441   PyObject *tf_obj;
1442   PyObject *my_field_tables;
1443 };
1444 
1445 
1446 /* "yt/utilities/lib/_octree_raytracing.pxd":33
1447  *         void cast_ray(double* origins, double* directions, vector[T] keyList, vector[double] tList)
1448  *
1449  * cdef class _OctreeRayTracing:             # <<<<<<<<<<<<<<
1450  *     cdef Octree[int]* oct
1451  *     cdef int depth
1452  */
1453 struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing {
1454   PyObject_HEAD
1455   Octree<int>  *oct;
1456   int depth;
1457 };
1458 
1459 
1460 /* "View.MemoryView":105
1461  *
1462  * @cname("__pyx_array")
1463  * cdef class array:             # <<<<<<<<<<<<<<
1464  *
1465  *     cdef:
1466  */
1467 struct __pyx_array_obj {
1468   PyObject_HEAD
1469   struct __pyx_vtabstruct_array *__pyx_vtab;
1470   char *data;
1471   Py_ssize_t len;
1472   char *format;
1473   int ndim;
1474   Py_ssize_t *_shape;
1475   Py_ssize_t *_strides;
1476   Py_ssize_t itemsize;
1477   PyObject *mode;
1478   PyObject *_format;
1479   void (*callback_free_data)(void *);
1480   int free_data;
1481   int dtype_is_object;
1482 };
1483 
1484 
1485 /* "View.MemoryView":279
1486  *
1487  * @cname('__pyx_MemviewEnum')
1488  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1489  *     cdef object name
1490  *     def __init__(self, name):
1491  */
1492 struct __pyx_MemviewEnum_obj {
1493   PyObject_HEAD
1494   PyObject *name;
1495 };
1496 
1497 
1498 /* "View.MemoryView":330
1499  *
1500  * @cname('__pyx_memoryview')
1501  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1502  *
1503  *     cdef object obj
1504  */
1505 struct __pyx_memoryview_obj {
1506   PyObject_HEAD
1507   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1508   PyObject *obj;
1509   PyObject *_size;
1510   PyObject *_array_interface;
1511   PyThread_type_lock lock;
1512   __pyx_atomic_int acquisition_count[2];
1513   __pyx_atomic_int *acquisition_count_aligned_p;
1514   Py_buffer view;
1515   int flags;
1516   int dtype_is_object;
1517   __Pyx_TypeInfo *typeinfo;
1518 };
1519 
1520 
1521 /* "View.MemoryView":961
1522  *
1523  * @cname('__pyx_memoryviewslice')
1524  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1525  *     "Internal class for passing memoryview slices to Python"
1526  *
1527  */
1528 struct __pyx_memoryviewslice_obj {
1529   struct __pyx_memoryview_obj __pyx_base;
1530   __Pyx_memviewslice from_slice;
1531   PyObject *from_object;
1532   PyObject *(*to_object_func)(char *);
1533   int (*to_dtype_func)(char *, PyObject *);
1534 };
1535 
1536 
1537 
1538 /* "partitioned_grid.pxd":18
1539  *
1540  *
1541  * cdef class PartitionedGrid:             # <<<<<<<<<<<<<<
1542  *     cdef public object my_data
1543  *     cdef public object source_mask
1544  */
1545 
1546 struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1547   void (*get_vector_field)(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
1548 };
1549 static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1550 
1551 
1552 /* "image_samplers.pxd":37
1553  *     void *supp_data
1554  *
1555  * cdef class ImageSampler:             # <<<<<<<<<<<<<<
1556  *     cdef np.float64_t[:,:,:] vp_pos
1557  *     cdef np.float64_t[:,:,:] vp_dir
1558  */
1559 
1560 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler {
1561   void (*setup)(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *);
1562   void (*sample)(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int *, void *);
1563 };
1564 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler;
1565 
1566 
1567 /* "image_samplers.pxd":71
1568  *                 void *data) nogil
1569  *
1570  * cdef class ProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1571  *     pass
1572  *
1573  */
1574 
1575 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler {
1576   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1577 };
1578 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler;
1579 
1580 
1581 /* "image_samplers.pxd":74
1582  *     pass
1583  *
1584  * cdef class InterpolatedProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1585  *     cdef VolumeRenderAccumulator *vra
1586  *     cdef public object tf_obj
1587  */
1588 
1589 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler {
1590   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1591 };
1592 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler;
1593 
1594 
1595 /* "image_samplers.pxd":79
1596  *     cdef public object my_field_tables
1597  *
1598  * cdef class VolumeRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1599  *     cdef VolumeRenderAccumulator *vra
1600  *     cdef public object tf_obj
1601  */
1602 
1603 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler {
1604   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1605 };
1606 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler;
1607 
1608 
1609 /* "image_samplers.pxd":85
1610  *     cdef object tree_containers
1611  *
1612  * cdef class LightSourceRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1613  *     cdef VolumeRenderAccumulator *vra
1614  *     cdef public object tf_obj
1615  */
1616 
1617 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler {
1618   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1619 };
1620 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler;
1621 
1622 
1623 /* "View.MemoryView":105
1624  *
1625  * @cname("__pyx_array")
1626  * cdef class array:             # <<<<<<<<<<<<<<
1627  *
1628  *     cdef:
1629  */
1630 
1631 struct __pyx_vtabstruct_array {
1632   PyObject *(*get_memview)(struct __pyx_array_obj *);
1633 };
1634 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1635 
1636 
1637 /* "View.MemoryView":330
1638  *
1639  * @cname('__pyx_memoryview')
1640  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1641  *
1642  *     cdef object obj
1643  */
1644 
1645 struct __pyx_vtabstruct_memoryview {
1646   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1647   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1648   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1649   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1650   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1651   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1652   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1653 };
1654 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1655 
1656 
1657 /* "View.MemoryView":961
1658  *
1659  * @cname('__pyx_memoryviewslice')
1660  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1661  *     "Internal class for passing memoryview slices to Python"
1662  *
1663  */
1664 
1665 struct __pyx_vtabstruct__memoryviewslice {
1666   struct __pyx_vtabstruct_memoryview __pyx_base;
1667 };
1668 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1669 
1670 /* --- Runtime support code (head) --- */
1671 /* Refnanny.proto */
1672 #ifndef CYTHON_REFNANNY
1673   #define CYTHON_REFNANNY 0
1674 #endif
1675 #if CYTHON_REFNANNY
1676   typedef struct {
1677     void (*INCREF)(void*, PyObject*, int);
1678     void (*DECREF)(void*, PyObject*, int);
1679     void (*GOTREF)(void*, PyObject*, int);
1680     void (*GIVEREF)(void*, PyObject*, int);
1681     void* (*SetupContext)(const char*, int, const char*);
1682     void (*FinishContext)(void**);
1683   } __Pyx_RefNannyAPIStruct;
1684   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1685   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1686   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1687 #ifdef WITH_THREAD
1688   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1689           if (acquire_gil) {\
1690               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1691               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1692               PyGILState_Release(__pyx_gilstate_save);\
1693           } else {\
1694               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1695           }
1696 #else
1697   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1698           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1699 #endif
1700   #define __Pyx_RefNannyFinishContext()\
1701           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1702   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1703   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1704   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1705   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1706   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1707   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1708   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1709   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1710 #else
1711   #define __Pyx_RefNannyDeclarations
1712   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1713   #define __Pyx_RefNannyFinishContext()
1714   #define __Pyx_INCREF(r) Py_INCREF(r)
1715   #define __Pyx_DECREF(r) Py_DECREF(r)
1716   #define __Pyx_GOTREF(r)
1717   #define __Pyx_GIVEREF(r)
1718   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1719   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1720   #define __Pyx_XGOTREF(r)
1721   #define __Pyx_XGIVEREF(r)
1722 #endif
1723 #define __Pyx_XDECREF_SET(r, v) do {\
1724         PyObject *tmp = (PyObject *) r;\
1725         r = v; __Pyx_XDECREF(tmp);\
1726     } while (0)
1727 #define __Pyx_DECREF_SET(r, v) do {\
1728         PyObject *tmp = (PyObject *) r;\
1729         r = v; __Pyx_DECREF(tmp);\
1730     } while (0)
1731 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1732 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1733 
1734 /* PyObjectGetAttrStr.proto */
1735 #if CYTHON_USE_TYPE_SLOTS
1736 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1737 #else
1738 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1739 #endif
1740 
1741 /* GetBuiltinName.proto */
1742 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1743 
1744 /* RaiseArgTupleInvalid.proto */
1745 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1746     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1747 
1748 /* RaiseDoubleKeywords.proto */
1749 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1750 
1751 /* ParseKeywords.proto */
1752 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1753     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1754     const char* function_name);
1755 
1756 /* ArgTypeTest.proto */
1757 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1758     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1759         __Pyx__ArgTypeTest(obj, type, name, exact))
1760 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1761 
1762 /* MemviewSliceInit.proto */
1763 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1764 #define __Pyx_MEMVIEW_DIRECT   1
1765 #define __Pyx_MEMVIEW_PTR      2
1766 #define __Pyx_MEMVIEW_FULL     4
1767 #define __Pyx_MEMVIEW_CONTIG   8
1768 #define __Pyx_MEMVIEW_STRIDED  16
1769 #define __Pyx_MEMVIEW_FOLLOW   32
1770 #define __Pyx_IS_C_CONTIG 1
1771 #define __Pyx_IS_F_CONTIG 2
1772 static int __Pyx_init_memviewslice(
1773                 struct __pyx_memoryview_obj *memview,
1774                 int ndim,
1775                 __Pyx_memviewslice *memviewslice,
1776                 int memview_is_new_reference);
1777 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1778     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1779 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1780     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1781 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1782 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1783 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1784 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1785 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1786 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1787 
1788 /* PyObjectCall.proto */
1789 #if CYTHON_COMPILING_IN_CPYTHON
1790 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1791 #else
1792 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1793 #endif
1794 
1795 /* PyThreadStateGet.proto */
1796 #if CYTHON_FAST_THREAD_STATE
1797 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1798 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1799 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1800 #else
1801 #define __Pyx_PyThreadState_declare
1802 #define __Pyx_PyThreadState_assign
1803 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1804 #endif
1805 
1806 /* PyErrFetchRestore.proto */
1807 #if CYTHON_FAST_THREAD_STATE
1808 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1809 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1810 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1811 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1812 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1813 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1814 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1815 #if CYTHON_COMPILING_IN_CPYTHON
1816 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1817 #else
1818 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1819 #endif
1820 #else
1821 #define __Pyx_PyErr_Clear() PyErr_Clear()
1822 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1823 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1824 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1825 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1826 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1827 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1828 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1829 #endif
1830 
1831 /* RaiseException.proto */
1832 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1833 
1834 /* PyCFunctionFastCall.proto */
1835 #if CYTHON_FAST_PYCCALL
1836 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1837 #else
1838 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1839 #endif
1840 
1841 /* PyFunctionFastCall.proto */
1842 #if CYTHON_FAST_PYCALL
1843 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1844     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1845 #if 1 || PY_VERSION_HEX < 0x030600B1
1846 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1847 #else
1848 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1849 #endif
1850 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1851     (sizeof(char [1 - 2*!(cond)]) - 1)
1852 #ifndef Py_MEMBER_SIZE
1853 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1854 #endif
1855   static size_t __pyx_pyframe_localsplus_offset = 0;
1856   #include "frameobject.h"
1857   #define __Pxy_PyFrame_Initialize_Offsets()\
1858     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1859      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1860   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1861     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1862 #endif
1863 
1864 /* PyObjectCallMethO.proto */
1865 #if CYTHON_COMPILING_IN_CPYTHON
1866 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1867 #endif
1868 
1869 /* PyObjectCallOneArg.proto */
1870 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1871 
1872 /* DictGetItem.proto */
1873 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1874 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1875 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1876     (likely(PyDict_CheckExact(obj)) ?\
1877      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1878 #else
1879 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1880 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1881 #endif
1882 
1883 /* RaiseTooManyValuesToUnpack.proto */
1884 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1885 
1886 /* RaiseNeedMoreValuesToUnpack.proto */
1887 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1888 
1889 /* RaiseNoneIterError.proto */
1890 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1891 
1892 /* ExtTypeTest.proto */
1893 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1894 
1895 /* GetTopmostException.proto */
1896 #if CYTHON_USE_EXC_INFO_STACK
1897 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1898 #endif
1899 
1900 /* SaveResetException.proto */
1901 #if CYTHON_FAST_THREAD_STATE
1902 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1903 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1904 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1905 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1906 #else
1907 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1908 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1909 #endif
1910 
1911 /* PyErrExceptionMatches.proto */
1912 #if CYTHON_FAST_THREAD_STATE
1913 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1914 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1915 #else
1916 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1917 #endif
1918 
1919 /* GetException.proto */
1920 #if CYTHON_FAST_THREAD_STATE
1921 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1922 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1923 #else
1924 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1925 #endif
1926 
1927 /* PyObjectCall2Args.proto */
1928 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1929 
1930 /* IncludeStringH.proto */
1931 #include <string.h>
1932 
1933 /* BytesEquals.proto */
1934 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1935 
1936 /* UnicodeEquals.proto */
1937 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1938 
1939 /* StrEquals.proto */
1940 #if PY_MAJOR_VERSION >= 3
1941 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1942 #else
1943 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1944 #endif
1945 
1946 /* None.proto */
1947 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1948 
1949 /* UnaryNegOverflows.proto */
1950 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1951         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1952 
1953 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1954 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1955 /* GetAttr.proto */
1956 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1957 
1958 /* GetItemInt.proto */
1959 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1960     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1961     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1962     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1963                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1964 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1965     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1966     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1967     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1968 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1969                                                               int wraparound, int boundscheck);
1970 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1971     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1972     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1973     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1974 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1975                                                               int wraparound, int boundscheck);
1976 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1977 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1978                                                      int is_list, int wraparound, int boundscheck);
1979 
1980 /* ObjectGetItem.proto */
1981 #if CYTHON_USE_TYPE_SLOTS
1982 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1983 #else
1984 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1985 #endif
1986 
1987 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1988 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1989     int byteorder = 0;
1990     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1991 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1992 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1993     int byteorder = -1;
1994     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1995 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1996 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1997     int byteorder = 1;
1998     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1999 }
2000 
2001 /* decode_c_string.proto */
2002 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2003          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2004          const char* encoding, const char* errors,
2005          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2006 
2007 /* GetAttr3.proto */
2008 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2009 
2010 /* PyDictVersioning.proto */
2011 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2012 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
2013 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
2014 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2015     (version_var) = __PYX_GET_DICT_VERSION(dict);\
2016     (cache_var) = (value);
2017 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2018     static PY_UINT64_T __pyx_dict_version = 0;\
2019     static PyObject *__pyx_dict_cached_value = NULL;\
2020     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2021         (VAR) = __pyx_dict_cached_value;\
2022     } else {\
2023         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2024         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2025     }\
2026 }
2027 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2028 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2029 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2030 #else
2031 #define __PYX_GET_DICT_VERSION(dict)  (0)
2032 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2033 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
2034 #endif
2035 
2036 /* GetModuleGlobalName.proto */
2037 #if CYTHON_USE_DICT_VERSIONS
2038 #define __Pyx_GetModuleGlobalName(var, name)  {\
2039     static PY_UINT64_T __pyx_dict_version = 0;\
2040     static PyObject *__pyx_dict_cached_value = NULL;\
2041     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2042         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2043         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2044 }
2045 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
2046     PY_UINT64_T __pyx_dict_version;\
2047     PyObject *__pyx_dict_cached_value;\
2048     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2049 }
2050 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2051 #else
2052 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
2053 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
2054 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2055 #endif
2056 
2057 /* SwapException.proto */
2058 #if CYTHON_FAST_THREAD_STATE
2059 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2060 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2061 #else
2062 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2063 #endif
2064 
2065 /* Import.proto */
2066 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2067 
2068 /* FastTypeChecks.proto */
2069 #if CYTHON_COMPILING_IN_CPYTHON
2070 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2071 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2072 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2073 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2074 #else
2075 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2076 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2077 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2078 #endif
2079 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2080 
2081 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2082 /* ListCompAppend.proto */
2083 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)2084 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2085     PyListObject* L = (PyListObject*) list;
2086     Py_ssize_t len = Py_SIZE(list);
2087     if (likely(L->allocated > len)) {
2088         Py_INCREF(x);
2089         PyList_SET_ITEM(list, len, x);
2090         Py_SIZE(list) = len+1;
2091         return 0;
2092     }
2093     return PyList_Append(list, x);
2094 }
2095 #else
2096 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2097 #endif
2098 
2099 /* PyIntBinop.proto */
2100 #if !CYTHON_COMPILING_IN_PYPY
2101 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2102 #else
2103 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2104     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2105 #endif
2106 
2107 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)2108 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2109 #if CYTHON_COMPILING_IN_CPYTHON
2110     PyObject* none = _PyList_Extend((PyListObject*)L, v);
2111     if (unlikely(!none))
2112         return -1;
2113     Py_DECREF(none);
2114     return 0;
2115 #else
2116     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2117 #endif
2118 }
2119 
2120 /* ListAppend.proto */
2121 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)2122 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2123     PyListObject* L = (PyListObject*) list;
2124     Py_ssize_t len = Py_SIZE(list);
2125     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2126         Py_INCREF(x);
2127         PyList_SET_ITEM(list, len, x);
2128         Py_SIZE(list) = len+1;
2129         return 0;
2130     }
2131     return PyList_Append(list, x);
2132 }
2133 #else
2134 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2135 #endif
2136 
2137 /* None.proto */
2138 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2139 
2140 /* None.proto */
2141 static CYTHON_INLINE long __Pyx_div_long(long, long);
2142 
2143 /* WriteUnraisableException.proto */
2144 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2145                                   int lineno, const char *filename,
2146                                   int full_traceback, int nogil);
2147 
2148 /* ImportFrom.proto */
2149 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2150 
2151 /* HasAttr.proto */
2152 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2153 
2154 /* PyObject_GenericGetAttrNoDict.proto */
2155 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2156 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2157 #else
2158 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2159 #endif
2160 
2161 /* PyObject_GenericGetAttr.proto */
2162 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2163 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2164 #else
2165 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2166 #endif
2167 
2168 /* SetupReduce.proto */
2169 static int __Pyx_setup_reduce(PyObject* type_obj);
2170 
2171 /* SetVTable.proto */
2172 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2173 
2174 /* TypeImport.proto */
2175 #ifndef __PYX_HAVE_RT_ImportType_proto
2176 #define __PYX_HAVE_RT_ImportType_proto
2177 enum __Pyx_ImportType_CheckSize {
2178    __Pyx_ImportType_CheckSize_Error = 0,
2179    __Pyx_ImportType_CheckSize_Warn = 1,
2180    __Pyx_ImportType_CheckSize_Ignore = 2
2181 };
2182 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2183 #endif
2184 
2185 /* GetVTable.proto */
2186 static void* __Pyx_GetVtable(PyObject *dict);
2187 
2188 /* CLineInTraceback.proto */
2189 #ifdef CYTHON_CLINE_IN_TRACEBACK
2190 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2191 #else
2192 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2193 #endif
2194 
2195 /* CodeObjectCache.proto */
2196 typedef struct {
2197     PyCodeObject* code_object;
2198     int code_line;
2199 } __Pyx_CodeObjectCacheEntry;
2200 struct __Pyx_CodeObjectCache {
2201     int count;
2202     int max_count;
2203     __Pyx_CodeObjectCacheEntry* entries;
2204 };
2205 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2206 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2207 static PyCodeObject *__pyx_find_code_object(int code_line);
2208 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2209 
2210 /* AddTraceback.proto */
2211 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2212                                int py_line, const char *filename);
2213 
2214 #if PY_MAJOR_VERSION < 3
2215     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2216     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2217 #else
2218     #define __Pyx_GetBuffer PyObject_GetBuffer
2219     #define __Pyx_ReleaseBuffer PyBuffer_Release
2220 #endif
2221 
2222 
2223 /* BufferStructDeclare.proto */
2224 typedef struct {
2225   Py_ssize_t shape, strides, suboffsets;
2226 } __Pyx_Buf_DimInfo;
2227 typedef struct {
2228   size_t refcount;
2229   Py_buffer pybuffer;
2230 } __Pyx_Buffer;
2231 typedef struct {
2232   __Pyx_Buffer *rcbuffer;
2233   char *data;
2234   __Pyx_Buf_DimInfo diminfo[8];
2235 } __Pyx_LocalBuf_ND;
2236 
2237 /* MemviewSliceIsContig.proto */
2238 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2239 
2240 /* OverlappingSlices.proto */
2241 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2242                                 __Pyx_memviewslice *slice2,
2243                                 int ndim, size_t itemsize);
2244 
2245 /* Capsule.proto */
2246 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2247 
2248 /* IsLittleEndian.proto */
2249 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2250 
2251 /* BufferFormatCheck.proto */
2252 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2253 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2254                               __Pyx_BufFmt_StackElem* stack,
2255                               __Pyx_TypeInfo* type);
2256 
2257 /* TypeInfoCompare.proto */
2258 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2259 
2260 /* MemviewSliceValidateAndInit.proto */
2261 static int __Pyx_ValidateAndInit_memviewslice(
2262                 int *axes_specs,
2263                 int c_or_f_flag,
2264                 int buf_flags,
2265                 int ndim,
2266                 __Pyx_TypeInfo *dtype,
2267                 __Pyx_BufFmt_StackElem stack[],
2268                 __Pyx_memviewslice *memviewslice,
2269                 PyObject *original_obj);
2270 
2271 /* ObjectToMemviewSlice.proto */
2272 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *, int writable_flag);
2273 
2274 /* ObjectToMemviewSlice.proto */
2275 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2276 
2277 /* CIntToPy.proto */
2278 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2279 
2280 /* MemviewDtypeToObject.proto */
2281 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2282 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2283 
2284 /* RealImag.proto */
2285 #if CYTHON_CCOMPLEX
2286   #ifdef __cplusplus
2287     #define __Pyx_CREAL(z) ((z).real())
2288     #define __Pyx_CIMAG(z) ((z).imag())
2289   #else
2290     #define __Pyx_CREAL(z) (__real__(z))
2291     #define __Pyx_CIMAG(z) (__imag__(z))
2292   #endif
2293 #else
2294     #define __Pyx_CREAL(z) ((z).real)
2295     #define __Pyx_CIMAG(z) ((z).imag)
2296 #endif
2297 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2298         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2299     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2300     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2301 #else
2302     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2303     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2304 #endif
2305 
2306 /* Arithmetic.proto */
2307 #if CYTHON_CCOMPLEX
2308     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2309     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2310     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2311     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2312     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2313     #define __Pyx_c_neg_float(a)     (-(a))
2314   #ifdef __cplusplus
2315     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2316     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2317     #if 1
2318         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2319         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2320     #endif
2321   #else
2322     #define __Pyx_c_is_zero_float(z) ((z)==0)
2323     #define __Pyx_c_conj_float(z)    (conjf(z))
2324     #if 1
2325         #define __Pyx_c_abs_float(z)     (cabsf(z))
2326         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2327     #endif
2328  #endif
2329 #else
2330     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2331     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2332     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2333     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2334     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2335     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2336     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2337     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2338     #if 1
2339         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2340         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2341     #endif
2342 #endif
2343 
2344 /* Arithmetic.proto */
2345 #if CYTHON_CCOMPLEX
2346     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2347     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2348     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2349     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2350     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2351     #define __Pyx_c_neg_double(a)     (-(a))
2352   #ifdef __cplusplus
2353     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2354     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2355     #if 1
2356         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2357         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2358     #endif
2359   #else
2360     #define __Pyx_c_is_zero_double(z) ((z)==0)
2361     #define __Pyx_c_conj_double(z)    (conj(z))
2362     #if 1
2363         #define __Pyx_c_abs_double(z)     (cabs(z))
2364         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2365     #endif
2366  #endif
2367 #else
2368     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2369     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2370     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2371     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2372     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2373     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2374     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2375     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2376     #if 1
2377         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2378         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2379     #endif
2380 #endif
2381 
2382 /* CIntToPy.proto */
2383 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2384 
2385 /* MemviewSliceCopyTemplate.proto */
2386 static __Pyx_memviewslice
2387 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2388                                  const char *mode, int ndim,
2389                                  size_t sizeof_dtype, int contig_flag,
2390                                  int dtype_is_object);
2391 
2392 /* CIntFromPy.proto */
2393 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2394 
2395 /* CIntFromPy.proto */
2396 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2397 
2398 /* CIntToPy.proto */
2399 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2400 
2401 /* CIntFromPy.proto */
2402 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2403 
2404 /* CheckBinaryVersion.proto */
2405 static int __Pyx_check_binary_version(void);
2406 
2407 /* InitStrings.proto */
2408 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2409 
2410 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2411 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2412 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2413 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2414 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*/
2415 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2416 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2417 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2418 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2419 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2420 
2421 /* Module declarations from 'cpython.buffer' */
2422 
2423 /* Module declarations from 'libc.string' */
2424 
2425 /* Module declarations from 'libc.stdio' */
2426 
2427 /* Module declarations from '__builtin__' */
2428 
2429 /* Module declarations from 'cpython.type' */
2430 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2431 
2432 /* Module declarations from 'cpython' */
2433 
2434 /* Module declarations from 'cpython.object' */
2435 
2436 /* Module declarations from 'cpython.ref' */
2437 
2438 /* Module declarations from 'cpython.mem' */
2439 
2440 /* Module declarations from 'numpy' */
2441 
2442 /* Module declarations from 'numpy' */
2443 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2444 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2445 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2446 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2447 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2448 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2449 
2450 /* Module declarations from 'cython.view' */
2451 
2452 /* Module declarations from 'cython' */
2453 
2454 /* Module declarations from 'libcpp.vector' */
2455 
2456 /* Module declarations from 'libc.stdlib' */
2457 
2458 /* Module declarations from 'yt.utilities.lib.volume_container' */
2459 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, int, int, int); /*proto*/
2460 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_float64_t *); /*proto*/
2461 
2462 /* Module declarations from 'yt.utilities.lib.partitioned_grid' */
2463 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0;
2464 
2465 /* Module declarations from 'yt.utilities.lib.image_samplers' */
2466 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = 0;
2467 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = 0;
2468 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = 0;
2469 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = 0;
2470 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = 0;
2471 
2472 /* Module declarations from 'yt.utilities.lib.grid_traversal' */
2473 
2474 /* Module declarations from 'yt.utilities.lib._octree_raytracing' */
2475 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing = 0;
2476 static PyTypeObject *__pyx_array_type = 0;
2477 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2478 static PyTypeObject *__pyx_memoryview_type = 0;
2479 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2480 static PyObject *generic = 0;
2481 static PyObject *strided = 0;
2482 static PyObject *indirect = 0;
2483 static PyObject *contiguous = 0;
2484 static PyObject *indirect_contiguous = 0;
2485 static int __pyx_memoryview_thread_locks_used;
2486 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2487 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2488 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2489 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2490 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2491 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2492 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2493 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2494 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*/
2495 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2496 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2497 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2498 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2499 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2500 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2501 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2502 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2503 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2504 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2505 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2506 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2507 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2508 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2509 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2510 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2511 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2512 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2513 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2514 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2515 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2516 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2517 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2518 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2519 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2520 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2521 #define __Pyx_MODULE_NAME "yt.utilities.lib._octree_raytracing"
2522 extern int __pyx_module_is_main_yt__utilities__lib___octree_raytracing;
2523 int __pyx_module_is_main_yt__utilities__lib___octree_raytracing = 0;
2524 
2525 /* Implementation of 'yt.utilities.lib._octree_raytracing' */
2526 static PyObject *__pyx_builtin_range;
2527 static PyObject *__pyx_builtin_TypeError;
2528 static PyObject *__pyx_builtin_ValueError;
2529 static PyObject *__pyx_builtin_RuntimeError;
2530 static PyObject *__pyx_builtin_ImportError;
2531 static PyObject *__pyx_builtin_MemoryError;
2532 static PyObject *__pyx_builtin_enumerate;
2533 static PyObject *__pyx_builtin_Ellipsis;
2534 static PyObject *__pyx_builtin_id;
2535 static PyObject *__pyx_builtin_IndexError;
2536 static const char __pyx_k_O[] = "O";
2537 static const char __pyx_k_c[] = "c";
2538 static const char __pyx_k_LE[] = "LE";
2539 static const char __pyx_k_RE[] = "RE";
2540 static const char __pyx_k_id[] = "id";
2541 static const char __pyx_k_np[] = "np";
2542 static const char __pyx_k_key[] = "key";
2543 static const char __pyx_k_new[] = "__new__";
2544 static const char __pyx_k_obj[] = "obj";
2545 static const char __pyx_k_base[] = "base";
2546 static const char __pyx_k_dict[] = "__dict__";
2547 static const char __pyx_k_main[] = "__main__";
2548 static const char __pyx_k_mode[] = "mode";
2549 static const char __pyx_k_name[] = "name";
2550 static const char __pyx_k_ndim[] = "ndim";
2551 static const char __pyx_k_pack[] = "pack";
2552 static const char __pyx_k_size[] = "size";
2553 static const char __pyx_k_step[] = "step";
2554 static const char __pyx_k_stop[] = "stop";
2555 static const char __pyx_k_test[] = "__test__";
2556 static const char __pyx_k_ASCII[] = "ASCII";
2557 static const char __pyx_k_class[] = "__class__";
2558 static const char __pyx_k_depth[] = "depth";
2559 static const char __pyx_k_error[] = "error";
2560 static const char __pyx_k_flags[] = "flags";
2561 static const char __pyx_k_numpy[] = "numpy";
2562 static const char __pyx_k_range[] = "range";
2563 static const char __pyx_k_shape[] = "shape";
2564 static const char __pyx_k_start[] = "start";
2565 static const char __pyx_k_encode[] = "encode";
2566 static const char __pyx_k_format[] = "format";
2567 static const char __pyx_k_import[] = "__import__";
2568 static const char __pyx_k_name_2[] = "__name__";
2569 static const char __pyx_k_pickle[] = "pickle";
2570 static const char __pyx_k_reduce[] = "__reduce__";
2571 static const char __pyx_k_struct[] = "struct";
2572 static const char __pyx_k_unpack[] = "unpack";
2573 static const char __pyx_k_update[] = "update";
2574 static const char __pyx_k_fortran[] = "fortran";
2575 static const char __pyx_k_memview[] = "memview";
2576 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2577 static const char __pyx_k_getstate[] = "__getstate__";
2578 static const char __pyx_k_itemsize[] = "itemsize";
2579 static const char __pyx_k_lvl_view[] = "lvl_view";
2580 static const char __pyx_k_pyx_type[] = "__pyx_type";
2581 static const char __pyx_k_setstate[] = "__setstate__";
2582 static const char __pyx_k_TypeError[] = "TypeError";
2583 static const char __pyx_k_enumerate[] = "enumerate";
2584 static const char __pyx_k_ipos_view[] = "ipos_view";
2585 static const char __pyx_k_pyx_state[] = "__pyx_state";
2586 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2587 static const char __pyx_k_IndexError[] = "IndexError";
2588 static const char __pyx_k_ValueError[] = "ValueError";
2589 static const char __pyx_k_pyx_result[] = "__pyx_result";
2590 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2591 static const char __pyx_k_ImportError[] = "ImportError";
2592 static const char __pyx_k_MemoryError[] = "MemoryError";
2593 static const char __pyx_k_PickleError[] = "PickleError";
2594 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2595 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2596 static const char __pyx_k_stringsource[] = "stringsource";
2597 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2598 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2599 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2600 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2601 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2602 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2603 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2604 static const char __pyx_k_OctreeRayTracing[] = "_OctreeRayTracing";
2605 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2606 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2607 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2608 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2609 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2610 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2611 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2612 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2613 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2614 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2615 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2616 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2617 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2618 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2619 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2620 static const char __pyx_k_self_oct_cannot_be_converted_to[] = "self.oct cannot be converted to a Python object for pickling";
2621 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2622 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2623 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2624 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2625 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2626 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2627 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2628 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2629 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2630 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2631 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2632 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2633 static const char __pyx_k_This_is_a_wrapper_around_the_C_c[] = "This is a wrapper around the C++ class to efficiently cast rays into an octree.\nIt relies on the seminal paper by  J. Revelles,, C.Ure\303\261a and M.Lastra.\n";
2634 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2635 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2636 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2637 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2638 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2639 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2640 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2641 static PyObject *__pyx_n_s_ASCII;
2642 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2643 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2644 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2645 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2646 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2647 static PyObject *__pyx_n_s_Ellipsis;
2648 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2649 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2650 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2651 static PyObject *__pyx_n_s_ImportError;
2652 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2653 static PyObject *__pyx_n_s_IndexError;
2654 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2655 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2656 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2657 static PyObject *__pyx_n_s_LE;
2658 static PyObject *__pyx_n_s_MemoryError;
2659 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2660 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2661 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2662 static PyObject *__pyx_n_b_O;
2663 static PyObject *__pyx_n_s_OctreeRayTracing;
2664 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2665 static PyObject *__pyx_n_s_PickleError;
2666 static PyObject *__pyx_n_s_RE;
2667 static PyObject *__pyx_n_s_RuntimeError;
2668 static PyObject *__pyx_n_s_TypeError;
2669 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2670 static PyObject *__pyx_n_s_ValueError;
2671 static PyObject *__pyx_n_s_View_MemoryView;
2672 static PyObject *__pyx_n_s_allocate_buffer;
2673 static PyObject *__pyx_n_s_base;
2674 static PyObject *__pyx_n_s_c;
2675 static PyObject *__pyx_n_u_c;
2676 static PyObject *__pyx_n_s_class;
2677 static PyObject *__pyx_n_s_cline_in_traceback;
2678 static PyObject *__pyx_kp_s_contiguous_and_direct;
2679 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2680 static PyObject *__pyx_n_s_depth;
2681 static PyObject *__pyx_n_s_dict;
2682 static PyObject *__pyx_n_s_dtype_is_object;
2683 static PyObject *__pyx_n_s_encode;
2684 static PyObject *__pyx_n_s_enumerate;
2685 static PyObject *__pyx_n_s_error;
2686 static PyObject *__pyx_n_s_flags;
2687 static PyObject *__pyx_n_s_format;
2688 static PyObject *__pyx_n_s_fortran;
2689 static PyObject *__pyx_n_u_fortran;
2690 static PyObject *__pyx_n_s_getstate;
2691 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2692 static PyObject *__pyx_n_s_id;
2693 static PyObject *__pyx_n_s_import;
2694 static PyObject *__pyx_n_s_ipos_view;
2695 static PyObject *__pyx_n_s_itemsize;
2696 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2697 static PyObject *__pyx_n_s_key;
2698 static PyObject *__pyx_n_s_lvl_view;
2699 static PyObject *__pyx_n_s_main;
2700 static PyObject *__pyx_n_s_memview;
2701 static PyObject *__pyx_n_s_mode;
2702 static PyObject *__pyx_n_s_name;
2703 static PyObject *__pyx_n_s_name_2;
2704 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2705 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2706 static PyObject *__pyx_n_s_ndim;
2707 static PyObject *__pyx_n_s_new;
2708 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2709 static PyObject *__pyx_n_s_np;
2710 static PyObject *__pyx_n_s_numpy;
2711 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2712 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2713 static PyObject *__pyx_n_s_obj;
2714 static PyObject *__pyx_n_s_pack;
2715 static PyObject *__pyx_n_s_pickle;
2716 static PyObject *__pyx_n_s_pyx_PickleError;
2717 static PyObject *__pyx_n_s_pyx_checksum;
2718 static PyObject *__pyx_n_s_pyx_getbuffer;
2719 static PyObject *__pyx_n_s_pyx_result;
2720 static PyObject *__pyx_n_s_pyx_state;
2721 static PyObject *__pyx_n_s_pyx_type;
2722 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2723 static PyObject *__pyx_n_s_pyx_vtable;
2724 static PyObject *__pyx_n_s_range;
2725 static PyObject *__pyx_n_s_reduce;
2726 static PyObject *__pyx_n_s_reduce_cython;
2727 static PyObject *__pyx_n_s_reduce_ex;
2728 static PyObject *__pyx_kp_s_self_oct_cannot_be_converted_to;
2729 static PyObject *__pyx_n_s_setstate;
2730 static PyObject *__pyx_n_s_setstate_cython;
2731 static PyObject *__pyx_n_s_shape;
2732 static PyObject *__pyx_n_s_size;
2733 static PyObject *__pyx_n_s_start;
2734 static PyObject *__pyx_n_s_step;
2735 static PyObject *__pyx_n_s_stop;
2736 static PyObject *__pyx_kp_s_strided_and_direct;
2737 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2738 static PyObject *__pyx_kp_s_strided_and_indirect;
2739 static PyObject *__pyx_kp_s_stringsource;
2740 static PyObject *__pyx_n_s_struct;
2741 static PyObject *__pyx_n_s_test;
2742 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2743 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2744 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2745 static PyObject *__pyx_n_s_unpack;
2746 static PyObject *__pyx_n_s_update;
2747 static int __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing___init__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, PyArrayObject *__pyx_v_LE, PyArrayObject *__pyx_v_RE, int __pyx_v_depth); /* proto */
2748 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_2add_nodes(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, __Pyx_memviewslice __pyx_v_ipos_view, __Pyx_memviewslice __pyx_v_lvl_view, __Pyx_memviewslice __pyx_v_key); /* proto */
2749 static void __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self); /* proto */
2750 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self); /* proto */
2751 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2752 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2753 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2754 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 */
2755 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 */
2756 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2757 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2758 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2759 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2760 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2761 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 */
2762 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2763 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 */
2764 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2765 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2766 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2767 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2768 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 */
2769 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2770 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2771 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 */
2772 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 */
2773 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2774 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2775 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2776 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2777 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2778 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2779 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2780 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2781 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2782 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2783 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2784 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2787 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2788 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2789 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2790 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 */
2791 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2792 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2793 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2794 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 */
2795 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 */
2796 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2797 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2798 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2799 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2800 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2801 static PyObject *__pyx_int_0;
2802 static PyObject *__pyx_int_1;
2803 static PyObject *__pyx_int_184977713;
2804 static PyObject *__pyx_int_neg_1;
2805 static PyObject *__pyx_tuple_;
2806 static PyObject *__pyx_tuple__2;
2807 static PyObject *__pyx_tuple__3;
2808 static PyObject *__pyx_tuple__4;
2809 static PyObject *__pyx_tuple__5;
2810 static PyObject *__pyx_tuple__6;
2811 static PyObject *__pyx_tuple__7;
2812 static PyObject *__pyx_tuple__8;
2813 static PyObject *__pyx_tuple__9;
2814 static PyObject *__pyx_slice__24;
2815 static PyObject *__pyx_tuple__10;
2816 static PyObject *__pyx_tuple__11;
2817 static PyObject *__pyx_tuple__12;
2818 static PyObject *__pyx_tuple__13;
2819 static PyObject *__pyx_tuple__14;
2820 static PyObject *__pyx_tuple__15;
2821 static PyObject *__pyx_tuple__16;
2822 static PyObject *__pyx_tuple__17;
2823 static PyObject *__pyx_tuple__18;
2824 static PyObject *__pyx_tuple__19;
2825 static PyObject *__pyx_tuple__20;
2826 static PyObject *__pyx_tuple__21;
2827 static PyObject *__pyx_tuple__22;
2828 static PyObject *__pyx_tuple__23;
2829 static PyObject *__pyx_tuple__25;
2830 static PyObject *__pyx_tuple__26;
2831 static PyObject *__pyx_tuple__27;
2832 static PyObject *__pyx_tuple__28;
2833 static PyObject *__pyx_tuple__29;
2834 static PyObject *__pyx_tuple__30;
2835 static PyObject *__pyx_tuple__31;
2836 static PyObject *__pyx_tuple__32;
2837 static PyObject *__pyx_tuple__33;
2838 static PyObject *__pyx_codeobj__34;
2839 /* Late includes */
2840 
2841 /* "yt/utilities/lib/_octree_raytracing.pyx":28
2842  *
2843  * cdef class _OctreeRayTracing:
2844  *     def __init__(self, np.ndarray LE, np.ndarray RE, int depth):             # <<<<<<<<<<<<<<
2845  *         cdef double* LE_ptr = <double *>LE.data
2846  *         cdef double* RE_ptr = <double *>RE.data
2847  */
2848 
2849 /* Python wrapper */
2850 static int __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2851 static int __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2852   PyArrayObject *__pyx_v_LE = 0;
2853   PyArrayObject *__pyx_v_RE = 0;
2854   int __pyx_v_depth;
2855   int __pyx_r;
2856   __Pyx_RefNannyDeclarations
2857   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2858   {
2859     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_LE,&__pyx_n_s_RE,&__pyx_n_s_depth,0};
2860     PyObject* values[3] = {0,0,0};
2861     if (unlikely(__pyx_kwds)) {
2862       Py_ssize_t kw_args;
2863       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2864       switch (pos_args) {
2865         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2866         CYTHON_FALLTHROUGH;
2867         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2868         CYTHON_FALLTHROUGH;
2869         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2870         CYTHON_FALLTHROUGH;
2871         case  0: break;
2872         default: goto __pyx_L5_argtuple_error;
2873       }
2874       kw_args = PyDict_Size(__pyx_kwds);
2875       switch (pos_args) {
2876         case  0:
2877         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_LE)) != 0)) kw_args--;
2878         else goto __pyx_L5_argtuple_error;
2879         CYTHON_FALLTHROUGH;
2880         case  1:
2881         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RE)) != 0)) kw_args--;
2882         else {
2883           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 28, __pyx_L3_error)
2884         }
2885         CYTHON_FALLTHROUGH;
2886         case  2:
2887         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
2888         else {
2889           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 28, __pyx_L3_error)
2890         }
2891       }
2892       if (unlikely(kw_args > 0)) {
2893         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 28, __pyx_L3_error)
2894       }
2895     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2896       goto __pyx_L5_argtuple_error;
2897     } else {
2898       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2899       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2900       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2901     }
2902     __pyx_v_LE = ((PyArrayObject *)values[0]);
2903     __pyx_v_RE = ((PyArrayObject *)values[1]);
2904     __pyx_v_depth = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
2905   }
2906   goto __pyx_L4_argument_unpacking_done;
2907   __pyx_L5_argtuple_error:;
2908   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 28, __pyx_L3_error)
2909   __pyx_L3_error:;
2910   __Pyx_AddTraceback("yt.utilities.lib._octree_raytracing._OctreeRayTracing.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2911   __Pyx_RefNannyFinishContext();
2912   return -1;
2913   __pyx_L4_argument_unpacking_done:;
2914   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_LE), __pyx_ptype_5numpy_ndarray, 1, "LE", 0))) __PYX_ERR(0, 28, __pyx_L1_error)
2915   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_RE), __pyx_ptype_5numpy_ndarray, 1, "RE", 0))) __PYX_ERR(0, 28, __pyx_L1_error)
2916   __pyx_r = __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing___init__(((struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *)__pyx_v_self), __pyx_v_LE, __pyx_v_RE, __pyx_v_depth);
2917 
2918   /* function exit code */
2919   goto __pyx_L0;
2920   __pyx_L1_error:;
2921   __pyx_r = -1;
2922   __pyx_L0:;
2923   __Pyx_RefNannyFinishContext();
2924   return __pyx_r;
2925 }
2926 
__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing___init__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing * __pyx_v_self,PyArrayObject * __pyx_v_LE,PyArrayObject * __pyx_v_RE,int __pyx_v_depth)2927 static int __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing___init__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, PyArrayObject *__pyx_v_LE, PyArrayObject *__pyx_v_RE, int __pyx_v_depth) {
2928   double *__pyx_v_LE_ptr;
2929   double *__pyx_v_RE_ptr;
2930   int __pyx_r;
2931   __Pyx_RefNannyDeclarations
2932   __Pyx_RefNannySetupContext("__init__", 0);
2933 
2934   /* "yt/utilities/lib/_octree_raytracing.pyx":29
2935  * cdef class _OctreeRayTracing:
2936  *     def __init__(self, np.ndarray LE, np.ndarray RE, int depth):
2937  *         cdef double* LE_ptr = <double *>LE.data             # <<<<<<<<<<<<<<
2938  *         cdef double* RE_ptr = <double *>RE.data
2939  *         self.oct = new Octree[int](depth, LE_ptr, RE_ptr)
2940  */
2941   __pyx_v_LE_ptr = ((double *)__pyx_v_LE->data);
2942 
2943   /* "yt/utilities/lib/_octree_raytracing.pyx":30
2944  *     def __init__(self, np.ndarray LE, np.ndarray RE, int depth):
2945  *         cdef double* LE_ptr = <double *>LE.data
2946  *         cdef double* RE_ptr = <double *>RE.data             # <<<<<<<<<<<<<<
2947  *         self.oct = new Octree[int](depth, LE_ptr, RE_ptr)
2948  *         self.depth = depth
2949  */
2950   __pyx_v_RE_ptr = ((double *)__pyx_v_RE->data);
2951 
2952   /* "yt/utilities/lib/_octree_raytracing.pyx":31
2953  *         cdef double* LE_ptr = <double *>LE.data
2954  *         cdef double* RE_ptr = <double *>RE.data
2955  *         self.oct = new Octree[int](depth, LE_ptr, RE_ptr)             # <<<<<<<<<<<<<<
2956  *         self.depth = depth
2957  *
2958  */
2959   __pyx_v_self->oct = new Octree<int> (__pyx_v_depth, __pyx_v_LE_ptr, __pyx_v_RE_ptr);
2960 
2961   /* "yt/utilities/lib/_octree_raytracing.pyx":32
2962  *         cdef double* RE_ptr = <double *>RE.data
2963  *         self.oct = new Octree[int](depth, LE_ptr, RE_ptr)
2964  *         self.depth = depth             # <<<<<<<<<<<<<<
2965  *
2966  *     @cython.boundscheck(False)
2967  */
2968   __pyx_v_self->depth = __pyx_v_depth;
2969 
2970   /* "yt/utilities/lib/_octree_raytracing.pyx":28
2971  *
2972  * cdef class _OctreeRayTracing:
2973  *     def __init__(self, np.ndarray LE, np.ndarray RE, int depth):             # <<<<<<<<<<<<<<
2974  *         cdef double* LE_ptr = <double *>LE.data
2975  *         cdef double* RE_ptr = <double *>RE.data
2976  */
2977 
2978   /* function exit code */
2979   __pyx_r = 0;
2980   __Pyx_RefNannyFinishContext();
2981   return __pyx_r;
2982 }
2983 
2984 /* "yt/utilities/lib/_octree_raytracing.pyx":36
2985  *     @cython.boundscheck(False)
2986  *     @cython.wraparound(False)
2987  *     def add_nodes(self, int[:, :] ipos_view, int[:] lvl_view, int[:] key):             # <<<<<<<<<<<<<<
2988  *         cdef int i
2989  *         cdef int ii[3]
2990  */
2991 
2992 /* Python wrapper */
2993 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_3add_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_3add_nodes(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2994 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_3add_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2995   __Pyx_memviewslice __pyx_v_ipos_view = { 0, 0, { 0 }, { 0 }, { 0 } };
2996   __Pyx_memviewslice __pyx_v_lvl_view = { 0, 0, { 0 }, { 0 }, { 0 } };
2997   __Pyx_memviewslice __pyx_v_key = { 0, 0, { 0 }, { 0 }, { 0 } };
2998   PyObject *__pyx_r = 0;
2999   __Pyx_RefNannyDeclarations
3000   __Pyx_RefNannySetupContext("add_nodes (wrapper)", 0);
3001   {
3002     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ipos_view,&__pyx_n_s_lvl_view,&__pyx_n_s_key,0};
3003     PyObject* values[3] = {0,0,0};
3004     if (unlikely(__pyx_kwds)) {
3005       Py_ssize_t kw_args;
3006       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3007       switch (pos_args) {
3008         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3009         CYTHON_FALLTHROUGH;
3010         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3011         CYTHON_FALLTHROUGH;
3012         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3013         CYTHON_FALLTHROUGH;
3014         case  0: break;
3015         default: goto __pyx_L5_argtuple_error;
3016       }
3017       kw_args = PyDict_Size(__pyx_kwds);
3018       switch (pos_args) {
3019         case  0:
3020         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ipos_view)) != 0)) kw_args--;
3021         else goto __pyx_L5_argtuple_error;
3022         CYTHON_FALLTHROUGH;
3023         case  1:
3024         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvl_view)) != 0)) kw_args--;
3025         else {
3026           __Pyx_RaiseArgtupleInvalid("add_nodes", 1, 3, 3, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3027         }
3028         CYTHON_FALLTHROUGH;
3029         case  2:
3030         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
3031         else {
3032           __Pyx_RaiseArgtupleInvalid("add_nodes", 1, 3, 3, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3033         }
3034       }
3035       if (unlikely(kw_args > 0)) {
3036         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nodes") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
3037       }
3038     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3039       goto __pyx_L5_argtuple_error;
3040     } else {
3041       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3042       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3043       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3044     }
3045     __pyx_v_ipos_view = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ipos_view.memview)) __PYX_ERR(0, 36, __pyx_L3_error)
3046     __pyx_v_lvl_view = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_lvl_view.memview)) __PYX_ERR(0, 36, __pyx_L3_error)
3047     __pyx_v_key = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_key.memview)) __PYX_ERR(0, 36, __pyx_L3_error)
3048   }
3049   goto __pyx_L4_argument_unpacking_done;
3050   __pyx_L5_argtuple_error:;
3051   __Pyx_RaiseArgtupleInvalid("add_nodes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
3052   __pyx_L3_error:;
3053   __Pyx_AddTraceback("yt.utilities.lib._octree_raytracing._OctreeRayTracing.add_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3054   __Pyx_RefNannyFinishContext();
3055   return NULL;
3056   __pyx_L4_argument_unpacking_done:;
3057   __pyx_r = __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_2add_nodes(((struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *)__pyx_v_self), __pyx_v_ipos_view, __pyx_v_lvl_view, __pyx_v_key);
3058 
3059   /* function exit code */
3060   __Pyx_RefNannyFinishContext();
3061   return __pyx_r;
3062 }
3063 
__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_2add_nodes(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing * __pyx_v_self,__Pyx_memviewslice __pyx_v_ipos_view,__Pyx_memviewslice __pyx_v_lvl_view,__Pyx_memviewslice __pyx_v_key)3064 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_2add_nodes(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, __Pyx_memviewslice __pyx_v_ipos_view, __Pyx_memviewslice __pyx_v_lvl_view, __Pyx_memviewslice __pyx_v_key) {
3065   int __pyx_v_i;
3066   int __pyx_v_ii[3];
3067   PyObject *__pyx_r = NULL;
3068   __Pyx_RefNannyDeclarations
3069   size_t __pyx_t_1;
3070   Py_ssize_t __pyx_t_2;
3071   int __pyx_t_3;
3072   Py_ssize_t __pyx_t_4;
3073   Py_ssize_t __pyx_t_5;
3074   Py_ssize_t __pyx_t_6;
3075   Py_ssize_t __pyx_t_7;
3076   Py_ssize_t __pyx_t_8;
3077   Py_ssize_t __pyx_t_9;
3078   Py_ssize_t __pyx_t_10;
3079   Py_ssize_t __pyx_t_11;
3080   __Pyx_RefNannySetupContext("add_nodes", 0);
3081 
3082   /* "yt/utilities/lib/_octree_raytracing.pyx":40
3083  *         cdef int ii[3]
3084  *
3085  *         for i in range(len(key)):             # <<<<<<<<<<<<<<
3086  *             ii[0] = ipos_view[i, 0]
3087  *             ii[1] = ipos_view[i, 1]
3088  */
3089   __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_key);
3090   __pyx_t_2 = __pyx_t_1;
3091   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3092     __pyx_v_i = __pyx_t_3;
3093 
3094     /* "yt/utilities/lib/_octree_raytracing.pyx":41
3095  *
3096  *         for i in range(len(key)):
3097  *             ii[0] = ipos_view[i, 0]             # <<<<<<<<<<<<<<
3098  *             ii[1] = ipos_view[i, 1]
3099  *             ii[2] = ipos_view[i, 2]
3100  */
3101     __pyx_t_4 = __pyx_v_i;
3102     __pyx_t_5 = 0;
3103     (__pyx_v_ii[0]) = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_ipos_view.data + __pyx_t_4 * __pyx_v_ipos_view.strides[0]) ) + __pyx_t_5 * __pyx_v_ipos_view.strides[1]) )));
3104 
3105     /* "yt/utilities/lib/_octree_raytracing.pyx":42
3106  *         for i in range(len(key)):
3107  *             ii[0] = ipos_view[i, 0]
3108  *             ii[1] = ipos_view[i, 1]             # <<<<<<<<<<<<<<
3109  *             ii[2] = ipos_view[i, 2]
3110  *             self.oct.insert_node_no_ret(ii, lvl_view[i], <int> key[i])
3111  */
3112     __pyx_t_6 = __pyx_v_i;
3113     __pyx_t_7 = 1;
3114     (__pyx_v_ii[1]) = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_ipos_view.data + __pyx_t_6 * __pyx_v_ipos_view.strides[0]) ) + __pyx_t_7 * __pyx_v_ipos_view.strides[1]) )));
3115 
3116     /* "yt/utilities/lib/_octree_raytracing.pyx":43
3117  *             ii[0] = ipos_view[i, 0]
3118  *             ii[1] = ipos_view[i, 1]
3119  *             ii[2] = ipos_view[i, 2]             # <<<<<<<<<<<<<<
3120  *             self.oct.insert_node_no_ret(ii, lvl_view[i], <int> key[i])
3121  *
3122  */
3123     __pyx_t_8 = __pyx_v_i;
3124     __pyx_t_9 = 2;
3125     (__pyx_v_ii[2]) = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_ipos_view.data + __pyx_t_8 * __pyx_v_ipos_view.strides[0]) ) + __pyx_t_9 * __pyx_v_ipos_view.strides[1]) )));
3126 
3127     /* "yt/utilities/lib/_octree_raytracing.pyx":44
3128  *             ii[1] = ipos_view[i, 1]
3129  *             ii[2] = ipos_view[i, 2]
3130  *             self.oct.insert_node_no_ret(ii, lvl_view[i], <int> key[i])             # <<<<<<<<<<<<<<
3131  *
3132  *     def __dealloc__(self):
3133  */
3134     __pyx_t_10 = __pyx_v_i;
3135     __pyx_t_11 = __pyx_v_i;
3136     __pyx_v_self->oct->insert_node_no_ret(__pyx_v_ii, (*((int *) ( /* dim=0 */ (__pyx_v_lvl_view.data + __pyx_t_10 * __pyx_v_lvl_view.strides[0]) ))), ((int)(*((int *) ( /* dim=0 */ (__pyx_v_key.data + __pyx_t_11 * __pyx_v_key.strides[0]) )))));
3137   }
3138 
3139   /* "yt/utilities/lib/_octree_raytracing.pyx":36
3140  *     @cython.boundscheck(False)
3141  *     @cython.wraparound(False)
3142  *     def add_nodes(self, int[:, :] ipos_view, int[:] lvl_view, int[:] key):             # <<<<<<<<<<<<<<
3143  *         cdef int i
3144  *         cdef int ii[3]
3145  */
3146 
3147   /* function exit code */
3148   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3149   __PYX_XDEC_MEMVIEW(&__pyx_v_ipos_view, 1);
3150   __PYX_XDEC_MEMVIEW(&__pyx_v_lvl_view, 1);
3151   __PYX_XDEC_MEMVIEW(&__pyx_v_key, 1);
3152   __Pyx_XGIVEREF(__pyx_r);
3153   __Pyx_RefNannyFinishContext();
3154   return __pyx_r;
3155 }
3156 
3157 /* "yt/utilities/lib/_octree_raytracing.pyx":46
3158  *             self.oct.insert_node_no_ret(ii, lvl_view[i], <int> key[i])
3159  *
3160  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
3161  *         del self.oct
3162  */
3163 
3164 /* Python wrapper */
3165 static void __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_5__dealloc__(PyObject * __pyx_v_self)3166 static void __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_5__dealloc__(PyObject *__pyx_v_self) {
3167   __Pyx_RefNannyDeclarations
3168   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3169   __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_4__dealloc__(((struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *)__pyx_v_self));
3170 
3171   /* function exit code */
3172   __Pyx_RefNannyFinishContext();
3173 }
3174 
__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing * __pyx_v_self)3175 static void __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_4__dealloc__(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self) {
3176   __Pyx_RefNannyDeclarations
3177   __Pyx_RefNannySetupContext("__dealloc__", 0);
3178 
3179   /* "yt/utilities/lib/_octree_raytracing.pyx":47
3180  *
3181  *     def __dealloc__(self):
3182  *         del self.oct             # <<<<<<<<<<<<<<
3183  */
3184   delete __pyx_v_self->oct;
3185 
3186   /* "yt/utilities/lib/_octree_raytracing.pyx":46
3187  *             self.oct.insert_node_no_ret(ii, lvl_view[i], <int> key[i])
3188  *
3189  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
3190  *         del self.oct
3191  */
3192 
3193   /* function exit code */
3194   __Pyx_RefNannyFinishContext();
3195 }
3196 
3197 /* "(tree fragment)":1
3198  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3199  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3200  * def __setstate_cython__(self, __pyx_state):
3201  */
3202 
3203 /* Python wrapper */
3204 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_7__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3205 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3206   PyObject *__pyx_r = 0;
3207   __Pyx_RefNannyDeclarations
3208   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3209   __pyx_r = __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_6__reduce_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *)__pyx_v_self));
3210 
3211   /* function exit code */
3212   __Pyx_RefNannyFinishContext();
3213   return __pyx_r;
3214 }
3215 
__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing * __pyx_v_self)3216 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self) {
3217   PyObject *__pyx_r = NULL;
3218   __Pyx_RefNannyDeclarations
3219   PyObject *__pyx_t_1 = NULL;
3220   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3221 
3222   /* "(tree fragment)":2
3223  * def __reduce_cython__(self):
3224  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
3225  * def __setstate_cython__(self, __pyx_state):
3226  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3227  */
3228   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3229   __Pyx_GOTREF(__pyx_t_1);
3230   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3231   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3232   __PYX_ERR(1, 2, __pyx_L1_error)
3233 
3234   /* "(tree fragment)":1
3235  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3236  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3237  * def __setstate_cython__(self, __pyx_state):
3238  */
3239 
3240   /* function exit code */
3241   __pyx_L1_error:;
3242   __Pyx_XDECREF(__pyx_t_1);
3243   __Pyx_AddTraceback("yt.utilities.lib._octree_raytracing._OctreeRayTracing.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3244   __pyx_r = NULL;
3245   __Pyx_XGIVEREF(__pyx_r);
3246   __Pyx_RefNannyFinishContext();
3247   return __pyx_r;
3248 }
3249 
3250 /* "(tree fragment)":3
3251  * def __reduce_cython__(self):
3252  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3253  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3254  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3255  */
3256 
3257 /* Python wrapper */
3258 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_9__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3259 static PyObject *__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3260   PyObject *__pyx_r = 0;
3261   __Pyx_RefNannyDeclarations
3262   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3263   __pyx_r = __pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_8__setstate_cython__(((struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3264 
3265   /* function exit code */
3266   __Pyx_RefNannyFinishContext();
3267   return __pyx_r;
3268 }
3269 
__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)3270 static PyObject *__pyx_pf_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3271   PyObject *__pyx_r = NULL;
3272   __Pyx_RefNannyDeclarations
3273   PyObject *__pyx_t_1 = NULL;
3274   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3275 
3276   /* "(tree fragment)":4
3277  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3278  * def __setstate_cython__(self, __pyx_state):
3279  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
3280  */
3281   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3282   __Pyx_GOTREF(__pyx_t_1);
3283   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3284   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3285   __PYX_ERR(1, 4, __pyx_L1_error)
3286 
3287   /* "(tree fragment)":3
3288  * def __reduce_cython__(self):
3289  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3290  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3291  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
3292  */
3293 
3294   /* function exit code */
3295   __pyx_L1_error:;
3296   __Pyx_XDECREF(__pyx_t_1);
3297   __Pyx_AddTraceback("yt.utilities.lib._octree_raytracing._OctreeRayTracing.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3298   __pyx_r = NULL;
3299   __Pyx_XGIVEREF(__pyx_r);
3300   __Pyx_RefNannyFinishContext();
3301   return __pyx_r;
3302 }
3303 
3304 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
3305  *         # experimental exception made for __getbuffer__ and __releasebuffer__
3306  *         # -- the details of this may change.
3307  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
3308  *             # This implementation of getbuffer is geared towards Cython
3309  *             # requirements, and does not yet fulfill the PEP.
3310  */
3311 
3312 /* Python wrapper */
3313 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)3314 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3315   int __pyx_r;
3316   __Pyx_RefNannyDeclarations
3317   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
3318   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
3319 
3320   /* function exit code */
3321   __Pyx_RefNannyFinishContext();
3322   return __pyx_r;
3323 }
3324 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3325 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3326   int __pyx_v_i;
3327   int __pyx_v_ndim;
3328   int __pyx_v_endian_detector;
3329   int __pyx_v_little_endian;
3330   int __pyx_v_t;
3331   char *__pyx_v_f;
3332   PyArray_Descr *__pyx_v_descr = 0;
3333   int __pyx_v_offset;
3334   int __pyx_r;
3335   __Pyx_RefNannyDeclarations
3336   int __pyx_t_1;
3337   int __pyx_t_2;
3338   PyObject *__pyx_t_3 = NULL;
3339   int __pyx_t_4;
3340   int __pyx_t_5;
3341   int __pyx_t_6;
3342   PyArray_Descr *__pyx_t_7;
3343   PyObject *__pyx_t_8 = NULL;
3344   char *__pyx_t_9;
3345   if (__pyx_v_info == NULL) {
3346     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
3347     return -1;
3348   }
3349   __Pyx_RefNannySetupContext("__getbuffer__", 0);
3350   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
3351   __Pyx_GIVEREF(__pyx_v_info->obj);
3352 
3353   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
3354  *
3355  *             cdef int i, ndim
3356  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
3357  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3358  *
3359  */
3360   __pyx_v_endian_detector = 1;
3361 
3362   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
3363  *             cdef int i, ndim
3364  *             cdef int endian_detector = 1
3365  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
3366  *
3367  *             ndim = PyArray_NDIM(self)
3368  */
3369   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3370 
3371   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
3372  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3373  *
3374  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
3375  *
3376  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3377  */
3378   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
3379 
3380   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
3381  *             ndim = PyArray_NDIM(self)
3382  *
3383  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3384  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3385  *                 raise ValueError(u"ndarray is not C contiguous")
3386  */
3387   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
3388   if (__pyx_t_2) {
3389   } else {
3390     __pyx_t_1 = __pyx_t_2;
3391     goto __pyx_L4_bool_binop_done;
3392   }
3393 
3394   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
3395  *
3396  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3397  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
3398  *                 raise ValueError(u"ndarray is not C contiguous")
3399  *
3400  */
3401   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
3402   __pyx_t_1 = __pyx_t_2;
3403   __pyx_L4_bool_binop_done:;
3404 
3405   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
3406  *             ndim = PyArray_NDIM(self)
3407  *
3408  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3409  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3410  *                 raise ValueError(u"ndarray is not C contiguous")
3411  */
3412   if (unlikely(__pyx_t_1)) {
3413 
3414     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
3415  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3416  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3417  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
3418  *
3419  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3420  */
3421     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
3422     __Pyx_GOTREF(__pyx_t_3);
3423     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3424     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3425     __PYX_ERR(2, 272, __pyx_L1_error)
3426 
3427     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
3428  *             ndim = PyArray_NDIM(self)
3429  *
3430  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
3431  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
3432  *                 raise ValueError(u"ndarray is not C contiguous")
3433  */
3434   }
3435 
3436   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
3437  *                 raise ValueError(u"ndarray is not C contiguous")
3438  *
3439  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3440  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3441  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3442  */
3443   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
3444   if (__pyx_t_2) {
3445   } else {
3446     __pyx_t_1 = __pyx_t_2;
3447     goto __pyx_L7_bool_binop_done;
3448   }
3449 
3450   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
3451  *
3452  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3453  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
3454  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3455  *
3456  */
3457   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
3458   __pyx_t_1 = __pyx_t_2;
3459   __pyx_L7_bool_binop_done:;
3460 
3461   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
3462  *                 raise ValueError(u"ndarray is not C contiguous")
3463  *
3464  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3465  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3466  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3467  */
3468   if (unlikely(__pyx_t_1)) {
3469 
3470     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
3471  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3472  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3473  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
3474  *
3475  *             info.buf = PyArray_DATA(self)
3476  */
3477     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
3478     __Pyx_GOTREF(__pyx_t_3);
3479     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3480     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3481     __PYX_ERR(2, 276, __pyx_L1_error)
3482 
3483     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
3484  *                 raise ValueError(u"ndarray is not C contiguous")
3485  *
3486  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
3487  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
3488  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3489  */
3490   }
3491 
3492   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
3493  *                 raise ValueError(u"ndarray is not Fortran contiguous")
3494  *
3495  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
3496  *             info.ndim = ndim
3497  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3498  */
3499   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
3500 
3501   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
3502  *
3503  *             info.buf = PyArray_DATA(self)
3504  *             info.ndim = ndim             # <<<<<<<<<<<<<<
3505  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3506  *                 # Allocate new buffer for strides and shape info.
3507  */
3508   __pyx_v_info->ndim = __pyx_v_ndim;
3509 
3510   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
3511  *             info.buf = PyArray_DATA(self)
3512  *             info.ndim = ndim
3513  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3514  *                 # Allocate new buffer for strides and shape info.
3515  *                 # This is allocated as one block, strides first.
3516  */
3517   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3518   if (__pyx_t_1) {
3519 
3520     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
3521  *                 # Allocate new buffer for strides and shape info.
3522  *                 # This is allocated as one block, strides first.
3523  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
3524  *                 info.shape = info.strides + ndim
3525  *                 for i in range(ndim):
3526  */
3527     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
3528 
3529     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
3530  *                 # This is allocated as one block, strides first.
3531  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
3532  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
3533  *                 for i in range(ndim):
3534  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3535  */
3536     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
3537 
3538     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
3539  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
3540  *                 info.shape = info.strides + ndim
3541  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
3542  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3543  *                     info.shape[i] = PyArray_DIMS(self)[i]
3544  */
3545     __pyx_t_4 = __pyx_v_ndim;
3546     __pyx_t_5 = __pyx_t_4;
3547     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3548       __pyx_v_i = __pyx_t_6;
3549 
3550       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
3551  *                 info.shape = info.strides + ndim
3552  *                 for i in range(ndim):
3553  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
3554  *                     info.shape[i] = PyArray_DIMS(self)[i]
3555  *             else:
3556  */
3557       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
3558 
3559       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
3560  *                 for i in range(ndim):
3561  *                     info.strides[i] = PyArray_STRIDES(self)[i]
3562  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
3563  *             else:
3564  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3565  */
3566       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
3567     }
3568 
3569     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
3570  *             info.buf = PyArray_DATA(self)
3571  *             info.ndim = ndim
3572  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3573  *                 # Allocate new buffer for strides and shape info.
3574  *                 # This is allocated as one block, strides first.
3575  */
3576     goto __pyx_L9;
3577   }
3578 
3579   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
3580  *                     info.shape[i] = PyArray_DIMS(self)[i]
3581  *             else:
3582  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
3583  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3584  *             info.suboffsets = NULL
3585  */
3586   /*else*/ {
3587     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
3588 
3589     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
3590  *             else:
3591  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3592  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
3593  *             info.suboffsets = NULL
3594  *             info.itemsize = PyArray_ITEMSIZE(self)
3595  */
3596     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
3597   }
3598   __pyx_L9:;
3599 
3600   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
3601  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3602  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3603  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
3604  *             info.itemsize = PyArray_ITEMSIZE(self)
3605  *             info.readonly = not PyArray_ISWRITEABLE(self)
3606  */
3607   __pyx_v_info->suboffsets = NULL;
3608 
3609   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
3610  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3611  *             info.suboffsets = NULL
3612  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
3613  *             info.readonly = not PyArray_ISWRITEABLE(self)
3614  *
3615  */
3616   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
3617 
3618   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
3619  *             info.suboffsets = NULL
3620  *             info.itemsize = PyArray_ITEMSIZE(self)
3621  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
3622  *
3623  *             cdef int t
3624  */
3625   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
3626 
3627   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
3628  *
3629  *             cdef int t
3630  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
3631  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
3632  *             cdef int offset
3633  */
3634   __pyx_v_f = NULL;
3635 
3636   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
3637  *             cdef int t
3638  *             cdef char* f = NULL
3639  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
3640  *             cdef int offset
3641  *
3642  */
3643   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
3644   __pyx_t_3 = ((PyObject *)__pyx_t_7);
3645   __Pyx_INCREF(__pyx_t_3);
3646   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
3647   __pyx_t_3 = 0;
3648 
3649   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
3650  *             cdef int offset
3651  *
3652  *             info.obj = self             # <<<<<<<<<<<<<<
3653  *
3654  *             if not PyDataType_HASFIELDS(descr):
3655  */
3656   __Pyx_INCREF(((PyObject *)__pyx_v_self));
3657   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3658   __Pyx_GOTREF(__pyx_v_info->obj);
3659   __Pyx_DECREF(__pyx_v_info->obj);
3660   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
3661 
3662   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
3663  *             info.obj = self
3664  *
3665  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
3666  *                 t = descr.type_num
3667  *                 if ((descr.byteorder == c'>' and little_endian) or
3668  */
3669   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
3670   if (__pyx_t_1) {
3671 
3672     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
3673  *
3674  *             if not PyDataType_HASFIELDS(descr):
3675  *                 t = descr.type_num             # <<<<<<<<<<<<<<
3676  *                 if ((descr.byteorder == c'>' and little_endian) or
3677  *                     (descr.byteorder == c'<' and not little_endian)):
3678  */
3679     __pyx_t_4 = __pyx_v_descr->type_num;
3680     __pyx_v_t = __pyx_t_4;
3681 
3682     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
3683  *             if not PyDataType_HASFIELDS(descr):
3684  *                 t = descr.type_num
3685  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3686  *                     (descr.byteorder == c'<' and not little_endian)):
3687  *                     raise ValueError(u"Non-native byte order not supported")
3688  */
3689     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
3690     if (!__pyx_t_2) {
3691       goto __pyx_L15_next_or;
3692     } else {
3693     }
3694     __pyx_t_2 = (__pyx_v_little_endian != 0);
3695     if (!__pyx_t_2) {
3696     } else {
3697       __pyx_t_1 = __pyx_t_2;
3698       goto __pyx_L14_bool_binop_done;
3699     }
3700     __pyx_L15_next_or:;
3701 
3702     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
3703  *                 t = descr.type_num
3704  *                 if ((descr.byteorder == c'>' and little_endian) or
3705  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
3706  *                     raise ValueError(u"Non-native byte order not supported")
3707  *                 if   t == NPY_BYTE:        f = "b"
3708  */
3709     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
3710     if (__pyx_t_2) {
3711     } else {
3712       __pyx_t_1 = __pyx_t_2;
3713       goto __pyx_L14_bool_binop_done;
3714     }
3715     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
3716     __pyx_t_1 = __pyx_t_2;
3717     __pyx_L14_bool_binop_done:;
3718 
3719     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
3720  *             if not PyDataType_HASFIELDS(descr):
3721  *                 t = descr.type_num
3722  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3723  *                     (descr.byteorder == c'<' and not little_endian)):
3724  *                     raise ValueError(u"Non-native byte order not supported")
3725  */
3726     if (unlikely(__pyx_t_1)) {
3727 
3728       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
3729  *                 if ((descr.byteorder == c'>' and little_endian) or
3730  *                     (descr.byteorder == c'<' and not little_endian)):
3731  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
3732  *                 if   t == NPY_BYTE:        f = "b"
3733  *                 elif t == NPY_UBYTE:       f = "B"
3734  */
3735       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
3736       __Pyx_GOTREF(__pyx_t_3);
3737       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3738       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3739       __PYX_ERR(2, 306, __pyx_L1_error)
3740 
3741       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
3742  *             if not PyDataType_HASFIELDS(descr):
3743  *                 t = descr.type_num
3744  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3745  *                     (descr.byteorder == c'<' and not little_endian)):
3746  *                     raise ValueError(u"Non-native byte order not supported")
3747  */
3748     }
3749 
3750     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
3751  *                     (descr.byteorder == c'<' and not little_endian)):
3752  *                     raise ValueError(u"Non-native byte order not supported")
3753  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
3754  *                 elif t == NPY_UBYTE:       f = "B"
3755  *                 elif t == NPY_SHORT:       f = "h"
3756  */
3757     switch (__pyx_v_t) {
3758       case NPY_BYTE:
3759       __pyx_v_f = ((char *)"b");
3760       break;
3761       case NPY_UBYTE:
3762 
3763       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
3764  *                     raise ValueError(u"Non-native byte order not supported")
3765  *                 if   t == NPY_BYTE:        f = "b"
3766  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
3767  *                 elif t == NPY_SHORT:       f = "h"
3768  *                 elif t == NPY_USHORT:      f = "H"
3769  */
3770       __pyx_v_f = ((char *)"B");
3771       break;
3772       case NPY_SHORT:
3773 
3774       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
3775  *                 if   t == NPY_BYTE:        f = "b"
3776  *                 elif t == NPY_UBYTE:       f = "B"
3777  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
3778  *                 elif t == NPY_USHORT:      f = "H"
3779  *                 elif t == NPY_INT:         f = "i"
3780  */
3781       __pyx_v_f = ((char *)"h");
3782       break;
3783       case NPY_USHORT:
3784 
3785       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
3786  *                 elif t == NPY_UBYTE:       f = "B"
3787  *                 elif t == NPY_SHORT:       f = "h"
3788  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
3789  *                 elif t == NPY_INT:         f = "i"
3790  *                 elif t == NPY_UINT:        f = "I"
3791  */
3792       __pyx_v_f = ((char *)"H");
3793       break;
3794       case NPY_INT:
3795 
3796       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
3797  *                 elif t == NPY_SHORT:       f = "h"
3798  *                 elif t == NPY_USHORT:      f = "H"
3799  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
3800  *                 elif t == NPY_UINT:        f = "I"
3801  *                 elif t == NPY_LONG:        f = "l"
3802  */
3803       __pyx_v_f = ((char *)"i");
3804       break;
3805       case NPY_UINT:
3806 
3807       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
3808  *                 elif t == NPY_USHORT:      f = "H"
3809  *                 elif t == NPY_INT:         f = "i"
3810  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
3811  *                 elif t == NPY_LONG:        f = "l"
3812  *                 elif t == NPY_ULONG:       f = "L"
3813  */
3814       __pyx_v_f = ((char *)"I");
3815       break;
3816       case NPY_LONG:
3817 
3818       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
3819  *                 elif t == NPY_INT:         f = "i"
3820  *                 elif t == NPY_UINT:        f = "I"
3821  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
3822  *                 elif t == NPY_ULONG:       f = "L"
3823  *                 elif t == NPY_LONGLONG:    f = "q"
3824  */
3825       __pyx_v_f = ((char *)"l");
3826       break;
3827       case NPY_ULONG:
3828 
3829       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
3830  *                 elif t == NPY_UINT:        f = "I"
3831  *                 elif t == NPY_LONG:        f = "l"
3832  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
3833  *                 elif t == NPY_LONGLONG:    f = "q"
3834  *                 elif t == NPY_ULONGLONG:   f = "Q"
3835  */
3836       __pyx_v_f = ((char *)"L");
3837       break;
3838       case NPY_LONGLONG:
3839 
3840       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
3841  *                 elif t == NPY_LONG:        f = "l"
3842  *                 elif t == NPY_ULONG:       f = "L"
3843  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
3844  *                 elif t == NPY_ULONGLONG:   f = "Q"
3845  *                 elif t == NPY_FLOAT:       f = "f"
3846  */
3847       __pyx_v_f = ((char *)"q");
3848       break;
3849       case NPY_ULONGLONG:
3850 
3851       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
3852  *                 elif t == NPY_ULONG:       f = "L"
3853  *                 elif t == NPY_LONGLONG:    f = "q"
3854  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
3855  *                 elif t == NPY_FLOAT:       f = "f"
3856  *                 elif t == NPY_DOUBLE:      f = "d"
3857  */
3858       __pyx_v_f = ((char *)"Q");
3859       break;
3860       case NPY_FLOAT:
3861 
3862       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
3863  *                 elif t == NPY_LONGLONG:    f = "q"
3864  *                 elif t == NPY_ULONGLONG:   f = "Q"
3865  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
3866  *                 elif t == NPY_DOUBLE:      f = "d"
3867  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3868  */
3869       __pyx_v_f = ((char *)"f");
3870       break;
3871       case NPY_DOUBLE:
3872 
3873       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
3874  *                 elif t == NPY_ULONGLONG:   f = "Q"
3875  *                 elif t == NPY_FLOAT:       f = "f"
3876  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
3877  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3878  *                 elif t == NPY_CFLOAT:      f = "Zf"
3879  */
3880       __pyx_v_f = ((char *)"d");
3881       break;
3882       case NPY_LONGDOUBLE:
3883 
3884       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
3885  *                 elif t == NPY_FLOAT:       f = "f"
3886  *                 elif t == NPY_DOUBLE:      f = "d"
3887  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
3888  *                 elif t == NPY_CFLOAT:      f = "Zf"
3889  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3890  */
3891       __pyx_v_f = ((char *)"g");
3892       break;
3893       case NPY_CFLOAT:
3894 
3895       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
3896  *                 elif t == NPY_DOUBLE:      f = "d"
3897  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3898  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
3899  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3900  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3901  */
3902       __pyx_v_f = ((char *)"Zf");
3903       break;
3904       case NPY_CDOUBLE:
3905 
3906       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
3907  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3908  *                 elif t == NPY_CFLOAT:      f = "Zf"
3909  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
3910  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3911  *                 elif t == NPY_OBJECT:      f = "O"
3912  */
3913       __pyx_v_f = ((char *)"Zd");
3914       break;
3915       case NPY_CLONGDOUBLE:
3916 
3917       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
3918  *                 elif t == NPY_CFLOAT:      f = "Zf"
3919  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3920  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
3921  *                 elif t == NPY_OBJECT:      f = "O"
3922  *                 else:
3923  */
3924       __pyx_v_f = ((char *)"Zg");
3925       break;
3926       case NPY_OBJECT:
3927 
3928       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
3929  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3930  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3931  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
3932  *                 else:
3933  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3934  */
3935       __pyx_v_f = ((char *)"O");
3936       break;
3937       default:
3938 
3939       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
3940  *                 elif t == NPY_OBJECT:      f = "O"
3941  *                 else:
3942  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
3943  *                 info.format = f
3944  *                 return
3945  */
3946       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
3947       __Pyx_GOTREF(__pyx_t_3);
3948       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
3949       __Pyx_GOTREF(__pyx_t_8);
3950       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3951       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
3952       __Pyx_GOTREF(__pyx_t_3);
3953       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3954       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3955       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3956       __PYX_ERR(2, 325, __pyx_L1_error)
3957       break;
3958     }
3959 
3960     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
3961  *                 else:
3962  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3963  *                 info.format = f             # <<<<<<<<<<<<<<
3964  *                 return
3965  *             else:
3966  */
3967     __pyx_v_info->format = __pyx_v_f;
3968 
3969     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
3970  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3971  *                 info.format = f
3972  *                 return             # <<<<<<<<<<<<<<
3973  *             else:
3974  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
3975  */
3976     __pyx_r = 0;
3977     goto __pyx_L0;
3978 
3979     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
3980  *             info.obj = self
3981  *
3982  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
3983  *                 t = descr.type_num
3984  *                 if ((descr.byteorder == c'>' and little_endian) or
3985  */
3986   }
3987 
3988   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
3989  *                 return
3990  *             else:
3991  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
3992  *                 info.format[0] = c'^' # Native data types, manual alignment
3993  *                 offset = 0
3994  */
3995   /*else*/ {
3996     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
3997 
3998     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
3999  *             else:
4000  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4001  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
4002  *                 offset = 0
4003  *                 f = _util_dtypestring(descr, info.format + 1,
4004  */
4005     (__pyx_v_info->format[0]) = '^';
4006 
4007     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
4008  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4009  *                 info.format[0] = c'^' # Native data types, manual alignment
4010  *                 offset = 0             # <<<<<<<<<<<<<<
4011  *                 f = _util_dtypestring(descr, info.format + 1,
4012  *                                       info.format + _buffer_format_string_len,
4013  */
4014     __pyx_v_offset = 0;
4015 
4016     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
4017  *                 info.format[0] = c'^' # Native data types, manual alignment
4018  *                 offset = 0
4019  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
4020  *                                       info.format + _buffer_format_string_len,
4021  *                                       &offset)
4022  */
4023     __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(2, 332, __pyx_L1_error)
4024     __pyx_v_f = __pyx_t_9;
4025 
4026     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
4027  *                                       info.format + _buffer_format_string_len,
4028  *                                       &offset)
4029  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
4030  *
4031  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4032  */
4033     (__pyx_v_f[0]) = '\x00';
4034   }
4035 
4036   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
4037  *         # experimental exception made for __getbuffer__ and __releasebuffer__
4038  *         # -- the details of this may change.
4039  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
4040  *             # This implementation of getbuffer is geared towards Cython
4041  *             # requirements, and does not yet fulfill the PEP.
4042  */
4043 
4044   /* function exit code */
4045   __pyx_r = 0;
4046   goto __pyx_L0;
4047   __pyx_L1_error:;
4048   __Pyx_XDECREF(__pyx_t_3);
4049   __Pyx_XDECREF(__pyx_t_8);
4050   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4051   __pyx_r = -1;
4052   if (__pyx_v_info->obj != NULL) {
4053     __Pyx_GOTREF(__pyx_v_info->obj);
4054     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4055   }
4056   goto __pyx_L2;
4057   __pyx_L0:;
4058   if (__pyx_v_info->obj == Py_None) {
4059     __Pyx_GOTREF(__pyx_v_info->obj);
4060     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4061   }
4062   __pyx_L2:;
4063   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4064   __Pyx_RefNannyFinishContext();
4065   return __pyx_r;
4066 }
4067 
4068 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
4069  *                 f[0] = c'\0' # Terminate format string
4070  *
4071  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4072  *             if PyArray_HASFIELDS(self):
4073  *                 PyObject_Free(info.format)
4074  */
4075 
4076 /* Python wrapper */
4077 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)4078 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4079   __Pyx_RefNannyDeclarations
4080   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4081   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4082 
4083   /* function exit code */
4084   __Pyx_RefNannyFinishContext();
4085 }
4086 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)4087 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4088   __Pyx_RefNannyDeclarations
4089   int __pyx_t_1;
4090   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4091 
4092   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
4093  *
4094  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4095  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4096  *                 PyObject_Free(info.format)
4097  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4098  */
4099   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4100   if (__pyx_t_1) {
4101 
4102     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
4103  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4104  *             if PyArray_HASFIELDS(self):
4105  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
4106  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4107  *                 PyObject_Free(info.strides)
4108  */
4109     PyObject_Free(__pyx_v_info->format);
4110 
4111     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
4112  *
4113  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4114  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4115  *                 PyObject_Free(info.format)
4116  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4117  */
4118   }
4119 
4120   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
4121  *             if PyArray_HASFIELDS(self):
4122  *                 PyObject_Free(info.format)
4123  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4124  *                 PyObject_Free(info.strides)
4125  *                 # info.shape was stored after info.strides in the same block
4126  */
4127   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4128   if (__pyx_t_1) {
4129 
4130     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
4131  *                 PyObject_Free(info.format)
4132  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4133  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
4134  *                 # info.shape was stored after info.strides in the same block
4135  *
4136  */
4137     PyObject_Free(__pyx_v_info->strides);
4138 
4139     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
4140  *             if PyArray_HASFIELDS(self):
4141  *                 PyObject_Free(info.format)
4142  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4143  *                 PyObject_Free(info.strides)
4144  *                 # info.shape was stored after info.strides in the same block
4145  */
4146   }
4147 
4148   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
4149  *                 f[0] = c'\0' # Terminate format string
4150  *
4151  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4152  *             if PyArray_HASFIELDS(self):
4153  *                 PyObject_Free(info.format)
4154  */
4155 
4156   /* function exit code */
4157   __Pyx_RefNannyFinishContext();
4158 }
4159 
4160 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
4161  * ctypedef npy_cdouble     complex_t
4162  *
4163  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
4164  *     return PyArray_MultiIterNew(1, <void*>a)
4165  *
4166  */
4167 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)4168 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4169   PyObject *__pyx_r = NULL;
4170   __Pyx_RefNannyDeclarations
4171   PyObject *__pyx_t_1 = NULL;
4172   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4173 
4174   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
4175  *
4176  * cdef inline object PyArray_MultiIterNew1(a):
4177  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
4178  *
4179  * cdef inline object PyArray_MultiIterNew2(a, b):
4180  */
4181   __Pyx_XDECREF(__pyx_r);
4182   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
4183   __Pyx_GOTREF(__pyx_t_1);
4184   __pyx_r = __pyx_t_1;
4185   __pyx_t_1 = 0;
4186   goto __pyx_L0;
4187 
4188   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
4189  * ctypedef npy_cdouble     complex_t
4190  *
4191  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
4192  *     return PyArray_MultiIterNew(1, <void*>a)
4193  *
4194  */
4195 
4196   /* function exit code */
4197   __pyx_L1_error:;
4198   __Pyx_XDECREF(__pyx_t_1);
4199   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4200   __pyx_r = 0;
4201   __pyx_L0:;
4202   __Pyx_XGIVEREF(__pyx_r);
4203   __Pyx_RefNannyFinishContext();
4204   return __pyx_r;
4205 }
4206 
4207 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
4208  *     return PyArray_MultiIterNew(1, <void*>a)
4209  *
4210  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
4211  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4212  *
4213  */
4214 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)4215 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4216   PyObject *__pyx_r = NULL;
4217   __Pyx_RefNannyDeclarations
4218   PyObject *__pyx_t_1 = NULL;
4219   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4220 
4221   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
4222  *
4223  * cdef inline object PyArray_MultiIterNew2(a, b):
4224  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
4225  *
4226  * cdef inline object PyArray_MultiIterNew3(a, b, c):
4227  */
4228   __Pyx_XDECREF(__pyx_r);
4229   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
4230   __Pyx_GOTREF(__pyx_t_1);
4231   __pyx_r = __pyx_t_1;
4232   __pyx_t_1 = 0;
4233   goto __pyx_L0;
4234 
4235   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
4236  *     return PyArray_MultiIterNew(1, <void*>a)
4237  *
4238  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
4239  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4240  *
4241  */
4242 
4243   /* function exit code */
4244   __pyx_L1_error:;
4245   __Pyx_XDECREF(__pyx_t_1);
4246   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4247   __pyx_r = 0;
4248   __pyx_L0:;
4249   __Pyx_XGIVEREF(__pyx_r);
4250   __Pyx_RefNannyFinishContext();
4251   return __pyx_r;
4252 }
4253 
4254 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
4255  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4256  *
4257  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
4258  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4259  *
4260  */
4261 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)4262 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4263   PyObject *__pyx_r = NULL;
4264   __Pyx_RefNannyDeclarations
4265   PyObject *__pyx_t_1 = NULL;
4266   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4267 
4268   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
4269  *
4270  * cdef inline object PyArray_MultiIterNew3(a, b, c):
4271  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
4272  *
4273  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4274  */
4275   __Pyx_XDECREF(__pyx_r);
4276   __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(2, 828, __pyx_L1_error)
4277   __Pyx_GOTREF(__pyx_t_1);
4278   __pyx_r = __pyx_t_1;
4279   __pyx_t_1 = 0;
4280   goto __pyx_L0;
4281 
4282   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
4283  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4284  *
4285  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
4286  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4287  *
4288  */
4289 
4290   /* function exit code */
4291   __pyx_L1_error:;
4292   __Pyx_XDECREF(__pyx_t_1);
4293   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4294   __pyx_r = 0;
4295   __pyx_L0:;
4296   __Pyx_XGIVEREF(__pyx_r);
4297   __Pyx_RefNannyFinishContext();
4298   return __pyx_r;
4299 }
4300 
4301 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
4302  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4303  *
4304  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
4305  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4306  *
4307  */
4308 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)4309 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) {
4310   PyObject *__pyx_r = NULL;
4311   __Pyx_RefNannyDeclarations
4312   PyObject *__pyx_t_1 = NULL;
4313   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4314 
4315   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
4316  *
4317  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4318  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
4319  *
4320  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4321  */
4322   __Pyx_XDECREF(__pyx_r);
4323   __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(2, 831, __pyx_L1_error)
4324   __Pyx_GOTREF(__pyx_t_1);
4325   __pyx_r = __pyx_t_1;
4326   __pyx_t_1 = 0;
4327   goto __pyx_L0;
4328 
4329   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
4330  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4331  *
4332  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
4333  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4334  *
4335  */
4336 
4337   /* function exit code */
4338   __pyx_L1_error:;
4339   __Pyx_XDECREF(__pyx_t_1);
4340   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4341   __pyx_r = 0;
4342   __pyx_L0:;
4343   __Pyx_XGIVEREF(__pyx_r);
4344   __Pyx_RefNannyFinishContext();
4345   return __pyx_r;
4346 }
4347 
4348 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
4349  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4350  *
4351  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
4352  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4353  *
4354  */
4355 
__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)4356 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) {
4357   PyObject *__pyx_r = NULL;
4358   __Pyx_RefNannyDeclarations
4359   PyObject *__pyx_t_1 = NULL;
4360   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4361 
4362   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
4363  *
4364  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4365  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
4366  *
4367  * cdef inline tuple PyDataType_SHAPE(dtype d):
4368  */
4369   __Pyx_XDECREF(__pyx_r);
4370   __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(2, 834, __pyx_L1_error)
4371   __Pyx_GOTREF(__pyx_t_1);
4372   __pyx_r = __pyx_t_1;
4373   __pyx_t_1 = 0;
4374   goto __pyx_L0;
4375 
4376   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
4377  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4378  *
4379  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
4380  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4381  *
4382  */
4383 
4384   /* function exit code */
4385   __pyx_L1_error:;
4386   __Pyx_XDECREF(__pyx_t_1);
4387   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4388   __pyx_r = 0;
4389   __pyx_L0:;
4390   __Pyx_XGIVEREF(__pyx_r);
4391   __Pyx_RefNannyFinishContext();
4392   return __pyx_r;
4393 }
4394 
4395 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
4396  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4397  *
4398  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
4399  *     if PyDataType_HASSUBARRAY(d):
4400  *         return <tuple>d.subarray.shape
4401  */
4402 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)4403 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4404   PyObject *__pyx_r = NULL;
4405   __Pyx_RefNannyDeclarations
4406   int __pyx_t_1;
4407   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
4408 
4409   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
4410  *
4411  * cdef inline tuple PyDataType_SHAPE(dtype d):
4412  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
4413  *         return <tuple>d.subarray.shape
4414  *     else:
4415  */
4416   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4417   if (__pyx_t_1) {
4418 
4419     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
4420  * cdef inline tuple PyDataType_SHAPE(dtype d):
4421  *     if PyDataType_HASSUBARRAY(d):
4422  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
4423  *     else:
4424  *         return ()
4425  */
4426     __Pyx_XDECREF(__pyx_r);
4427     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4428     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4429     goto __pyx_L0;
4430 
4431     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
4432  *
4433  * cdef inline tuple PyDataType_SHAPE(dtype d):
4434  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
4435  *         return <tuple>d.subarray.shape
4436  *     else:
4437  */
4438   }
4439 
4440   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
4441  *         return <tuple>d.subarray.shape
4442  *     else:
4443  *         return ()             # <<<<<<<<<<<<<<
4444  *
4445  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
4446  */
4447   /*else*/ {
4448     __Pyx_XDECREF(__pyx_r);
4449     __Pyx_INCREF(__pyx_empty_tuple);
4450     __pyx_r = __pyx_empty_tuple;
4451     goto __pyx_L0;
4452   }
4453 
4454   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
4455  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4456  *
4457  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
4458  *     if PyDataType_HASSUBARRAY(d):
4459  *         return <tuple>d.subarray.shape
4460  */
4461 
4462   /* function exit code */
4463   __pyx_L0:;
4464   __Pyx_XGIVEREF(__pyx_r);
4465   __Pyx_RefNannyFinishContext();
4466   return __pyx_r;
4467 }
4468 
4469 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
4470  *         return ()
4471  *
4472  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
4473  *     # Recursive utility function used in __getbuffer__ to get format
4474  *     # string. The new location in the format string is returned.
4475  */
4476 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)4477 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) {
4478   PyArray_Descr *__pyx_v_child = 0;
4479   int __pyx_v_endian_detector;
4480   int __pyx_v_little_endian;
4481   PyObject *__pyx_v_fields = 0;
4482   PyObject *__pyx_v_childname = NULL;
4483   PyObject *__pyx_v_new_offset = NULL;
4484   PyObject *__pyx_v_t = NULL;
4485   char *__pyx_r;
4486   __Pyx_RefNannyDeclarations
4487   PyObject *__pyx_t_1 = NULL;
4488   Py_ssize_t __pyx_t_2;
4489   PyObject *__pyx_t_3 = NULL;
4490   PyObject *__pyx_t_4 = NULL;
4491   int __pyx_t_5;
4492   int __pyx_t_6;
4493   int __pyx_t_7;
4494   long __pyx_t_8;
4495   char *__pyx_t_9;
4496   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
4497 
4498   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
4499  *
4500  *     cdef dtype child
4501  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
4502  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4503  *     cdef tuple fields
4504  */
4505   __pyx_v_endian_detector = 1;
4506 
4507   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
4508  *     cdef dtype child
4509  *     cdef int endian_detector = 1
4510  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
4511  *     cdef tuple fields
4512  *
4513  */
4514   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4515 
4516   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
4517  *     cdef tuple fields
4518  *
4519  *     for childname in descr.names:             # <<<<<<<<<<<<<<
4520  *         fields = descr.fields[childname]
4521  *         child, new_offset = fields
4522  */
4523   if (unlikely(__pyx_v_descr->names == Py_None)) {
4524     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4525     __PYX_ERR(2, 851, __pyx_L1_error)
4526   }
4527   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4528   for (;;) {
4529     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4530     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4531     __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(2, 851, __pyx_L1_error)
4532     #else
4533     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
4534     __Pyx_GOTREF(__pyx_t_3);
4535     #endif
4536     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
4537     __pyx_t_3 = 0;
4538 
4539     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
4540  *
4541  *     for childname in descr.names:
4542  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
4543  *         child, new_offset = fields
4544  *
4545  */
4546     if (unlikely(__pyx_v_descr->fields == Py_None)) {
4547       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4548       __PYX_ERR(2, 852, __pyx_L1_error)
4549     }
4550     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
4551     __Pyx_GOTREF(__pyx_t_3);
4552     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(2, 852, __pyx_L1_error)
4553     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
4554     __pyx_t_3 = 0;
4555 
4556     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
4557  *     for childname in descr.names:
4558  *         fields = descr.fields[childname]
4559  *         child, new_offset = fields             # <<<<<<<<<<<<<<
4560  *
4561  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
4562  */
4563     if (likely(__pyx_v_fields != Py_None)) {
4564       PyObject* sequence = __pyx_v_fields;
4565       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4566       if (unlikely(size != 2)) {
4567         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4568         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4569         __PYX_ERR(2, 853, __pyx_L1_error)
4570       }
4571       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4572       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
4573       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
4574       __Pyx_INCREF(__pyx_t_3);
4575       __Pyx_INCREF(__pyx_t_4);
4576       #else
4577       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
4578       __Pyx_GOTREF(__pyx_t_3);
4579       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
4580       __Pyx_GOTREF(__pyx_t_4);
4581       #endif
4582     } else {
4583       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
4584     }
4585     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
4586     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
4587     __pyx_t_3 = 0;
4588     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
4589     __pyx_t_4 = 0;
4590 
4591     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
4592  *         child, new_offset = fields
4593  *
4594  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
4595  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4596  *
4597  */
4598     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
4599     __Pyx_GOTREF(__pyx_t_4);
4600     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
4601     __Pyx_GOTREF(__pyx_t_3);
4602     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4603     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
4604     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4605     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
4606     if (unlikely(__pyx_t_6)) {
4607 
4608       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
4609  *
4610  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
4611  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
4612  *
4613  *         if ((child.byteorder == c'>' and little_endian) or
4614  */
4615       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
4616       __Pyx_GOTREF(__pyx_t_3);
4617       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4618       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4619       __PYX_ERR(2, 856, __pyx_L1_error)
4620 
4621       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
4622  *         child, new_offset = fields
4623  *
4624  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
4625  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4626  *
4627  */
4628     }
4629 
4630     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
4631  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4632  *
4633  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4634  *             (child.byteorder == c'<' and not little_endian)):
4635  *             raise ValueError(u"Non-native byte order not supported")
4636  */
4637     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
4638     if (!__pyx_t_7) {
4639       goto __pyx_L8_next_or;
4640     } else {
4641     }
4642     __pyx_t_7 = (__pyx_v_little_endian != 0);
4643     if (!__pyx_t_7) {
4644     } else {
4645       __pyx_t_6 = __pyx_t_7;
4646       goto __pyx_L7_bool_binop_done;
4647     }
4648     __pyx_L8_next_or:;
4649 
4650     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
4651  *
4652  *         if ((child.byteorder == c'>' and little_endian) or
4653  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
4654  *             raise ValueError(u"Non-native byte order not supported")
4655  *             # One could encode it in the format string and have Cython
4656  */
4657     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
4658     if (__pyx_t_7) {
4659     } else {
4660       __pyx_t_6 = __pyx_t_7;
4661       goto __pyx_L7_bool_binop_done;
4662     }
4663     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
4664     __pyx_t_6 = __pyx_t_7;
4665     __pyx_L7_bool_binop_done:;
4666 
4667     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
4668  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4669  *
4670  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4671  *             (child.byteorder == c'<' and not little_endian)):
4672  *             raise ValueError(u"Non-native byte order not supported")
4673  */
4674     if (unlikely(__pyx_t_6)) {
4675 
4676       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
4677  *         if ((child.byteorder == c'>' and little_endian) or
4678  *             (child.byteorder == c'<' and not little_endian)):
4679  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
4680  *             # One could encode it in the format string and have Cython
4681  *             # complain instead, BUT: < and > in format strings also imply
4682  */
4683       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
4684       __Pyx_GOTREF(__pyx_t_3);
4685       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4686       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4687       __PYX_ERR(2, 860, __pyx_L1_error)
4688 
4689       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
4690  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4691  *
4692  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4693  *             (child.byteorder == c'<' and not little_endian)):
4694  *             raise ValueError(u"Non-native byte order not supported")
4695  */
4696     }
4697 
4698     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
4699  *
4700  *         # Output padding bytes
4701  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
4702  *             f[0] = 120 # "x"; pad byte
4703  *             f += 1
4704  */
4705     while (1) {
4706       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
4707       __Pyx_GOTREF(__pyx_t_3);
4708       __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(2, 870, __pyx_L1_error)
4709       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4710       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
4711       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4712       if (!__pyx_t_6) break;
4713 
4714       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
4715  *         # Output padding bytes
4716  *         while offset[0] < new_offset:
4717  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
4718  *             f += 1
4719  *             offset[0] += 1
4720  */
4721       (__pyx_v_f[0]) = 0x78;
4722 
4723       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
4724  *         while offset[0] < new_offset:
4725  *             f[0] = 120 # "x"; pad byte
4726  *             f += 1             # <<<<<<<<<<<<<<
4727  *             offset[0] += 1
4728  *
4729  */
4730       __pyx_v_f = (__pyx_v_f + 1);
4731 
4732       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
4733  *             f[0] = 120 # "x"; pad byte
4734  *             f += 1
4735  *             offset[0] += 1             # <<<<<<<<<<<<<<
4736  *
4737  *         offset[0] += child.itemsize
4738  */
4739       __pyx_t_8 = 0;
4740       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
4741     }
4742 
4743     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
4744  *             offset[0] += 1
4745  *
4746  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
4747  *
4748  *         if not PyDataType_HASFIELDS(child):
4749  */
4750     __pyx_t_8 = 0;
4751     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
4752 
4753     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
4754  *         offset[0] += child.itemsize
4755  *
4756  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
4757  *             t = child.type_num
4758  *             if end - f < 5:
4759  */
4760     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
4761     if (__pyx_t_6) {
4762 
4763       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
4764  *
4765  *         if not PyDataType_HASFIELDS(child):
4766  *             t = child.type_num             # <<<<<<<<<<<<<<
4767  *             if end - f < 5:
4768  *                 raise RuntimeError(u"Format string allocated too short.")
4769  */
4770       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
4771       __Pyx_GOTREF(__pyx_t_4);
4772       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
4773       __pyx_t_4 = 0;
4774 
4775       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
4776  *         if not PyDataType_HASFIELDS(child):
4777  *             t = child.type_num
4778  *             if end - f < 5:             # <<<<<<<<<<<<<<
4779  *                 raise RuntimeError(u"Format string allocated too short.")
4780  *
4781  */
4782       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
4783       if (unlikely(__pyx_t_6)) {
4784 
4785         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
4786  *             t = child.type_num
4787  *             if end - f < 5:
4788  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
4789  *
4790  *             # Until ticket #99 is fixed, use integers to avoid warnings
4791  */
4792         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
4793         __Pyx_GOTREF(__pyx_t_4);
4794         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4795         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4796         __PYX_ERR(2, 880, __pyx_L1_error)
4797 
4798         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
4799  *         if not PyDataType_HASFIELDS(child):
4800  *             t = child.type_num
4801  *             if end - f < 5:             # <<<<<<<<<<<<<<
4802  *                 raise RuntimeError(u"Format string allocated too short.")
4803  *
4804  */
4805       }
4806 
4807       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
4808  *
4809  *             # Until ticket #99 is fixed, use integers to avoid warnings
4810  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
4811  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4812  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4813  */
4814       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
4815       __Pyx_GOTREF(__pyx_t_4);
4816       __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(2, 883, __pyx_L1_error)
4817       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4818       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
4819       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4820       if (__pyx_t_6) {
4821         (__pyx_v_f[0]) = 98;
4822         goto __pyx_L15;
4823       }
4824 
4825       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
4826  *             # Until ticket #99 is fixed, use integers to avoid warnings
4827  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
4828  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
4829  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4830  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4831  */
4832       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
4833       __Pyx_GOTREF(__pyx_t_3);
4834       __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(2, 884, __pyx_L1_error)
4835       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4836       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
4837       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4838       if (__pyx_t_6) {
4839         (__pyx_v_f[0]) = 66;
4840         goto __pyx_L15;
4841       }
4842 
4843       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
4844  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
4845  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4846  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
4847  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4848  *             elif t == NPY_INT:         f[0] = 105 #"i"
4849  */
4850       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
4851       __Pyx_GOTREF(__pyx_t_4);
4852       __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(2, 885, __pyx_L1_error)
4853       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4854       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
4855       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4856       if (__pyx_t_6) {
4857         (__pyx_v_f[0]) = 0x68;
4858         goto __pyx_L15;
4859       }
4860 
4861       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
4862  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4863  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4864  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
4865  *             elif t == NPY_INT:         f[0] = 105 #"i"
4866  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4867  */
4868       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
4869       __Pyx_GOTREF(__pyx_t_3);
4870       __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(2, 886, __pyx_L1_error)
4871       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4872       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
4873       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4874       if (__pyx_t_6) {
4875         (__pyx_v_f[0]) = 72;
4876         goto __pyx_L15;
4877       }
4878 
4879       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
4880  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4881  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4882  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
4883  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4884  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4885  */
4886       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
4887       __Pyx_GOTREF(__pyx_t_4);
4888       __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(2, 887, __pyx_L1_error)
4889       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4890       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
4891       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4892       if (__pyx_t_6) {
4893         (__pyx_v_f[0]) = 0x69;
4894         goto __pyx_L15;
4895       }
4896 
4897       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
4898  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4899  *             elif t == NPY_INT:         f[0] = 105 #"i"
4900  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
4901  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4902  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4903  */
4904       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
4905       __Pyx_GOTREF(__pyx_t_3);
4906       __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(2, 888, __pyx_L1_error)
4907       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4908       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
4909       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4910       if (__pyx_t_6) {
4911         (__pyx_v_f[0]) = 73;
4912         goto __pyx_L15;
4913       }
4914 
4915       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
4916  *             elif t == NPY_INT:         f[0] = 105 #"i"
4917  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4918  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
4919  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4920  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4921  */
4922       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
4923       __Pyx_GOTREF(__pyx_t_4);
4924       __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(2, 889, __pyx_L1_error)
4925       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4926       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
4927       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4928       if (__pyx_t_6) {
4929         (__pyx_v_f[0]) = 0x6C;
4930         goto __pyx_L15;
4931       }
4932 
4933       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
4934  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4935  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4936  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
4937  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4938  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4939  */
4940       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
4941       __Pyx_GOTREF(__pyx_t_3);
4942       __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(2, 890, __pyx_L1_error)
4943       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4944       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
4945       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4946       if (__pyx_t_6) {
4947         (__pyx_v_f[0]) = 76;
4948         goto __pyx_L15;
4949       }
4950 
4951       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
4952  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4953  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4954  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
4955  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4956  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4957  */
4958       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
4959       __Pyx_GOTREF(__pyx_t_4);
4960       __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(2, 891, __pyx_L1_error)
4961       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4962       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
4963       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4964       if (__pyx_t_6) {
4965         (__pyx_v_f[0]) = 0x71;
4966         goto __pyx_L15;
4967       }
4968 
4969       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
4970  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4971  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4972  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
4973  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4974  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4975  */
4976       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
4977       __Pyx_GOTREF(__pyx_t_3);
4978       __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(2, 892, __pyx_L1_error)
4979       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4980       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
4981       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4982       if (__pyx_t_6) {
4983         (__pyx_v_f[0]) = 81;
4984         goto __pyx_L15;
4985       }
4986 
4987       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
4988  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4989  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4990  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
4991  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4992  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4993  */
4994       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
4995       __Pyx_GOTREF(__pyx_t_4);
4996       __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(2, 893, __pyx_L1_error)
4997       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4998       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
4999       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5000       if (__pyx_t_6) {
5001         (__pyx_v_f[0]) = 0x66;
5002         goto __pyx_L15;
5003       }
5004 
5005       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
5006  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5007  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5008  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
5009  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5010  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5011  */
5012       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
5013       __Pyx_GOTREF(__pyx_t_3);
5014       __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(2, 894, __pyx_L1_error)
5015       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5016       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
5017       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5018       if (__pyx_t_6) {
5019         (__pyx_v_f[0]) = 0x64;
5020         goto __pyx_L15;
5021       }
5022 
5023       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
5024  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5025  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5026  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
5027  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5028  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5029  */
5030       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
5031       __Pyx_GOTREF(__pyx_t_4);
5032       __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(2, 895, __pyx_L1_error)
5033       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5034       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
5035       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5036       if (__pyx_t_6) {
5037         (__pyx_v_f[0]) = 0x67;
5038         goto __pyx_L15;
5039       }
5040 
5041       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
5042  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5043  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5044  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
5045  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5046  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5047  */
5048       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
5049       __Pyx_GOTREF(__pyx_t_3);
5050       __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(2, 896, __pyx_L1_error)
5051       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5052       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
5053       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5054       if (__pyx_t_6) {
5055         (__pyx_v_f[0]) = 90;
5056         (__pyx_v_f[1]) = 0x66;
5057         __pyx_v_f = (__pyx_v_f + 1);
5058         goto __pyx_L15;
5059       }
5060 
5061       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
5062  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5063  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5064  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
5065  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5066  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5067  */
5068       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
5069       __Pyx_GOTREF(__pyx_t_4);
5070       __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(2, 897, __pyx_L1_error)
5071       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5072       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
5073       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5074       if (__pyx_t_6) {
5075         (__pyx_v_f[0]) = 90;
5076         (__pyx_v_f[1]) = 0x64;
5077         __pyx_v_f = (__pyx_v_f + 1);
5078         goto __pyx_L15;
5079       }
5080 
5081       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
5082  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5083  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5084  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
5085  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5086  *             else:
5087  */
5088       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
5089       __Pyx_GOTREF(__pyx_t_3);
5090       __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(2, 898, __pyx_L1_error)
5091       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5092       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
5093       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5094       if (__pyx_t_6) {
5095         (__pyx_v_f[0]) = 90;
5096         (__pyx_v_f[1]) = 0x67;
5097         __pyx_v_f = (__pyx_v_f + 1);
5098         goto __pyx_L15;
5099       }
5100 
5101       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
5102  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5103  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5104  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
5105  *             else:
5106  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5107  */
5108       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
5109       __Pyx_GOTREF(__pyx_t_4);
5110       __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(2, 899, __pyx_L1_error)
5111       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5112       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
5113       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5114       if (likely(__pyx_t_6)) {
5115         (__pyx_v_f[0]) = 79;
5116         goto __pyx_L15;
5117       }
5118 
5119       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
5120  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5121  *             else:
5122  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
5123  *             f += 1
5124  *         else:
5125  */
5126       /*else*/ {
5127         __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(2, 901, __pyx_L1_error)
5128         __Pyx_GOTREF(__pyx_t_3);
5129         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
5130         __Pyx_GOTREF(__pyx_t_4);
5131         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5132         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5133         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5134         __PYX_ERR(2, 901, __pyx_L1_error)
5135       }
5136       __pyx_L15:;
5137 
5138       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
5139  *             else:
5140  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5141  *             f += 1             # <<<<<<<<<<<<<<
5142  *         else:
5143  *             # Cython ignores struct boundary information ("T{...}"),
5144  */
5145       __pyx_v_f = (__pyx_v_f + 1);
5146 
5147       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
5148  *         offset[0] += child.itemsize
5149  *
5150  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
5151  *             t = child.type_num
5152  *             if end - f < 5:
5153  */
5154       goto __pyx_L13;
5155     }
5156 
5157     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
5158  *             # Cython ignores struct boundary information ("T{...}"),
5159  *             # so don't output it
5160  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
5161  *     return f
5162  *
5163  */
5164     /*else*/ {
5165       __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(2, 906, __pyx_L1_error)
5166       __pyx_v_f = __pyx_t_9;
5167     }
5168     __pyx_L13:;
5169 
5170     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
5171  *     cdef tuple fields
5172  *
5173  *     for childname in descr.names:             # <<<<<<<<<<<<<<
5174  *         fields = descr.fields[childname]
5175  *         child, new_offset = fields
5176  */
5177   }
5178   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5179 
5180   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
5181  *             # so don't output it
5182  *             f = _util_dtypestring(child, f, end, offset)
5183  *     return f             # <<<<<<<<<<<<<<
5184  *
5185  *
5186  */
5187   __pyx_r = __pyx_v_f;
5188   goto __pyx_L0;
5189 
5190   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
5191  *         return ()
5192  *
5193  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
5194  *     # Recursive utility function used in __getbuffer__ to get format
5195  *     # string. The new location in the format string is returned.
5196  */
5197 
5198   /* function exit code */
5199   __pyx_L1_error:;
5200   __Pyx_XDECREF(__pyx_t_1);
5201   __Pyx_XDECREF(__pyx_t_3);
5202   __Pyx_XDECREF(__pyx_t_4);
5203   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
5204   __pyx_r = NULL;
5205   __pyx_L0:;
5206   __Pyx_XDECREF((PyObject *)__pyx_v_child);
5207   __Pyx_XDECREF(__pyx_v_fields);
5208   __Pyx_XDECREF(__pyx_v_childname);
5209   __Pyx_XDECREF(__pyx_v_new_offset);
5210   __Pyx_XDECREF(__pyx_v_t);
5211   __Pyx_RefNannyFinishContext();
5212   return __pyx_r;
5213 }
5214 
5215 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
5216  *     int _import_umath() except -1
5217  *
5218  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
5219  *     Py_INCREF(base) # important to do this before stealing the reference below!
5220  *     PyArray_SetBaseObject(arr, base)
5221  */
5222 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)5223 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5224   __Pyx_RefNannyDeclarations
5225   __Pyx_RefNannySetupContext("set_array_base", 0);
5226 
5227   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
5228  *
5229  * cdef inline void set_array_base(ndarray arr, object base):
5230  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
5231  *     PyArray_SetBaseObject(arr, base)
5232  *
5233  */
5234   Py_INCREF(__pyx_v_base);
5235 
5236   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
5237  * cdef inline void set_array_base(ndarray arr, object base):
5238  *     Py_INCREF(base) # important to do this before stealing the reference below!
5239  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
5240  *
5241  * cdef inline object get_array_base(ndarray arr):
5242  */
5243   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5244 
5245   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
5246  *     int _import_umath() except -1
5247  *
5248  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
5249  *     Py_INCREF(base) # important to do this before stealing the reference below!
5250  *     PyArray_SetBaseObject(arr, base)
5251  */
5252 
5253   /* function exit code */
5254   __Pyx_RefNannyFinishContext();
5255 }
5256 
5257 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
5258  *     PyArray_SetBaseObject(arr, base)
5259  *
5260  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
5261  *     base = PyArray_BASE(arr)
5262  *     if base is NULL:
5263  */
5264 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)5265 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5266   PyObject *__pyx_v_base;
5267   PyObject *__pyx_r = NULL;
5268   __Pyx_RefNannyDeclarations
5269   int __pyx_t_1;
5270   __Pyx_RefNannySetupContext("get_array_base", 0);
5271 
5272   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
5273  *
5274  * cdef inline object get_array_base(ndarray arr):
5275  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
5276  *     if base is NULL:
5277  *         return None
5278  */
5279   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5280 
5281   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
5282  * cdef inline object get_array_base(ndarray arr):
5283  *     base = PyArray_BASE(arr)
5284  *     if base is NULL:             # <<<<<<<<<<<<<<
5285  *         return None
5286  *     return <object>base
5287  */
5288   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5289   if (__pyx_t_1) {
5290 
5291     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
5292  *     base = PyArray_BASE(arr)
5293  *     if base is NULL:
5294  *         return None             # <<<<<<<<<<<<<<
5295  *     return <object>base
5296  *
5297  */
5298     __Pyx_XDECREF(__pyx_r);
5299     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5300     goto __pyx_L0;
5301 
5302     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
5303  * cdef inline object get_array_base(ndarray arr):
5304  *     base = PyArray_BASE(arr)
5305  *     if base is NULL:             # <<<<<<<<<<<<<<
5306  *         return None
5307  *     return <object>base
5308  */
5309   }
5310 
5311   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
5312  *     if base is NULL:
5313  *         return None
5314  *     return <object>base             # <<<<<<<<<<<<<<
5315  *
5316  * # Versions of the import_* functions which are more suitable for
5317  */
5318   __Pyx_XDECREF(__pyx_r);
5319   __Pyx_INCREF(((PyObject *)__pyx_v_base));
5320   __pyx_r = ((PyObject *)__pyx_v_base);
5321   goto __pyx_L0;
5322 
5323   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
5324  *     PyArray_SetBaseObject(arr, base)
5325  *
5326  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
5327  *     base = PyArray_BASE(arr)
5328  *     if base is NULL:
5329  */
5330 
5331   /* function exit code */
5332   __pyx_L0:;
5333   __Pyx_XGIVEREF(__pyx_r);
5334   __Pyx_RefNannyFinishContext();
5335   return __pyx_r;
5336 }
5337 
5338 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5339  * # Versions of the import_* functions which are more suitable for
5340  * # Cython code.
5341  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
5342  *     try:
5343  *         _import_array()
5344  */
5345 
__pyx_f_5numpy_import_array(void)5346 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5347   int __pyx_r;
5348   __Pyx_RefNannyDeclarations
5349   PyObject *__pyx_t_1 = NULL;
5350   PyObject *__pyx_t_2 = NULL;
5351   PyObject *__pyx_t_3 = NULL;
5352   int __pyx_t_4;
5353   PyObject *__pyx_t_5 = NULL;
5354   PyObject *__pyx_t_6 = NULL;
5355   PyObject *__pyx_t_7 = NULL;
5356   PyObject *__pyx_t_8 = NULL;
5357   __Pyx_RefNannySetupContext("import_array", 0);
5358 
5359   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
5360  * # Cython code.
5361  * cdef inline int import_array() except -1:
5362  *     try:             # <<<<<<<<<<<<<<
5363  *         _import_array()
5364  *     except Exception:
5365  */
5366   {
5367     __Pyx_PyThreadState_declare
5368     __Pyx_PyThreadState_assign
5369     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5370     __Pyx_XGOTREF(__pyx_t_1);
5371     __Pyx_XGOTREF(__pyx_t_2);
5372     __Pyx_XGOTREF(__pyx_t_3);
5373     /*try:*/ {
5374 
5375       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
5376  * cdef inline int import_array() except -1:
5377  *     try:
5378  *         _import_array()             # <<<<<<<<<<<<<<
5379  *     except Exception:
5380  *         raise ImportError("numpy.core.multiarray failed to import")
5381  */
5382       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
5383 
5384       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
5385  * # Cython code.
5386  * cdef inline int import_array() except -1:
5387  *     try:             # <<<<<<<<<<<<<<
5388  *         _import_array()
5389  *     except Exception:
5390  */
5391     }
5392     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5393     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5394     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5395     goto __pyx_L8_try_end;
5396     __pyx_L3_error:;
5397 
5398     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
5399  *     try:
5400  *         _import_array()
5401  *     except Exception:             # <<<<<<<<<<<<<<
5402  *         raise ImportError("numpy.core.multiarray failed to import")
5403  *
5404  */
5405     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5406     if (__pyx_t_4) {
5407       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5408       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
5409       __Pyx_GOTREF(__pyx_t_5);
5410       __Pyx_GOTREF(__pyx_t_6);
5411       __Pyx_GOTREF(__pyx_t_7);
5412 
5413       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
5414  *         _import_array()
5415  *     except Exception:
5416  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
5417  *
5418  * cdef inline int import_umath() except -1:
5419  */
5420       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
5421       __Pyx_GOTREF(__pyx_t_8);
5422       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5423       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5424       __PYX_ERR(2, 1038, __pyx_L5_except_error)
5425     }
5426     goto __pyx_L5_except_error;
5427     __pyx_L5_except_error:;
5428 
5429     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
5430  * # Cython code.
5431  * cdef inline int import_array() except -1:
5432  *     try:             # <<<<<<<<<<<<<<
5433  *         _import_array()
5434  *     except Exception:
5435  */
5436     __Pyx_XGIVEREF(__pyx_t_1);
5437     __Pyx_XGIVEREF(__pyx_t_2);
5438     __Pyx_XGIVEREF(__pyx_t_3);
5439     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5440     goto __pyx_L1_error;
5441     __pyx_L8_try_end:;
5442   }
5443 
5444   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
5445  * # Versions of the import_* functions which are more suitable for
5446  * # Cython code.
5447  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
5448  *     try:
5449  *         _import_array()
5450  */
5451 
5452   /* function exit code */
5453   __pyx_r = 0;
5454   goto __pyx_L0;
5455   __pyx_L1_error:;
5456   __Pyx_XDECREF(__pyx_t_5);
5457   __Pyx_XDECREF(__pyx_t_6);
5458   __Pyx_XDECREF(__pyx_t_7);
5459   __Pyx_XDECREF(__pyx_t_8);
5460   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5461   __pyx_r = -1;
5462   __pyx_L0:;
5463   __Pyx_RefNannyFinishContext();
5464   return __pyx_r;
5465 }
5466 
5467 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
5468  *         raise ImportError("numpy.core.multiarray failed to import")
5469  *
5470  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
5471  *     try:
5472  *         _import_umath()
5473  */
5474 
__pyx_f_5numpy_import_umath(void)5475 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5476   int __pyx_r;
5477   __Pyx_RefNannyDeclarations
5478   PyObject *__pyx_t_1 = NULL;
5479   PyObject *__pyx_t_2 = NULL;
5480   PyObject *__pyx_t_3 = NULL;
5481   int __pyx_t_4;
5482   PyObject *__pyx_t_5 = NULL;
5483   PyObject *__pyx_t_6 = NULL;
5484   PyObject *__pyx_t_7 = NULL;
5485   PyObject *__pyx_t_8 = NULL;
5486   __Pyx_RefNannySetupContext("import_umath", 0);
5487 
5488   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
5489  *
5490  * cdef inline int import_umath() except -1:
5491  *     try:             # <<<<<<<<<<<<<<
5492  *         _import_umath()
5493  *     except Exception:
5494  */
5495   {
5496     __Pyx_PyThreadState_declare
5497     __Pyx_PyThreadState_assign
5498     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5499     __Pyx_XGOTREF(__pyx_t_1);
5500     __Pyx_XGOTREF(__pyx_t_2);
5501     __Pyx_XGOTREF(__pyx_t_3);
5502     /*try:*/ {
5503 
5504       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
5505  * cdef inline int import_umath() except -1:
5506  *     try:
5507  *         _import_umath()             # <<<<<<<<<<<<<<
5508  *     except Exception:
5509  *         raise ImportError("numpy.core.umath failed to import")
5510  */
5511       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
5512 
5513       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
5514  *
5515  * cdef inline int import_umath() except -1:
5516  *     try:             # <<<<<<<<<<<<<<
5517  *         _import_umath()
5518  *     except Exception:
5519  */
5520     }
5521     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5522     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5523     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5524     goto __pyx_L8_try_end;
5525     __pyx_L3_error:;
5526 
5527     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
5528  *     try:
5529  *         _import_umath()
5530  *     except Exception:             # <<<<<<<<<<<<<<
5531  *         raise ImportError("numpy.core.umath failed to import")
5532  *
5533  */
5534     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5535     if (__pyx_t_4) {
5536       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5537       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
5538       __Pyx_GOTREF(__pyx_t_5);
5539       __Pyx_GOTREF(__pyx_t_6);
5540       __Pyx_GOTREF(__pyx_t_7);
5541 
5542       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
5543  *         _import_umath()
5544  *     except Exception:
5545  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
5546  *
5547  * cdef inline int import_ufunc() except -1:
5548  */
5549       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
5550       __Pyx_GOTREF(__pyx_t_8);
5551       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5552       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5553       __PYX_ERR(2, 1044, __pyx_L5_except_error)
5554     }
5555     goto __pyx_L5_except_error;
5556     __pyx_L5_except_error:;
5557 
5558     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
5559  *
5560  * cdef inline int import_umath() except -1:
5561  *     try:             # <<<<<<<<<<<<<<
5562  *         _import_umath()
5563  *     except Exception:
5564  */
5565     __Pyx_XGIVEREF(__pyx_t_1);
5566     __Pyx_XGIVEREF(__pyx_t_2);
5567     __Pyx_XGIVEREF(__pyx_t_3);
5568     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5569     goto __pyx_L1_error;
5570     __pyx_L8_try_end:;
5571   }
5572 
5573   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
5574  *         raise ImportError("numpy.core.multiarray failed to import")
5575  *
5576  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
5577  *     try:
5578  *         _import_umath()
5579  */
5580 
5581   /* function exit code */
5582   __pyx_r = 0;
5583   goto __pyx_L0;
5584   __pyx_L1_error:;
5585   __Pyx_XDECREF(__pyx_t_5);
5586   __Pyx_XDECREF(__pyx_t_6);
5587   __Pyx_XDECREF(__pyx_t_7);
5588   __Pyx_XDECREF(__pyx_t_8);
5589   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5590   __pyx_r = -1;
5591   __pyx_L0:;
5592   __Pyx_RefNannyFinishContext();
5593   return __pyx_r;
5594 }
5595 
5596 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
5597  *         raise ImportError("numpy.core.umath failed to import")
5598  *
5599  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
5600  *     try:
5601  *         _import_umath()
5602  */
5603 
__pyx_f_5numpy_import_ufunc(void)5604 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5605   int __pyx_r;
5606   __Pyx_RefNannyDeclarations
5607   PyObject *__pyx_t_1 = NULL;
5608   PyObject *__pyx_t_2 = NULL;
5609   PyObject *__pyx_t_3 = NULL;
5610   int __pyx_t_4;
5611   PyObject *__pyx_t_5 = NULL;
5612   PyObject *__pyx_t_6 = NULL;
5613   PyObject *__pyx_t_7 = NULL;
5614   PyObject *__pyx_t_8 = NULL;
5615   __Pyx_RefNannySetupContext("import_ufunc", 0);
5616 
5617   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
5618  *
5619  * cdef inline int import_ufunc() except -1:
5620  *     try:             # <<<<<<<<<<<<<<
5621  *         _import_umath()
5622  *     except Exception:
5623  */
5624   {
5625     __Pyx_PyThreadState_declare
5626     __Pyx_PyThreadState_assign
5627     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5628     __Pyx_XGOTREF(__pyx_t_1);
5629     __Pyx_XGOTREF(__pyx_t_2);
5630     __Pyx_XGOTREF(__pyx_t_3);
5631     /*try:*/ {
5632 
5633       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
5634  * cdef inline int import_ufunc() except -1:
5635  *     try:
5636  *         _import_umath()             # <<<<<<<<<<<<<<
5637  *     except Exception:
5638  *         raise ImportError("numpy.core.umath failed to import")
5639  */
5640       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
5641 
5642       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
5643  *
5644  * cdef inline int import_ufunc() except -1:
5645  *     try:             # <<<<<<<<<<<<<<
5646  *         _import_umath()
5647  *     except Exception:
5648  */
5649     }
5650     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5651     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5652     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5653     goto __pyx_L8_try_end;
5654     __pyx_L3_error:;
5655 
5656     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
5657  *     try:
5658  *         _import_umath()
5659  *     except Exception:             # <<<<<<<<<<<<<<
5660  *         raise ImportError("numpy.core.umath failed to import")
5661  */
5662     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5663     if (__pyx_t_4) {
5664       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5665       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
5666       __Pyx_GOTREF(__pyx_t_5);
5667       __Pyx_GOTREF(__pyx_t_6);
5668       __Pyx_GOTREF(__pyx_t_7);
5669 
5670       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
5671  *         _import_umath()
5672  *     except Exception:
5673  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
5674  */
5675       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
5676       __Pyx_GOTREF(__pyx_t_8);
5677       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5678       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5679       __PYX_ERR(2, 1050, __pyx_L5_except_error)
5680     }
5681     goto __pyx_L5_except_error;
5682     __pyx_L5_except_error:;
5683 
5684     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
5685  *
5686  * cdef inline int import_ufunc() except -1:
5687  *     try:             # <<<<<<<<<<<<<<
5688  *         _import_umath()
5689  *     except Exception:
5690  */
5691     __Pyx_XGIVEREF(__pyx_t_1);
5692     __Pyx_XGIVEREF(__pyx_t_2);
5693     __Pyx_XGIVEREF(__pyx_t_3);
5694     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5695     goto __pyx_L1_error;
5696     __pyx_L8_try_end:;
5697   }
5698 
5699   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
5700  *         raise ImportError("numpy.core.umath failed to import")
5701  *
5702  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
5703  *     try:
5704  *         _import_umath()
5705  */
5706 
5707   /* function exit code */
5708   __pyx_r = 0;
5709   goto __pyx_L0;
5710   __pyx_L1_error:;
5711   __Pyx_XDECREF(__pyx_t_5);
5712   __Pyx_XDECREF(__pyx_t_6);
5713   __Pyx_XDECREF(__pyx_t_7);
5714   __Pyx_XDECREF(__pyx_t_8);
5715   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5716   __pyx_r = -1;
5717   __pyx_L0:;
5718   __Pyx_RefNannyFinishContext();
5719   return __pyx_r;
5720 }
5721 
5722 /* "volume_container.pxd":35
5723  *     int dims[3]
5724  *
5725  * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k):             # <<<<<<<<<<<<<<
5726  *     #-----------------------------------------------------------------------------
5727  *     # vc_index(VolumeContainer *vc, int i, int j, int k)
5728  */
5729 
__pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)5730 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
5731   int __pyx_r;
5732   __Pyx_RefNannyDeclarations
5733   __Pyx_RefNannySetupContext("vc_index", 0);
5734 
5735   /* "volume_container.pxd":63
5736  *     # The 3-dimensional case (presented below) is similar.
5737  *     #-----------------------------------------------------------------------------
5738  *     return (i*vc.dims[1]+j)*vc.dims[2]+k             # <<<<<<<<<<<<<<
5739  *
5740  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):
5741  */
5742   __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k);
5743   goto __pyx_L0;
5744 
5745   /* "volume_container.pxd":35
5746  *     int dims[3]
5747  *
5748  * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k):             # <<<<<<<<<<<<<<
5749  *     #-----------------------------------------------------------------------------
5750  *     # vc_index(VolumeContainer *vc, int i, int j, int k)
5751  */
5752 
5753   /* function exit code */
5754   __pyx_L0:;
5755   __Pyx_RefNannyFinishContext();
5756   return __pyx_r;
5757 }
5758 
5759 /* "volume_container.pxd":65
5760  *     return (i*vc.dims[1]+j)*vc.dims[2]+k
5761  *
5762  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):             # <<<<<<<<<<<<<<
5763  *     cdef int index[3]
5764  *     cdef int i
5765  */
5766 
__pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,__pyx_t_5numpy_float64_t * __pyx_v_spos)5767 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_16volume_container_vc_pos_index(struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_float64_t *__pyx_v_spos) {
5768   int __pyx_v_index[3];
5769   int __pyx_v_i;
5770   int __pyx_r;
5771   __Pyx_RefNannyDeclarations
5772   int __pyx_t_1;
5773   __Pyx_RefNannySetupContext("vc_pos_index", 0);
5774 
5775   /* "volume_container.pxd":68
5776  *     cdef int index[3]
5777  *     cdef int i
5778  *     for i in range(3):             # <<<<<<<<<<<<<<
5779  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
5780  *     return vc_index(vc, index[0], index[1], index[2])
5781  */
5782   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
5783     __pyx_v_i = __pyx_t_1;
5784 
5785     /* "volume_container.pxd":69
5786  *     cdef int i
5787  *     for i in range(3):
5788  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])             # <<<<<<<<<<<<<<
5789  *     return vc_index(vc, index[0], index[1], index[2])
5790  */
5791     (__pyx_v_index[__pyx_v_i]) = ((int)(((__pyx_v_spos[__pyx_v_i]) - (__pyx_v_vc->left_edge[__pyx_v_i])) * (__pyx_v_vc->idds[__pyx_v_i])));
5792   }
5793 
5794   /* "volume_container.pxd":70
5795  *     for i in range(3):
5796  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
5797  *     return vc_index(vc, index[0], index[1], index[2])             # <<<<<<<<<<<<<<
5798  */
5799   __pyx_r = __pyx_f_2yt_9utilities_3lib_16volume_container_vc_index(__pyx_v_vc, (__pyx_v_index[0]), (__pyx_v_index[1]), (__pyx_v_index[2]));
5800   goto __pyx_L0;
5801 
5802   /* "volume_container.pxd":65
5803  *     return (i*vc.dims[1]+j)*vc.dims[2]+k
5804  *
5805  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):             # <<<<<<<<<<<<<<
5806  *     cdef int index[3]
5807  *     cdef int i
5808  */
5809 
5810   /* function exit code */
5811   __pyx_L0:;
5812   __Pyx_RefNannyFinishContext();
5813   return __pyx_r;
5814 }
5815 
5816 /* "View.MemoryView":122
5817  *         cdef bint dtype_is_object
5818  *
5819  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
5820  *                   mode="c", bint allocate_buffer=True):
5821  *
5822  */
5823 
5824 /* Python wrapper */
5825 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)5826 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5827   PyObject *__pyx_v_shape = 0;
5828   Py_ssize_t __pyx_v_itemsize;
5829   PyObject *__pyx_v_format = 0;
5830   PyObject *__pyx_v_mode = 0;
5831   int __pyx_v_allocate_buffer;
5832   int __pyx_r;
5833   __Pyx_RefNannyDeclarations
5834   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
5835   {
5836     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};
5837     PyObject* values[5] = {0,0,0,0,0};
5838     values[3] = ((PyObject *)__pyx_n_s_c);
5839     if (unlikely(__pyx_kwds)) {
5840       Py_ssize_t kw_args;
5841       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5842       switch (pos_args) {
5843         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5844         CYTHON_FALLTHROUGH;
5845         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5846         CYTHON_FALLTHROUGH;
5847         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5848         CYTHON_FALLTHROUGH;
5849         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5850         CYTHON_FALLTHROUGH;
5851         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5852         CYTHON_FALLTHROUGH;
5853         case  0: break;
5854         default: goto __pyx_L5_argtuple_error;
5855       }
5856       kw_args = PyDict_Size(__pyx_kwds);
5857       switch (pos_args) {
5858         case  0:
5859         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
5860         else goto __pyx_L5_argtuple_error;
5861         CYTHON_FALLTHROUGH;
5862         case  1:
5863         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
5864         else {
5865           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
5866         }
5867         CYTHON_FALLTHROUGH;
5868         case  2:
5869         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
5870         else {
5871           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
5872         }
5873         CYTHON_FALLTHROUGH;
5874         case  3:
5875         if (kw_args > 0) {
5876           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
5877           if (value) { values[3] = value; kw_args--; }
5878         }
5879         CYTHON_FALLTHROUGH;
5880         case  4:
5881         if (kw_args > 0) {
5882           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
5883           if (value) { values[4] = value; kw_args--; }
5884         }
5885       }
5886       if (unlikely(kw_args > 0)) {
5887         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
5888       }
5889     } else {
5890       switch (PyTuple_GET_SIZE(__pyx_args)) {
5891         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5892         CYTHON_FALLTHROUGH;
5893         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5894         CYTHON_FALLTHROUGH;
5895         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5896         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5897         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5898         break;
5899         default: goto __pyx_L5_argtuple_error;
5900       }
5901     }
5902     __pyx_v_shape = ((PyObject*)values[0]);
5903     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
5904     __pyx_v_format = values[2];
5905     __pyx_v_mode = values[3];
5906     if (values[4]) {
5907       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
5908     } else {
5909 
5910       /* "View.MemoryView":123
5911  *
5912  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5913  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
5914  *
5915  *         cdef int idx
5916  */
5917       __pyx_v_allocate_buffer = ((int)1);
5918     }
5919   }
5920   goto __pyx_L4_argument_unpacking_done;
5921   __pyx_L5_argtuple_error:;
5922   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
5923   __pyx_L3_error:;
5924   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5925   __Pyx_RefNannyFinishContext();
5926   return -1;
5927   __pyx_L4_argument_unpacking_done:;
5928   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
5929   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5930     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
5931   }
5932   __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);
5933 
5934   /* "View.MemoryView":122
5935  *         cdef bint dtype_is_object
5936  *
5937  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
5938  *                   mode="c", bint allocate_buffer=True):
5939  *
5940  */
5941 
5942   /* function exit code */
5943   goto __pyx_L0;
5944   __pyx_L1_error:;
5945   __pyx_r = -1;
5946   __pyx_L0:;
5947   __Pyx_RefNannyFinishContext();
5948   return __pyx_r;
5949 }
5950 
__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)5951 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) {
5952   int __pyx_v_idx;
5953   Py_ssize_t __pyx_v_i;
5954   Py_ssize_t __pyx_v_dim;
5955   PyObject **__pyx_v_p;
5956   char __pyx_v_order;
5957   int __pyx_r;
5958   __Pyx_RefNannyDeclarations
5959   Py_ssize_t __pyx_t_1;
5960   int __pyx_t_2;
5961   PyObject *__pyx_t_3 = NULL;
5962   int __pyx_t_4;
5963   PyObject *__pyx_t_5 = NULL;
5964   PyObject *__pyx_t_6 = NULL;
5965   char *__pyx_t_7;
5966   int __pyx_t_8;
5967   Py_ssize_t __pyx_t_9;
5968   PyObject *__pyx_t_10 = NULL;
5969   Py_ssize_t __pyx_t_11;
5970   __Pyx_RefNannySetupContext("__cinit__", 0);
5971   __Pyx_INCREF(__pyx_v_format);
5972 
5973   /* "View.MemoryView":129
5974  *         cdef PyObject **p
5975  *
5976  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
5977  *         self.itemsize = itemsize
5978  *
5979  */
5980   if (unlikely(__pyx_v_shape == Py_None)) {
5981     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5982     __PYX_ERR(1, 129, __pyx_L1_error)
5983   }
5984   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
5985   __pyx_v_self->ndim = ((int)__pyx_t_1);
5986 
5987   /* "View.MemoryView":130
5988  *
5989  *         self.ndim = <int> len(shape)
5990  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
5991  *
5992  *         if not self.ndim:
5993  */
5994   __pyx_v_self->itemsize = __pyx_v_itemsize;
5995 
5996   /* "View.MemoryView":132
5997  *         self.itemsize = itemsize
5998  *
5999  *         if not self.ndim:             # <<<<<<<<<<<<<<
6000  *             raise ValueError("Empty shape tuple for cython.array")
6001  *
6002  */
6003   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6004   if (unlikely(__pyx_t_2)) {
6005 
6006     /* "View.MemoryView":133
6007  *
6008  *         if not self.ndim:
6009  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
6010  *
6011  *         if itemsize <= 0:
6012  */
6013     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
6014     __Pyx_GOTREF(__pyx_t_3);
6015     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6016     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6017     __PYX_ERR(1, 133, __pyx_L1_error)
6018 
6019     /* "View.MemoryView":132
6020  *         self.itemsize = itemsize
6021  *
6022  *         if not self.ndim:             # <<<<<<<<<<<<<<
6023  *             raise ValueError("Empty shape tuple for cython.array")
6024  *
6025  */
6026   }
6027 
6028   /* "View.MemoryView":135
6029  *             raise ValueError("Empty shape tuple for cython.array")
6030  *
6031  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
6032  *             raise ValueError("itemsize <= 0 for cython.array")
6033  *
6034  */
6035   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6036   if (unlikely(__pyx_t_2)) {
6037 
6038     /* "View.MemoryView":136
6039  *
6040  *         if itemsize <= 0:
6041  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
6042  *
6043  *         if not isinstance(format, bytes):
6044  */
6045     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
6046     __Pyx_GOTREF(__pyx_t_3);
6047     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6048     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6049     __PYX_ERR(1, 136, __pyx_L1_error)
6050 
6051     /* "View.MemoryView":135
6052  *             raise ValueError("Empty shape tuple for cython.array")
6053  *
6054  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
6055  *             raise ValueError("itemsize <= 0 for cython.array")
6056  *
6057  */
6058   }
6059 
6060   /* "View.MemoryView":138
6061  *             raise ValueError("itemsize <= 0 for cython.array")
6062  *
6063  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
6064  *             format = format.encode('ASCII')
6065  *         self._format = format  # keep a reference to the byte string
6066  */
6067   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6068   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6069   if (__pyx_t_4) {
6070 
6071     /* "View.MemoryView":139
6072  *
6073  *         if not isinstance(format, bytes):
6074  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
6075  *         self._format = format  # keep a reference to the byte string
6076  *         self.format = self._format
6077  */
6078     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
6079     __Pyx_GOTREF(__pyx_t_5);
6080     __pyx_t_6 = NULL;
6081     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6082       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6083       if (likely(__pyx_t_6)) {
6084         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6085         __Pyx_INCREF(__pyx_t_6);
6086         __Pyx_INCREF(function);
6087         __Pyx_DECREF_SET(__pyx_t_5, function);
6088       }
6089     }
6090     __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);
6091     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6092     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
6093     __Pyx_GOTREF(__pyx_t_3);
6094     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6095     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6096     __pyx_t_3 = 0;
6097 
6098     /* "View.MemoryView":138
6099  *             raise ValueError("itemsize <= 0 for cython.array")
6100  *
6101  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
6102  *             format = format.encode('ASCII')
6103  *         self._format = format  # keep a reference to the byte string
6104  */
6105   }
6106 
6107   /* "View.MemoryView":140
6108  *         if not isinstance(format, bytes):
6109  *             format = format.encode('ASCII')
6110  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
6111  *         self.format = self._format
6112  *
6113  */
6114   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(1, 140, __pyx_L1_error)
6115   __pyx_t_3 = __pyx_v_format;
6116   __Pyx_INCREF(__pyx_t_3);
6117   __Pyx_GIVEREF(__pyx_t_3);
6118   __Pyx_GOTREF(__pyx_v_self->_format);
6119   __Pyx_DECREF(__pyx_v_self->_format);
6120   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6121   __pyx_t_3 = 0;
6122 
6123   /* "View.MemoryView":141
6124  *             format = format.encode('ASCII')
6125  *         self._format = format  # keep a reference to the byte string
6126  *         self.format = self._format             # <<<<<<<<<<<<<<
6127  *
6128  *
6129  */
6130   if (unlikely(__pyx_v_self->_format == Py_None)) {
6131     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6132     __PYX_ERR(1, 141, __pyx_L1_error)
6133   }
6134   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
6135   __pyx_v_self->format = __pyx_t_7;
6136 
6137   /* "View.MemoryView":144
6138  *
6139  *
6140  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
6141  *         self._strides = self._shape + self.ndim
6142  *
6143  */
6144   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6145 
6146   /* "View.MemoryView":145
6147  *
6148  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6149  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
6150  *
6151  *         if not self._shape:
6152  */
6153   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6154 
6155   /* "View.MemoryView":147
6156  *         self._strides = self._shape + self.ndim
6157  *
6158  *         if not self._shape:             # <<<<<<<<<<<<<<
6159  *             raise MemoryError("unable to allocate shape and strides.")
6160  *
6161  */
6162   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6163   if (unlikely(__pyx_t_4)) {
6164 
6165     /* "View.MemoryView":148
6166  *
6167  *         if not self._shape:
6168  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
6169  *
6170  *
6171  */
6172     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
6173     __Pyx_GOTREF(__pyx_t_3);
6174     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6175     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6176     __PYX_ERR(1, 148, __pyx_L1_error)
6177 
6178     /* "View.MemoryView":147
6179  *         self._strides = self._shape + self.ndim
6180  *
6181  *         if not self._shape:             # <<<<<<<<<<<<<<
6182  *             raise MemoryError("unable to allocate shape and strides.")
6183  *
6184  */
6185   }
6186 
6187   /* "View.MemoryView":151
6188  *
6189  *
6190  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
6191  *             if dim <= 0:
6192  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6193  */
6194   __pyx_t_8 = 0;
6195   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6196   for (;;) {
6197     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
6198     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6199     __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(1, 151, __pyx_L1_error)
6200     #else
6201     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
6202     __Pyx_GOTREF(__pyx_t_5);
6203     #endif
6204     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
6205     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6206     __pyx_v_dim = __pyx_t_9;
6207     __pyx_v_idx = __pyx_t_8;
6208     __pyx_t_8 = (__pyx_t_8 + 1);
6209 
6210     /* "View.MemoryView":152
6211  *
6212  *         for idx, dim in enumerate(shape):
6213  *             if dim <= 0:             # <<<<<<<<<<<<<<
6214  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6215  *             self._shape[idx] = dim
6216  */
6217     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6218     if (unlikely(__pyx_t_4)) {
6219 
6220       /* "View.MemoryView":153
6221  *         for idx, dim in enumerate(shape):
6222  *             if dim <= 0:
6223  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
6224  *             self._shape[idx] = dim
6225  *
6226  */
6227       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
6228       __Pyx_GOTREF(__pyx_t_5);
6229       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
6230       __Pyx_GOTREF(__pyx_t_6);
6231       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
6232       __Pyx_GOTREF(__pyx_t_10);
6233       __Pyx_GIVEREF(__pyx_t_5);
6234       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6235       __Pyx_GIVEREF(__pyx_t_6);
6236       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6237       __pyx_t_5 = 0;
6238       __pyx_t_6 = 0;
6239       __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(1, 153, __pyx_L1_error)
6240       __Pyx_GOTREF(__pyx_t_6);
6241       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6242       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
6243       __Pyx_GOTREF(__pyx_t_10);
6244       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6245       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6246       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6247       __PYX_ERR(1, 153, __pyx_L1_error)
6248 
6249       /* "View.MemoryView":152
6250  *
6251  *         for idx, dim in enumerate(shape):
6252  *             if dim <= 0:             # <<<<<<<<<<<<<<
6253  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6254  *             self._shape[idx] = dim
6255  */
6256     }
6257 
6258     /* "View.MemoryView":154
6259  *             if dim <= 0:
6260  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6261  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
6262  *
6263  *         cdef char order
6264  */
6265     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6266 
6267     /* "View.MemoryView":151
6268  *
6269  *
6270  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
6271  *             if dim <= 0:
6272  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6273  */
6274   }
6275   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6276 
6277   /* "View.MemoryView":157
6278  *
6279  *         cdef char order
6280  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
6281  *             order = b'F'
6282  *             self.mode = u'fortran'
6283  */
6284   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
6285   if (__pyx_t_4) {
6286 
6287     /* "View.MemoryView":158
6288  *         cdef char order
6289  *         if mode == 'fortran':
6290  *             order = b'F'             # <<<<<<<<<<<<<<
6291  *             self.mode = u'fortran'
6292  *         elif mode == 'c':
6293  */
6294     __pyx_v_order = 'F';
6295 
6296     /* "View.MemoryView":159
6297  *         if mode == 'fortran':
6298  *             order = b'F'
6299  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
6300  *         elif mode == 'c':
6301  *             order = b'C'
6302  */
6303     __Pyx_INCREF(__pyx_n_u_fortran);
6304     __Pyx_GIVEREF(__pyx_n_u_fortran);
6305     __Pyx_GOTREF(__pyx_v_self->mode);
6306     __Pyx_DECREF(__pyx_v_self->mode);
6307     __pyx_v_self->mode = __pyx_n_u_fortran;
6308 
6309     /* "View.MemoryView":157
6310  *
6311  *         cdef char order
6312  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
6313  *             order = b'F'
6314  *             self.mode = u'fortran'
6315  */
6316     goto __pyx_L10;
6317   }
6318 
6319   /* "View.MemoryView":160
6320  *             order = b'F'
6321  *             self.mode = u'fortran'
6322  *         elif mode == 'c':             # <<<<<<<<<<<<<<
6323  *             order = b'C'
6324  *             self.mode = u'c'
6325  */
6326   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
6327   if (likely(__pyx_t_4)) {
6328 
6329     /* "View.MemoryView":161
6330  *             self.mode = u'fortran'
6331  *         elif mode == 'c':
6332  *             order = b'C'             # <<<<<<<<<<<<<<
6333  *             self.mode = u'c'
6334  *         else:
6335  */
6336     __pyx_v_order = 'C';
6337 
6338     /* "View.MemoryView":162
6339  *         elif mode == 'c':
6340  *             order = b'C'
6341  *             self.mode = u'c'             # <<<<<<<<<<<<<<
6342  *         else:
6343  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6344  */
6345     __Pyx_INCREF(__pyx_n_u_c);
6346     __Pyx_GIVEREF(__pyx_n_u_c);
6347     __Pyx_GOTREF(__pyx_v_self->mode);
6348     __Pyx_DECREF(__pyx_v_self->mode);
6349     __pyx_v_self->mode = __pyx_n_u_c;
6350 
6351     /* "View.MemoryView":160
6352  *             order = b'F'
6353  *             self.mode = u'fortran'
6354  *         elif mode == 'c':             # <<<<<<<<<<<<<<
6355  *             order = b'C'
6356  *             self.mode = u'c'
6357  */
6358     goto __pyx_L10;
6359   }
6360 
6361   /* "View.MemoryView":164
6362  *             self.mode = u'c'
6363  *         else:
6364  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
6365  *
6366  *         self.len = fill_contig_strides_array(self._shape, self._strides,
6367  */
6368   /*else*/ {
6369     __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(1, 164, __pyx_L1_error)
6370     __Pyx_GOTREF(__pyx_t_3);
6371     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
6372     __Pyx_GOTREF(__pyx_t_10);
6373     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6374     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6375     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6376     __PYX_ERR(1, 164, __pyx_L1_error)
6377   }
6378   __pyx_L10:;
6379 
6380   /* "View.MemoryView":166
6381  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6382  *
6383  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
6384  *                                              itemsize, self.ndim, order)
6385  *
6386  */
6387   __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);
6388 
6389   /* "View.MemoryView":169
6390  *                                              itemsize, self.ndim, order)
6391  *
6392  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
6393  *         self.dtype_is_object = format == b'O'
6394  *         if allocate_buffer:
6395  */
6396   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6397 
6398   /* "View.MemoryView":170
6399  *
6400  *         self.free_data = allocate_buffer
6401  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
6402  *         if allocate_buffer:
6403  *
6404  */
6405   __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(1, 170, __pyx_L1_error)
6406   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
6407   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6408   __pyx_v_self->dtype_is_object = __pyx_t_4;
6409 
6410   /* "View.MemoryView":171
6411  *         self.free_data = allocate_buffer
6412  *         self.dtype_is_object = format == b'O'
6413  *         if allocate_buffer:             # <<<<<<<<<<<<<<
6414  *
6415  *
6416  */
6417   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6418   if (__pyx_t_4) {
6419 
6420     /* "View.MemoryView":174
6421  *
6422  *
6423  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
6424  *             if not self.data:
6425  *                 raise MemoryError("unable to allocate array data.")
6426  */
6427     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6428 
6429     /* "View.MemoryView":175
6430  *
6431  *             self.data = <char *>malloc(self.len)
6432  *             if not self.data:             # <<<<<<<<<<<<<<
6433  *                 raise MemoryError("unable to allocate array data.")
6434  *
6435  */
6436     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6437     if (unlikely(__pyx_t_4)) {
6438 
6439       /* "View.MemoryView":176
6440  *             self.data = <char *>malloc(self.len)
6441  *             if not self.data:
6442  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
6443  *
6444  *             if self.dtype_is_object:
6445  */
6446       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
6447       __Pyx_GOTREF(__pyx_t_10);
6448       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6449       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6450       __PYX_ERR(1, 176, __pyx_L1_error)
6451 
6452       /* "View.MemoryView":175
6453  *
6454  *             self.data = <char *>malloc(self.len)
6455  *             if not self.data:             # <<<<<<<<<<<<<<
6456  *                 raise MemoryError("unable to allocate array data.")
6457  *
6458  */
6459     }
6460 
6461     /* "View.MemoryView":178
6462  *                 raise MemoryError("unable to allocate array data.")
6463  *
6464  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6465  *                 p = <PyObject **> self.data
6466  *                 for i in range(self.len / itemsize):
6467  */
6468     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6469     if (__pyx_t_4) {
6470 
6471       /* "View.MemoryView":179
6472  *
6473  *             if self.dtype_is_object:
6474  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
6475  *                 for i in range(self.len / itemsize):
6476  *                     p[i] = Py_None
6477  */
6478       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6479 
6480       /* "View.MemoryView":180
6481  *             if self.dtype_is_object:
6482  *                 p = <PyObject **> self.data
6483  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
6484  *                     p[i] = Py_None
6485  *                     Py_INCREF(Py_None)
6486  */
6487       if (unlikely(__pyx_v_itemsize == 0)) {
6488         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6489         __PYX_ERR(1, 180, __pyx_L1_error)
6490       }
6491       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))) {
6492         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6493         __PYX_ERR(1, 180, __pyx_L1_error)
6494       }
6495       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
6496       __pyx_t_9 = __pyx_t_1;
6497       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6498         __pyx_v_i = __pyx_t_11;
6499 
6500         /* "View.MemoryView":181
6501  *                 p = <PyObject **> self.data
6502  *                 for i in range(self.len / itemsize):
6503  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
6504  *                     Py_INCREF(Py_None)
6505  *
6506  */
6507         (__pyx_v_p[__pyx_v_i]) = Py_None;
6508 
6509         /* "View.MemoryView":182
6510  *                 for i in range(self.len / itemsize):
6511  *                     p[i] = Py_None
6512  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
6513  *
6514  *     @cname('getbuffer')
6515  */
6516         Py_INCREF(Py_None);
6517       }
6518 
6519       /* "View.MemoryView":178
6520  *                 raise MemoryError("unable to allocate array data.")
6521  *
6522  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6523  *                 p = <PyObject **> self.data
6524  *                 for i in range(self.len / itemsize):
6525  */
6526     }
6527 
6528     /* "View.MemoryView":171
6529  *         self.free_data = allocate_buffer
6530  *         self.dtype_is_object = format == b'O'
6531  *         if allocate_buffer:             # <<<<<<<<<<<<<<
6532  *
6533  *
6534  */
6535   }
6536 
6537   /* "View.MemoryView":122
6538  *         cdef bint dtype_is_object
6539  *
6540  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
6541  *                   mode="c", bint allocate_buffer=True):
6542  *
6543  */
6544 
6545   /* function exit code */
6546   __pyx_r = 0;
6547   goto __pyx_L0;
6548   __pyx_L1_error:;
6549   __Pyx_XDECREF(__pyx_t_3);
6550   __Pyx_XDECREF(__pyx_t_5);
6551   __Pyx_XDECREF(__pyx_t_6);
6552   __Pyx_XDECREF(__pyx_t_10);
6553   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6554   __pyx_r = -1;
6555   __pyx_L0:;
6556   __Pyx_XDECREF(__pyx_v_format);
6557   __Pyx_RefNannyFinishContext();
6558   return __pyx_r;
6559 }
6560 
6561 /* "View.MemoryView":185
6562  *
6563  *     @cname('getbuffer')
6564  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
6565  *         cdef int bufmode = -1
6566  *         if self.mode == u"c":
6567  */
6568 
6569 /* Python wrapper */
6570 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)6571 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6572   int __pyx_r;
6573   __Pyx_RefNannyDeclarations
6574   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6575   __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));
6576 
6577   /* function exit code */
6578   __Pyx_RefNannyFinishContext();
6579   return __pyx_r;
6580 }
6581 
__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)6582 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) {
6583   int __pyx_v_bufmode;
6584   int __pyx_r;
6585   __Pyx_RefNannyDeclarations
6586   int __pyx_t_1;
6587   int __pyx_t_2;
6588   PyObject *__pyx_t_3 = NULL;
6589   char *__pyx_t_4;
6590   Py_ssize_t __pyx_t_5;
6591   int __pyx_t_6;
6592   Py_ssize_t *__pyx_t_7;
6593   if (__pyx_v_info == NULL) {
6594     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6595     return -1;
6596   }
6597   __Pyx_RefNannySetupContext("__getbuffer__", 0);
6598   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6599   __Pyx_GIVEREF(__pyx_v_info->obj);
6600 
6601   /* "View.MemoryView":186
6602  *     @cname('getbuffer')
6603  *     def __getbuffer__(self, Py_buffer *info, int flags):
6604  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
6605  *         if self.mode == u"c":
6606  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6607  */
6608   __pyx_v_bufmode = -1;
6609 
6610   /* "View.MemoryView":187
6611  *     def __getbuffer__(self, Py_buffer *info, int flags):
6612  *         cdef int bufmode = -1
6613  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
6614  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6615  *         elif self.mode == u"fortran":
6616  */
6617   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
6618   __pyx_t_2 = (__pyx_t_1 != 0);
6619   if (__pyx_t_2) {
6620 
6621     /* "View.MemoryView":188
6622  *         cdef int bufmode = -1
6623  *         if self.mode == u"c":
6624  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
6625  *         elif self.mode == u"fortran":
6626  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6627  */
6628     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6629 
6630     /* "View.MemoryView":187
6631  *     def __getbuffer__(self, Py_buffer *info, int flags):
6632  *         cdef int bufmode = -1
6633  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
6634  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6635  *         elif self.mode == u"fortran":
6636  */
6637     goto __pyx_L3;
6638   }
6639 
6640   /* "View.MemoryView":189
6641  *         if self.mode == u"c":
6642  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6643  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
6644  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6645  *         if not (flags & bufmode):
6646  */
6647   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
6648   __pyx_t_1 = (__pyx_t_2 != 0);
6649   if (__pyx_t_1) {
6650 
6651     /* "View.MemoryView":190
6652  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6653  *         elif self.mode == u"fortran":
6654  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
6655  *         if not (flags & bufmode):
6656  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6657  */
6658     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6659 
6660     /* "View.MemoryView":189
6661  *         if self.mode == u"c":
6662  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6663  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
6664  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6665  *         if not (flags & bufmode):
6666  */
6667   }
6668   __pyx_L3:;
6669 
6670   /* "View.MemoryView":191
6671  *         elif self.mode == u"fortran":
6672  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6673  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
6674  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6675  *         info.buf = self.data
6676  */
6677   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
6678   if (unlikely(__pyx_t_1)) {
6679 
6680     /* "View.MemoryView":192
6681  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6682  *         if not (flags & bufmode):
6683  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
6684  *         info.buf = self.data
6685  *         info.len = self.len
6686  */
6687     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
6688     __Pyx_GOTREF(__pyx_t_3);
6689     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6690     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6691     __PYX_ERR(1, 192, __pyx_L1_error)
6692 
6693     /* "View.MemoryView":191
6694  *         elif self.mode == u"fortran":
6695  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6696  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
6697  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6698  *         info.buf = self.data
6699  */
6700   }
6701 
6702   /* "View.MemoryView":193
6703  *         if not (flags & bufmode):
6704  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6705  *         info.buf = self.data             # <<<<<<<<<<<<<<
6706  *         info.len = self.len
6707  *         info.ndim = self.ndim
6708  */
6709   __pyx_t_4 = __pyx_v_self->data;
6710   __pyx_v_info->buf = __pyx_t_4;
6711 
6712   /* "View.MemoryView":194
6713  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
6714  *         info.buf = self.data
6715  *         info.len = self.len             # <<<<<<<<<<<<<<
6716  *         info.ndim = self.ndim
6717  *         info.shape = self._shape
6718  */
6719   __pyx_t_5 = __pyx_v_self->len;
6720   __pyx_v_info->len = __pyx_t_5;
6721 
6722   /* "View.MemoryView":195
6723  *         info.buf = self.data
6724  *         info.len = self.len
6725  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
6726  *         info.shape = self._shape
6727  *         info.strides = self._strides
6728  */
6729   __pyx_t_6 = __pyx_v_self->ndim;
6730   __pyx_v_info->ndim = __pyx_t_6;
6731 
6732   /* "View.MemoryView":196
6733  *         info.len = self.len
6734  *         info.ndim = self.ndim
6735  *         info.shape = self._shape             # <<<<<<<<<<<<<<
6736  *         info.strides = self._strides
6737  *         info.suboffsets = NULL
6738  */
6739   __pyx_t_7 = __pyx_v_self->_shape;
6740   __pyx_v_info->shape = __pyx_t_7;
6741 
6742   /* "View.MemoryView":197
6743  *         info.ndim = self.ndim
6744  *         info.shape = self._shape
6745  *         info.strides = self._strides             # <<<<<<<<<<<<<<
6746  *         info.suboffsets = NULL
6747  *         info.itemsize = self.itemsize
6748  */
6749   __pyx_t_7 = __pyx_v_self->_strides;
6750   __pyx_v_info->strides = __pyx_t_7;
6751 
6752   /* "View.MemoryView":198
6753  *         info.shape = self._shape
6754  *         info.strides = self._strides
6755  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
6756  *         info.itemsize = self.itemsize
6757  *         info.readonly = 0
6758  */
6759   __pyx_v_info->suboffsets = NULL;
6760 
6761   /* "View.MemoryView":199
6762  *         info.strides = self._strides
6763  *         info.suboffsets = NULL
6764  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
6765  *         info.readonly = 0
6766  *
6767  */
6768   __pyx_t_5 = __pyx_v_self->itemsize;
6769   __pyx_v_info->itemsize = __pyx_t_5;
6770 
6771   /* "View.MemoryView":200
6772  *         info.suboffsets = NULL
6773  *         info.itemsize = self.itemsize
6774  *         info.readonly = 0             # <<<<<<<<<<<<<<
6775  *
6776  *         if flags & PyBUF_FORMAT:
6777  */
6778   __pyx_v_info->readonly = 0;
6779 
6780   /* "View.MemoryView":202
6781  *         info.readonly = 0
6782  *
6783  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
6784  *             info.format = self.format
6785  *         else:
6786  */
6787   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
6788   if (__pyx_t_1) {
6789 
6790     /* "View.MemoryView":203
6791  *
6792  *         if flags & PyBUF_FORMAT:
6793  *             info.format = self.format             # <<<<<<<<<<<<<<
6794  *         else:
6795  *             info.format = NULL
6796  */
6797     __pyx_t_4 = __pyx_v_self->format;
6798     __pyx_v_info->format = __pyx_t_4;
6799 
6800     /* "View.MemoryView":202
6801  *         info.readonly = 0
6802  *
6803  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
6804  *             info.format = self.format
6805  *         else:
6806  */
6807     goto __pyx_L5;
6808   }
6809 
6810   /* "View.MemoryView":205
6811  *             info.format = self.format
6812  *         else:
6813  *             info.format = NULL             # <<<<<<<<<<<<<<
6814  *
6815  *         info.obj = self
6816  */
6817   /*else*/ {
6818     __pyx_v_info->format = NULL;
6819   }
6820   __pyx_L5:;
6821 
6822   /* "View.MemoryView":207
6823  *             info.format = NULL
6824  *
6825  *         info.obj = self             # <<<<<<<<<<<<<<
6826  *
6827  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
6828  */
6829   __Pyx_INCREF(((PyObject *)__pyx_v_self));
6830   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6831   __Pyx_GOTREF(__pyx_v_info->obj);
6832   __Pyx_DECREF(__pyx_v_info->obj);
6833   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6834 
6835   /* "View.MemoryView":185
6836  *
6837  *     @cname('getbuffer')
6838  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
6839  *         cdef int bufmode = -1
6840  *         if self.mode == u"c":
6841  */
6842 
6843   /* function exit code */
6844   __pyx_r = 0;
6845   goto __pyx_L0;
6846   __pyx_L1_error:;
6847   __Pyx_XDECREF(__pyx_t_3);
6848   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6849   __pyx_r = -1;
6850   if (__pyx_v_info->obj != NULL) {
6851     __Pyx_GOTREF(__pyx_v_info->obj);
6852     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6853   }
6854   goto __pyx_L2;
6855   __pyx_L0:;
6856   if (__pyx_v_info->obj == Py_None) {
6857     __Pyx_GOTREF(__pyx_v_info->obj);
6858     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6859   }
6860   __pyx_L2:;
6861   __Pyx_RefNannyFinishContext();
6862   return __pyx_r;
6863 }
6864 
6865 /* "View.MemoryView":211
6866  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
6867  *
6868  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
6869  *         if self.callback_free_data != NULL:
6870  *             self.callback_free_data(self.data)
6871  */
6872 
6873 /* Python wrapper */
6874 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)6875 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
6876   __Pyx_RefNannyDeclarations
6877   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
6878   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
6879 
6880   /* function exit code */
6881   __Pyx_RefNannyFinishContext();
6882 }
6883 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)6884 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6885   __Pyx_RefNannyDeclarations
6886   int __pyx_t_1;
6887   __Pyx_RefNannySetupContext("__dealloc__", 0);
6888 
6889   /* "View.MemoryView":212
6890  *
6891  *     def __dealloc__(array self):
6892  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
6893  *             self.callback_free_data(self.data)
6894  *         elif self.free_data:
6895  */
6896   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
6897   if (__pyx_t_1) {
6898 
6899     /* "View.MemoryView":213
6900  *     def __dealloc__(array self):
6901  *         if self.callback_free_data != NULL:
6902  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
6903  *         elif self.free_data:
6904  *             if self.dtype_is_object:
6905  */
6906     __pyx_v_self->callback_free_data(__pyx_v_self->data);
6907 
6908     /* "View.MemoryView":212
6909  *
6910  *     def __dealloc__(array self):
6911  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
6912  *             self.callback_free_data(self.data)
6913  *         elif self.free_data:
6914  */
6915     goto __pyx_L3;
6916   }
6917 
6918   /* "View.MemoryView":214
6919  *         if self.callback_free_data != NULL:
6920  *             self.callback_free_data(self.data)
6921  *         elif self.free_data:             # <<<<<<<<<<<<<<
6922  *             if self.dtype_is_object:
6923  *                 refcount_objects_in_slice(self.data, self._shape,
6924  */
6925   __pyx_t_1 = (__pyx_v_self->free_data != 0);
6926   if (__pyx_t_1) {
6927 
6928     /* "View.MemoryView":215
6929  *             self.callback_free_data(self.data)
6930  *         elif self.free_data:
6931  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6932  *                 refcount_objects_in_slice(self.data, self._shape,
6933  *                                           self._strides, self.ndim, False)
6934  */
6935     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
6936     if (__pyx_t_1) {
6937 
6938       /* "View.MemoryView":216
6939  *         elif self.free_data:
6940  *             if self.dtype_is_object:
6941  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
6942  *                                           self._strides, self.ndim, False)
6943  *             free(self.data)
6944  */
6945       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6946 
6947       /* "View.MemoryView":215
6948  *             self.callback_free_data(self.data)
6949  *         elif self.free_data:
6950  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
6951  *                 refcount_objects_in_slice(self.data, self._shape,
6952  *                                           self._strides, self.ndim, False)
6953  */
6954     }
6955 
6956     /* "View.MemoryView":218
6957  *                 refcount_objects_in_slice(self.data, self._shape,
6958  *                                           self._strides, self.ndim, False)
6959  *             free(self.data)             # <<<<<<<<<<<<<<
6960  *         PyObject_Free(self._shape)
6961  *
6962  */
6963     free(__pyx_v_self->data);
6964 
6965     /* "View.MemoryView":214
6966  *         if self.callback_free_data != NULL:
6967  *             self.callback_free_data(self.data)
6968  *         elif self.free_data:             # <<<<<<<<<<<<<<
6969  *             if self.dtype_is_object:
6970  *                 refcount_objects_in_slice(self.data, self._shape,
6971  */
6972   }
6973   __pyx_L3:;
6974 
6975   /* "View.MemoryView":219
6976  *                                           self._strides, self.ndim, False)
6977  *             free(self.data)
6978  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
6979  *
6980  *     @property
6981  */
6982   PyObject_Free(__pyx_v_self->_shape);
6983 
6984   /* "View.MemoryView":211
6985  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
6986  *
6987  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
6988  *         if self.callback_free_data != NULL:
6989  *             self.callback_free_data(self.data)
6990  */
6991 
6992   /* function exit code */
6993   __Pyx_RefNannyFinishContext();
6994 }
6995 
6996 /* "View.MemoryView":222
6997  *
6998  *     @property
6999  *     def memview(self):             # <<<<<<<<<<<<<<
7000  *         return self.get_memview()
7001  *
7002  */
7003 
7004 /* Python wrapper */
7005 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)7006 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7007   PyObject *__pyx_r = 0;
7008   __Pyx_RefNannyDeclarations
7009   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7010   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7011 
7012   /* function exit code */
7013   __Pyx_RefNannyFinishContext();
7014   return __pyx_r;
7015 }
7016 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)7017 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7018   PyObject *__pyx_r = NULL;
7019   __Pyx_RefNannyDeclarations
7020   PyObject *__pyx_t_1 = NULL;
7021   __Pyx_RefNannySetupContext("__get__", 0);
7022 
7023   /* "View.MemoryView":223
7024  *     @property
7025  *     def memview(self):
7026  *         return self.get_memview()             # <<<<<<<<<<<<<<
7027  *
7028  *     @cname('get_memview')
7029  */
7030   __Pyx_XDECREF(__pyx_r);
7031   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
7032   __Pyx_GOTREF(__pyx_t_1);
7033   __pyx_r = __pyx_t_1;
7034   __pyx_t_1 = 0;
7035   goto __pyx_L0;
7036 
7037   /* "View.MemoryView":222
7038  *
7039  *     @property
7040  *     def memview(self):             # <<<<<<<<<<<<<<
7041  *         return self.get_memview()
7042  *
7043  */
7044 
7045   /* function exit code */
7046   __pyx_L1_error:;
7047   __Pyx_XDECREF(__pyx_t_1);
7048   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7049   __pyx_r = NULL;
7050   __pyx_L0:;
7051   __Pyx_XGIVEREF(__pyx_r);
7052   __Pyx_RefNannyFinishContext();
7053   return __pyx_r;
7054 }
7055 
7056 /* "View.MemoryView":226
7057  *
7058  *     @cname('get_memview')
7059  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
7060  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7061  *         return  memoryview(self, flags, self.dtype_is_object)
7062  */
7063 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)7064 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7065   int __pyx_v_flags;
7066   PyObject *__pyx_r = NULL;
7067   __Pyx_RefNannyDeclarations
7068   PyObject *__pyx_t_1 = NULL;
7069   PyObject *__pyx_t_2 = NULL;
7070   PyObject *__pyx_t_3 = NULL;
7071   __Pyx_RefNannySetupContext("get_memview", 0);
7072 
7073   /* "View.MemoryView":227
7074  *     @cname('get_memview')
7075  *     cdef get_memview(self):
7076  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
7077  *         return  memoryview(self, flags, self.dtype_is_object)
7078  *
7079  */
7080   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7081 
7082   /* "View.MemoryView":228
7083  *     cdef get_memview(self):
7084  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7085  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
7086  *
7087  *     def __len__(self):
7088  */
7089   __Pyx_XDECREF(__pyx_r);
7090   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
7091   __Pyx_GOTREF(__pyx_t_1);
7092   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
7093   __Pyx_GOTREF(__pyx_t_2);
7094   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
7095   __Pyx_GOTREF(__pyx_t_3);
7096   __Pyx_INCREF(((PyObject *)__pyx_v_self));
7097   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7098   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7099   __Pyx_GIVEREF(__pyx_t_1);
7100   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7101   __Pyx_GIVEREF(__pyx_t_2);
7102   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7103   __pyx_t_1 = 0;
7104   __pyx_t_2 = 0;
7105   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
7106   __Pyx_GOTREF(__pyx_t_2);
7107   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7108   __pyx_r = __pyx_t_2;
7109   __pyx_t_2 = 0;
7110   goto __pyx_L0;
7111 
7112   /* "View.MemoryView":226
7113  *
7114  *     @cname('get_memview')
7115  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
7116  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7117  *         return  memoryview(self, flags, self.dtype_is_object)
7118  */
7119 
7120   /* function exit code */
7121   __pyx_L1_error:;
7122   __Pyx_XDECREF(__pyx_t_1);
7123   __Pyx_XDECREF(__pyx_t_2);
7124   __Pyx_XDECREF(__pyx_t_3);
7125   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7126   __pyx_r = 0;
7127   __pyx_L0:;
7128   __Pyx_XGIVEREF(__pyx_r);
7129   __Pyx_RefNannyFinishContext();
7130   return __pyx_r;
7131 }
7132 
7133 /* "View.MemoryView":230
7134  *         return  memoryview(self, flags, self.dtype_is_object)
7135  *
7136  *     def __len__(self):             # <<<<<<<<<<<<<<
7137  *         return self._shape[0]
7138  *
7139  */
7140 
7141 /* Python wrapper */
7142 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)7143 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7144   Py_ssize_t __pyx_r;
7145   __Pyx_RefNannyDeclarations
7146   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7147   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7148 
7149   /* function exit code */
7150   __Pyx_RefNannyFinishContext();
7151   return __pyx_r;
7152 }
7153 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)7154 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7155   Py_ssize_t __pyx_r;
7156   __Pyx_RefNannyDeclarations
7157   __Pyx_RefNannySetupContext("__len__", 0);
7158 
7159   /* "View.MemoryView":231
7160  *
7161  *     def __len__(self):
7162  *         return self._shape[0]             # <<<<<<<<<<<<<<
7163  *
7164  *     def __getattr__(self, attr):
7165  */
7166   __pyx_r = (__pyx_v_self->_shape[0]);
7167   goto __pyx_L0;
7168 
7169   /* "View.MemoryView":230
7170  *         return  memoryview(self, flags, self.dtype_is_object)
7171  *
7172  *     def __len__(self):             # <<<<<<<<<<<<<<
7173  *         return self._shape[0]
7174  *
7175  */
7176 
7177   /* function exit code */
7178   __pyx_L0:;
7179   __Pyx_RefNannyFinishContext();
7180   return __pyx_r;
7181 }
7182 
7183 /* "View.MemoryView":233
7184  *         return self._shape[0]
7185  *
7186  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
7187  *         return getattr(self.memview, attr)
7188  *
7189  */
7190 
7191 /* Python wrapper */
7192 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)7193 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7194   PyObject *__pyx_r = 0;
7195   __Pyx_RefNannyDeclarations
7196   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7197   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7198 
7199   /* function exit code */
7200   __Pyx_RefNannyFinishContext();
7201   return __pyx_r;
7202 }
7203 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)7204 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7205   PyObject *__pyx_r = NULL;
7206   __Pyx_RefNannyDeclarations
7207   PyObject *__pyx_t_1 = NULL;
7208   PyObject *__pyx_t_2 = NULL;
7209   __Pyx_RefNannySetupContext("__getattr__", 0);
7210 
7211   /* "View.MemoryView":234
7212  *
7213  *     def __getattr__(self, attr):
7214  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
7215  *
7216  *     def __getitem__(self, item):
7217  */
7218   __Pyx_XDECREF(__pyx_r);
7219   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
7220   __Pyx_GOTREF(__pyx_t_1);
7221   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
7222   __Pyx_GOTREF(__pyx_t_2);
7223   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7224   __pyx_r = __pyx_t_2;
7225   __pyx_t_2 = 0;
7226   goto __pyx_L0;
7227 
7228   /* "View.MemoryView":233
7229  *         return self._shape[0]
7230  *
7231  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
7232  *         return getattr(self.memview, attr)
7233  *
7234  */
7235 
7236   /* function exit code */
7237   __pyx_L1_error:;
7238   __Pyx_XDECREF(__pyx_t_1);
7239   __Pyx_XDECREF(__pyx_t_2);
7240   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7241   __pyx_r = NULL;
7242   __pyx_L0:;
7243   __Pyx_XGIVEREF(__pyx_r);
7244   __Pyx_RefNannyFinishContext();
7245   return __pyx_r;
7246 }
7247 
7248 /* "View.MemoryView":236
7249  *         return getattr(self.memview, attr)
7250  *
7251  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
7252  *         return self.memview[item]
7253  *
7254  */
7255 
7256 /* Python wrapper */
7257 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)7258 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7259   PyObject *__pyx_r = 0;
7260   __Pyx_RefNannyDeclarations
7261   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7262   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7263 
7264   /* function exit code */
7265   __Pyx_RefNannyFinishContext();
7266   return __pyx_r;
7267 }
7268 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)7269 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7270   PyObject *__pyx_r = NULL;
7271   __Pyx_RefNannyDeclarations
7272   PyObject *__pyx_t_1 = NULL;
7273   PyObject *__pyx_t_2 = NULL;
7274   __Pyx_RefNannySetupContext("__getitem__", 0);
7275 
7276   /* "View.MemoryView":237
7277  *
7278  *     def __getitem__(self, item):
7279  *         return self.memview[item]             # <<<<<<<<<<<<<<
7280  *
7281  *     def __setitem__(self, item, value):
7282  */
7283   __Pyx_XDECREF(__pyx_r);
7284   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
7285   __Pyx_GOTREF(__pyx_t_1);
7286   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
7287   __Pyx_GOTREF(__pyx_t_2);
7288   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7289   __pyx_r = __pyx_t_2;
7290   __pyx_t_2 = 0;
7291   goto __pyx_L0;
7292 
7293   /* "View.MemoryView":236
7294  *         return getattr(self.memview, attr)
7295  *
7296  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
7297  *         return self.memview[item]
7298  *
7299  */
7300 
7301   /* function exit code */
7302   __pyx_L1_error:;
7303   __Pyx_XDECREF(__pyx_t_1);
7304   __Pyx_XDECREF(__pyx_t_2);
7305   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7306   __pyx_r = NULL;
7307   __pyx_L0:;
7308   __Pyx_XGIVEREF(__pyx_r);
7309   __Pyx_RefNannyFinishContext();
7310   return __pyx_r;
7311 }
7312 
7313 /* "View.MemoryView":239
7314  *         return self.memview[item]
7315  *
7316  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
7317  *         self.memview[item] = value
7318  *
7319  */
7320 
7321 /* Python wrapper */
7322 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)7323 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7324   int __pyx_r;
7325   __Pyx_RefNannyDeclarations
7326   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7327   __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));
7328 
7329   /* function exit code */
7330   __Pyx_RefNannyFinishContext();
7331   return __pyx_r;
7332 }
7333 
__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)7334 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) {
7335   int __pyx_r;
7336   __Pyx_RefNannyDeclarations
7337   PyObject *__pyx_t_1 = NULL;
7338   __Pyx_RefNannySetupContext("__setitem__", 0);
7339 
7340   /* "View.MemoryView":240
7341  *
7342  *     def __setitem__(self, item, value):
7343  *         self.memview[item] = value             # <<<<<<<<<<<<<<
7344  *
7345  *
7346  */
7347   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
7348   __Pyx_GOTREF(__pyx_t_1);
7349   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
7350   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7351 
7352   /* "View.MemoryView":239
7353  *         return self.memview[item]
7354  *
7355  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
7356  *         self.memview[item] = value
7357  *
7358  */
7359 
7360   /* function exit code */
7361   __pyx_r = 0;
7362   goto __pyx_L0;
7363   __pyx_L1_error:;
7364   __Pyx_XDECREF(__pyx_t_1);
7365   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7366   __pyx_r = -1;
7367   __pyx_L0:;
7368   __Pyx_RefNannyFinishContext();
7369   return __pyx_r;
7370 }
7371 
7372 /* "(tree fragment)":1
7373  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7374  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7375  * def __setstate_cython__(self, __pyx_state):
7376  */
7377 
7378 /* Python wrapper */
7379 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)7380 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7381   PyObject *__pyx_r = 0;
7382   __Pyx_RefNannyDeclarations
7383   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7384   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7385 
7386   /* function exit code */
7387   __Pyx_RefNannyFinishContext();
7388   return __pyx_r;
7389 }
7390 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)7391 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7392   PyObject *__pyx_r = NULL;
7393   __Pyx_RefNannyDeclarations
7394   PyObject *__pyx_t_1 = NULL;
7395   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7396 
7397   /* "(tree fragment)":2
7398  * def __reduce_cython__(self):
7399  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
7400  * def __setstate_cython__(self, __pyx_state):
7401  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7402  */
7403   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
7404   __Pyx_GOTREF(__pyx_t_1);
7405   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7406   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7407   __PYX_ERR(1, 2, __pyx_L1_error)
7408 
7409   /* "(tree fragment)":1
7410  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7411  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7412  * def __setstate_cython__(self, __pyx_state):
7413  */
7414 
7415   /* function exit code */
7416   __pyx_L1_error:;
7417   __Pyx_XDECREF(__pyx_t_1);
7418   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7419   __pyx_r = NULL;
7420   __Pyx_XGIVEREF(__pyx_r);
7421   __Pyx_RefNannyFinishContext();
7422   return __pyx_r;
7423 }
7424 
7425 /* "(tree fragment)":3
7426  * def __reduce_cython__(self):
7427  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7428  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7429  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7430  */
7431 
7432 /* Python wrapper */
7433 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)7434 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7435   PyObject *__pyx_r = 0;
7436   __Pyx_RefNannyDeclarations
7437   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7438   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7439 
7440   /* function exit code */
7441   __Pyx_RefNannyFinishContext();
7442   return __pyx_r;
7443 }
7444 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)7445 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) {
7446   PyObject *__pyx_r = NULL;
7447   __Pyx_RefNannyDeclarations
7448   PyObject *__pyx_t_1 = NULL;
7449   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7450 
7451   /* "(tree fragment)":4
7452  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7453  * def __setstate_cython__(self, __pyx_state):
7454  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
7455  */
7456   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
7457   __Pyx_GOTREF(__pyx_t_1);
7458   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7459   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7460   __PYX_ERR(1, 4, __pyx_L1_error)
7461 
7462   /* "(tree fragment)":3
7463  * def __reduce_cython__(self):
7464  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7465  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7466  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7467  */
7468 
7469   /* function exit code */
7470   __pyx_L1_error:;
7471   __Pyx_XDECREF(__pyx_t_1);
7472   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7473   __pyx_r = NULL;
7474   __Pyx_XGIVEREF(__pyx_r);
7475   __Pyx_RefNannyFinishContext();
7476   return __pyx_r;
7477 }
7478 
7479 /* "View.MemoryView":244
7480  *
7481  * @cname("__pyx_array_new")
7482  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
7483  *                           char *mode, char *buf):
7484  *     cdef array result
7485  */
7486 
__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)7487 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) {
7488   struct __pyx_array_obj *__pyx_v_result = 0;
7489   struct __pyx_array_obj *__pyx_r = NULL;
7490   __Pyx_RefNannyDeclarations
7491   int __pyx_t_1;
7492   PyObject *__pyx_t_2 = NULL;
7493   PyObject *__pyx_t_3 = NULL;
7494   PyObject *__pyx_t_4 = NULL;
7495   PyObject *__pyx_t_5 = NULL;
7496   __Pyx_RefNannySetupContext("array_cwrapper", 0);
7497 
7498   /* "View.MemoryView":248
7499  *     cdef array result
7500  *
7501  *     if buf == NULL:             # <<<<<<<<<<<<<<
7502  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7503  *     else:
7504  */
7505   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7506   if (__pyx_t_1) {
7507 
7508     /* "View.MemoryView":249
7509  *
7510  *     if buf == NULL:
7511  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
7512  *     else:
7513  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7514  */
7515     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
7516     __Pyx_GOTREF(__pyx_t_2);
7517     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
7518     __Pyx_GOTREF(__pyx_t_3);
7519     __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(1, 249, __pyx_L1_error)
7520     __Pyx_GOTREF(__pyx_t_4);
7521     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
7522     __Pyx_GOTREF(__pyx_t_5);
7523     __Pyx_INCREF(__pyx_v_shape);
7524     __Pyx_GIVEREF(__pyx_v_shape);
7525     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
7526     __Pyx_GIVEREF(__pyx_t_2);
7527     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7528     __Pyx_GIVEREF(__pyx_t_3);
7529     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
7530     __Pyx_GIVEREF(__pyx_t_4);
7531     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
7532     __pyx_t_2 = 0;
7533     __pyx_t_3 = 0;
7534     __pyx_t_4 = 0;
7535     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
7536     __Pyx_GOTREF(__pyx_t_4);
7537     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7538     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
7539     __pyx_t_4 = 0;
7540 
7541     /* "View.MemoryView":248
7542  *     cdef array result
7543  *
7544  *     if buf == NULL:             # <<<<<<<<<<<<<<
7545  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7546  *     else:
7547  */
7548     goto __pyx_L3;
7549   }
7550 
7551   /* "View.MemoryView":251
7552  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7553  *     else:
7554  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
7555  *                        allocate_buffer=False)
7556  *         result.data = buf
7557  */
7558   /*else*/ {
7559     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
7560     __Pyx_GOTREF(__pyx_t_4);
7561     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
7562     __Pyx_GOTREF(__pyx_t_5);
7563     __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(1, 251, __pyx_L1_error)
7564     __Pyx_GOTREF(__pyx_t_3);
7565     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
7566     __Pyx_GOTREF(__pyx_t_2);
7567     __Pyx_INCREF(__pyx_v_shape);
7568     __Pyx_GIVEREF(__pyx_v_shape);
7569     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
7570     __Pyx_GIVEREF(__pyx_t_4);
7571     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7572     __Pyx_GIVEREF(__pyx_t_5);
7573     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
7574     __Pyx_GIVEREF(__pyx_t_3);
7575     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
7576     __pyx_t_4 = 0;
7577     __pyx_t_5 = 0;
7578     __pyx_t_3 = 0;
7579 
7580     /* "View.MemoryView":252
7581  *     else:
7582  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7583  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
7584  *         result.data = buf
7585  *
7586  */
7587     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
7588     __Pyx_GOTREF(__pyx_t_3);
7589     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
7590 
7591     /* "View.MemoryView":251
7592  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
7593  *     else:
7594  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
7595  *                        allocate_buffer=False)
7596  *         result.data = buf
7597  */
7598     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
7599     __Pyx_GOTREF(__pyx_t_5);
7600     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7601     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7602     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
7603     __pyx_t_5 = 0;
7604 
7605     /* "View.MemoryView":253
7606  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
7607  *                        allocate_buffer=False)
7608  *         result.data = buf             # <<<<<<<<<<<<<<
7609  *
7610  *     return result
7611  */
7612     __pyx_v_result->data = __pyx_v_buf;
7613   }
7614   __pyx_L3:;
7615 
7616   /* "View.MemoryView":255
7617  *         result.data = buf
7618  *
7619  *     return result             # <<<<<<<<<<<<<<
7620  *
7621  *
7622  */
7623   __Pyx_XDECREF(((PyObject *)__pyx_r));
7624   __Pyx_INCREF(((PyObject *)__pyx_v_result));
7625   __pyx_r = __pyx_v_result;
7626   goto __pyx_L0;
7627 
7628   /* "View.MemoryView":244
7629  *
7630  * @cname("__pyx_array_new")
7631  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
7632  *                           char *mode, char *buf):
7633  *     cdef array result
7634  */
7635 
7636   /* function exit code */
7637   __pyx_L1_error:;
7638   __Pyx_XDECREF(__pyx_t_2);
7639   __Pyx_XDECREF(__pyx_t_3);
7640   __Pyx_XDECREF(__pyx_t_4);
7641   __Pyx_XDECREF(__pyx_t_5);
7642   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7643   __pyx_r = 0;
7644   __pyx_L0:;
7645   __Pyx_XDECREF((PyObject *)__pyx_v_result);
7646   __Pyx_XGIVEREF((PyObject *)__pyx_r);
7647   __Pyx_RefNannyFinishContext();
7648   return __pyx_r;
7649 }
7650 
7651 /* "View.MemoryView":281
7652  * cdef class Enum(object):
7653  *     cdef object name
7654  *     def __init__(self, name):             # <<<<<<<<<<<<<<
7655  *         self.name = name
7656  *     def __repr__(self):
7657  */
7658 
7659 /* Python wrapper */
7660 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)7661 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7662   PyObject *__pyx_v_name = 0;
7663   int __pyx_r;
7664   __Pyx_RefNannyDeclarations
7665   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7666   {
7667     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7668     PyObject* values[1] = {0};
7669     if (unlikely(__pyx_kwds)) {
7670       Py_ssize_t kw_args;
7671       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7672       switch (pos_args) {
7673         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7674         CYTHON_FALLTHROUGH;
7675         case  0: break;
7676         default: goto __pyx_L5_argtuple_error;
7677       }
7678       kw_args = PyDict_Size(__pyx_kwds);
7679       switch (pos_args) {
7680         case  0:
7681         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
7682         else goto __pyx_L5_argtuple_error;
7683       }
7684       if (unlikely(kw_args > 0)) {
7685         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
7686       }
7687     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
7688       goto __pyx_L5_argtuple_error;
7689     } else {
7690       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7691     }
7692     __pyx_v_name = values[0];
7693   }
7694   goto __pyx_L4_argument_unpacking_done;
7695   __pyx_L5_argtuple_error:;
7696   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
7697   __pyx_L3_error:;
7698   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7699   __Pyx_RefNannyFinishContext();
7700   return -1;
7701   __pyx_L4_argument_unpacking_done:;
7702   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7703 
7704   /* function exit code */
7705   __Pyx_RefNannyFinishContext();
7706   return __pyx_r;
7707 }
7708 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)7709 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7710   int __pyx_r;
7711   __Pyx_RefNannyDeclarations
7712   __Pyx_RefNannySetupContext("__init__", 0);
7713 
7714   /* "View.MemoryView":282
7715  *     cdef object name
7716  *     def __init__(self, name):
7717  *         self.name = name             # <<<<<<<<<<<<<<
7718  *     def __repr__(self):
7719  *         return self.name
7720  */
7721   __Pyx_INCREF(__pyx_v_name);
7722   __Pyx_GIVEREF(__pyx_v_name);
7723   __Pyx_GOTREF(__pyx_v_self->name);
7724   __Pyx_DECREF(__pyx_v_self->name);
7725   __pyx_v_self->name = __pyx_v_name;
7726 
7727   /* "View.MemoryView":281
7728  * cdef class Enum(object):
7729  *     cdef object name
7730  *     def __init__(self, name):             # <<<<<<<<<<<<<<
7731  *         self.name = name
7732  *     def __repr__(self):
7733  */
7734 
7735   /* function exit code */
7736   __pyx_r = 0;
7737   __Pyx_RefNannyFinishContext();
7738   return __pyx_r;
7739 }
7740 
7741 /* "View.MemoryView":283
7742  *     def __init__(self, name):
7743  *         self.name = name
7744  *     def __repr__(self):             # <<<<<<<<<<<<<<
7745  *         return self.name
7746  *
7747  */
7748 
7749 /* Python wrapper */
7750 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)7751 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7752   PyObject *__pyx_r = 0;
7753   __Pyx_RefNannyDeclarations
7754   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7755   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7756 
7757   /* function exit code */
7758   __Pyx_RefNannyFinishContext();
7759   return __pyx_r;
7760 }
7761 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)7762 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7763   PyObject *__pyx_r = NULL;
7764   __Pyx_RefNannyDeclarations
7765   __Pyx_RefNannySetupContext("__repr__", 0);
7766 
7767   /* "View.MemoryView":284
7768  *         self.name = name
7769  *     def __repr__(self):
7770  *         return self.name             # <<<<<<<<<<<<<<
7771  *
7772  * cdef generic = Enum("<strided and direct or indirect>")
7773  */
7774   __Pyx_XDECREF(__pyx_r);
7775   __Pyx_INCREF(__pyx_v_self->name);
7776   __pyx_r = __pyx_v_self->name;
7777   goto __pyx_L0;
7778 
7779   /* "View.MemoryView":283
7780  *     def __init__(self, name):
7781  *         self.name = name
7782  *     def __repr__(self):             # <<<<<<<<<<<<<<
7783  *         return self.name
7784  *
7785  */
7786 
7787   /* function exit code */
7788   __pyx_L0:;
7789   __Pyx_XGIVEREF(__pyx_r);
7790   __Pyx_RefNannyFinishContext();
7791   return __pyx_r;
7792 }
7793 
7794 /* "(tree fragment)":1
7795  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7796  *     cdef tuple state
7797  *     cdef object _dict
7798  */
7799 
7800 /* Python wrapper */
7801 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)7802 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7803   PyObject *__pyx_r = 0;
7804   __Pyx_RefNannyDeclarations
7805   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7806   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7807 
7808   /* function exit code */
7809   __Pyx_RefNannyFinishContext();
7810   return __pyx_r;
7811 }
7812 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)7813 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7814   PyObject *__pyx_v_state = 0;
7815   PyObject *__pyx_v__dict = 0;
7816   int __pyx_v_use_setstate;
7817   PyObject *__pyx_r = NULL;
7818   __Pyx_RefNannyDeclarations
7819   PyObject *__pyx_t_1 = NULL;
7820   int __pyx_t_2;
7821   int __pyx_t_3;
7822   PyObject *__pyx_t_4 = NULL;
7823   PyObject *__pyx_t_5 = NULL;
7824   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7825 
7826   /* "(tree fragment)":5
7827  *     cdef object _dict
7828  *     cdef bint use_setstate
7829  *     state = (self.name,)             # <<<<<<<<<<<<<<
7830  *     _dict = getattr(self, '__dict__', None)
7831  *     if _dict is not None:
7832  */
7833   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7834   __Pyx_GOTREF(__pyx_t_1);
7835   __Pyx_INCREF(__pyx_v_self->name);
7836   __Pyx_GIVEREF(__pyx_v_self->name);
7837   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
7838   __pyx_v_state = ((PyObject*)__pyx_t_1);
7839   __pyx_t_1 = 0;
7840 
7841   /* "(tree fragment)":6
7842  *     cdef bint use_setstate
7843  *     state = (self.name,)
7844  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
7845  *     if _dict is not None:
7846  *         state += (_dict,)
7847  */
7848   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7849   __Pyx_GOTREF(__pyx_t_1);
7850   __pyx_v__dict = __pyx_t_1;
7851   __pyx_t_1 = 0;
7852 
7853   /* "(tree fragment)":7
7854  *     state = (self.name,)
7855  *     _dict = getattr(self, '__dict__', None)
7856  *     if _dict is not None:             # <<<<<<<<<<<<<<
7857  *         state += (_dict,)
7858  *         use_setstate = True
7859  */
7860   __pyx_t_2 = (__pyx_v__dict != Py_None);
7861   __pyx_t_3 = (__pyx_t_2 != 0);
7862   if (__pyx_t_3) {
7863 
7864     /* "(tree fragment)":8
7865  *     _dict = getattr(self, '__dict__', None)
7866  *     if _dict is not None:
7867  *         state += (_dict,)             # <<<<<<<<<<<<<<
7868  *         use_setstate = True
7869  *     else:
7870  */
7871     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7872     __Pyx_GOTREF(__pyx_t_1);
7873     __Pyx_INCREF(__pyx_v__dict);
7874     __Pyx_GIVEREF(__pyx_v__dict);
7875     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
7876     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
7877     __Pyx_GOTREF(__pyx_t_4);
7878     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7879     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
7880     __pyx_t_4 = 0;
7881 
7882     /* "(tree fragment)":9
7883  *     if _dict is not None:
7884  *         state += (_dict,)
7885  *         use_setstate = True             # <<<<<<<<<<<<<<
7886  *     else:
7887  *         use_setstate = self.name is not None
7888  */
7889     __pyx_v_use_setstate = 1;
7890 
7891     /* "(tree fragment)":7
7892  *     state = (self.name,)
7893  *     _dict = getattr(self, '__dict__', None)
7894  *     if _dict is not None:             # <<<<<<<<<<<<<<
7895  *         state += (_dict,)
7896  *         use_setstate = True
7897  */
7898     goto __pyx_L3;
7899   }
7900 
7901   /* "(tree fragment)":11
7902  *         use_setstate = True
7903  *     else:
7904  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
7905  *     if use_setstate:
7906  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7907  */
7908   /*else*/ {
7909     __pyx_t_3 = (__pyx_v_self->name != Py_None);
7910     __pyx_v_use_setstate = __pyx_t_3;
7911   }
7912   __pyx_L3:;
7913 
7914   /* "(tree fragment)":12
7915  *     else:
7916  *         use_setstate = self.name is not None
7917  *     if use_setstate:             # <<<<<<<<<<<<<<
7918  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7919  *     else:
7920  */
7921   __pyx_t_3 = (__pyx_v_use_setstate != 0);
7922   if (__pyx_t_3) {
7923 
7924     /* "(tree fragment)":13
7925  *         use_setstate = self.name is not None
7926  *     if use_setstate:
7927  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
7928  *     else:
7929  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
7930  */
7931     __Pyx_XDECREF(__pyx_r);
7932     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7933     __Pyx_GOTREF(__pyx_t_4);
7934     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7935     __Pyx_GOTREF(__pyx_t_1);
7936     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7937     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7938     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7939     __Pyx_INCREF(__pyx_int_184977713);
7940     __Pyx_GIVEREF(__pyx_int_184977713);
7941     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7942     __Pyx_INCREF(Py_None);
7943     __Pyx_GIVEREF(Py_None);
7944     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
7945     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
7946     __Pyx_GOTREF(__pyx_t_5);
7947     __Pyx_GIVEREF(__pyx_t_4);
7948     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
7949     __Pyx_GIVEREF(__pyx_t_1);
7950     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
7951     __Pyx_INCREF(__pyx_v_state);
7952     __Pyx_GIVEREF(__pyx_v_state);
7953     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
7954     __pyx_t_4 = 0;
7955     __pyx_t_1 = 0;
7956     __pyx_r = __pyx_t_5;
7957     __pyx_t_5 = 0;
7958     goto __pyx_L0;
7959 
7960     /* "(tree fragment)":12
7961  *     else:
7962  *         use_setstate = self.name is not None
7963  *     if use_setstate:             # <<<<<<<<<<<<<<
7964  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7965  *     else:
7966  */
7967   }
7968 
7969   /* "(tree fragment)":15
7970  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7971  *     else:
7972  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
7973  * def __setstate_cython__(self, __pyx_state):
7974  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
7975  */
7976   /*else*/ {
7977     __Pyx_XDECREF(__pyx_r);
7978     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
7979     __Pyx_GOTREF(__pyx_t_5);
7980     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7981     __Pyx_GOTREF(__pyx_t_1);
7982     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7983     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7984     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7985     __Pyx_INCREF(__pyx_int_184977713);
7986     __Pyx_GIVEREF(__pyx_int_184977713);
7987     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7988     __Pyx_INCREF(__pyx_v_state);
7989     __Pyx_GIVEREF(__pyx_v_state);
7990     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
7991     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7992     __Pyx_GOTREF(__pyx_t_4);
7993     __Pyx_GIVEREF(__pyx_t_5);
7994     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7995     __Pyx_GIVEREF(__pyx_t_1);
7996     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
7997     __pyx_t_5 = 0;
7998     __pyx_t_1 = 0;
7999     __pyx_r = __pyx_t_4;
8000     __pyx_t_4 = 0;
8001     goto __pyx_L0;
8002   }
8003 
8004   /* "(tree fragment)":1
8005  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8006  *     cdef tuple state
8007  *     cdef object _dict
8008  */
8009 
8010   /* function exit code */
8011   __pyx_L1_error:;
8012   __Pyx_XDECREF(__pyx_t_1);
8013   __Pyx_XDECREF(__pyx_t_4);
8014   __Pyx_XDECREF(__pyx_t_5);
8015   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8016   __pyx_r = NULL;
8017   __pyx_L0:;
8018   __Pyx_XDECREF(__pyx_v_state);
8019   __Pyx_XDECREF(__pyx_v__dict);
8020   __Pyx_XGIVEREF(__pyx_r);
8021   __Pyx_RefNannyFinishContext();
8022   return __pyx_r;
8023 }
8024 
8025 /* "(tree fragment)":16
8026  *     else:
8027  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8028  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8029  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
8030  */
8031 
8032 /* Python wrapper */
8033 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)8034 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8035   PyObject *__pyx_r = 0;
8036   __Pyx_RefNannyDeclarations
8037   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8038   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8039 
8040   /* function exit code */
8041   __Pyx_RefNannyFinishContext();
8042   return __pyx_r;
8043 }
8044 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)8045 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8046   PyObject *__pyx_r = NULL;
8047   __Pyx_RefNannyDeclarations
8048   PyObject *__pyx_t_1 = NULL;
8049   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8050 
8051   /* "(tree fragment)":17
8052  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8053  * def __setstate_cython__(self, __pyx_state):
8054  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
8055  */
8056   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(1, 17, __pyx_L1_error)
8057   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8058   __Pyx_GOTREF(__pyx_t_1);
8059   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8060 
8061   /* "(tree fragment)":16
8062  *     else:
8063  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8064  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8065  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
8066  */
8067 
8068   /* function exit code */
8069   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8070   goto __pyx_L0;
8071   __pyx_L1_error:;
8072   __Pyx_XDECREF(__pyx_t_1);
8073   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8074   __pyx_r = NULL;
8075   __pyx_L0:;
8076   __Pyx_XGIVEREF(__pyx_r);
8077   __Pyx_RefNannyFinishContext();
8078   return __pyx_r;
8079 }
8080 
8081 /* "View.MemoryView":298
8082  *
8083  * @cname('__pyx_align_pointer')
8084  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
8085  *     "Align pointer memory on a given boundary"
8086  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8087  */
8088 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)8089 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
8090   Py_intptr_t __pyx_v_aligned_p;
8091   size_t __pyx_v_offset;
8092   void *__pyx_r;
8093   int __pyx_t_1;
8094 
8095   /* "View.MemoryView":300
8096  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
8097  *     "Align pointer memory on a given boundary"
8098  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
8099  *     cdef size_t offset
8100  *
8101  */
8102   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8103 
8104   /* "View.MemoryView":304
8105  *
8106  *     with cython.cdivision(True):
8107  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
8108  *
8109  *     if offset > 0:
8110  */
8111   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8112 
8113   /* "View.MemoryView":306
8114  *         offset = aligned_p % alignment
8115  *
8116  *     if offset > 0:             # <<<<<<<<<<<<<<
8117  *         aligned_p += alignment - offset
8118  *
8119  */
8120   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8121   if (__pyx_t_1) {
8122 
8123     /* "View.MemoryView":307
8124  *
8125  *     if offset > 0:
8126  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
8127  *
8128  *     return <void *> aligned_p
8129  */
8130     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8131 
8132     /* "View.MemoryView":306
8133  *         offset = aligned_p % alignment
8134  *
8135  *     if offset > 0:             # <<<<<<<<<<<<<<
8136  *         aligned_p += alignment - offset
8137  *
8138  */
8139   }
8140 
8141   /* "View.MemoryView":309
8142  *         aligned_p += alignment - offset
8143  *
8144  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
8145  *
8146  *
8147  */
8148   __pyx_r = ((void *)__pyx_v_aligned_p);
8149   goto __pyx_L0;
8150 
8151   /* "View.MemoryView":298
8152  *
8153  * @cname('__pyx_align_pointer')
8154  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
8155  *     "Align pointer memory on a given boundary"
8156  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8157  */
8158 
8159   /* function exit code */
8160   __pyx_L0:;
8161   return __pyx_r;
8162 }
8163 
8164 /* "View.MemoryView":345
8165  *     cdef __Pyx_TypeInfo *typeinfo
8166  *
8167  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
8168  *         self.obj = obj
8169  *         self.flags = flags
8170  */
8171 
8172 /* Python wrapper */
8173 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)8174 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8175   PyObject *__pyx_v_obj = 0;
8176   int __pyx_v_flags;
8177   int __pyx_v_dtype_is_object;
8178   int __pyx_r;
8179   __Pyx_RefNannyDeclarations
8180   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8181   {
8182     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8183     PyObject* values[3] = {0,0,0};
8184     if (unlikely(__pyx_kwds)) {
8185       Py_ssize_t kw_args;
8186       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8187       switch (pos_args) {
8188         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8189         CYTHON_FALLTHROUGH;
8190         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8191         CYTHON_FALLTHROUGH;
8192         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8193         CYTHON_FALLTHROUGH;
8194         case  0: break;
8195         default: goto __pyx_L5_argtuple_error;
8196       }
8197       kw_args = PyDict_Size(__pyx_kwds);
8198       switch (pos_args) {
8199         case  0:
8200         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8201         else goto __pyx_L5_argtuple_error;
8202         CYTHON_FALLTHROUGH;
8203         case  1:
8204         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8205         else {
8206           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
8207         }
8208         CYTHON_FALLTHROUGH;
8209         case  2:
8210         if (kw_args > 0) {
8211           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8212           if (value) { values[2] = value; kw_args--; }
8213         }
8214       }
8215       if (unlikely(kw_args > 0)) {
8216         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
8217       }
8218     } else {
8219       switch (PyTuple_GET_SIZE(__pyx_args)) {
8220         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8221         CYTHON_FALLTHROUGH;
8222         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8223         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8224         break;
8225         default: goto __pyx_L5_argtuple_error;
8226       }
8227     }
8228     __pyx_v_obj = values[0];
8229     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
8230     if (values[2]) {
8231       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
8232     } else {
8233       __pyx_v_dtype_is_object = ((int)0);
8234     }
8235   }
8236   goto __pyx_L4_argument_unpacking_done;
8237   __pyx_L5_argtuple_error:;
8238   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
8239   __pyx_L3_error:;
8240   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8241   __Pyx_RefNannyFinishContext();
8242   return -1;
8243   __pyx_L4_argument_unpacking_done:;
8244   __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);
8245 
8246   /* function exit code */
8247   __Pyx_RefNannyFinishContext();
8248   return __pyx_r;
8249 }
8250 
__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)8251 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) {
8252   int __pyx_r;
8253   __Pyx_RefNannyDeclarations
8254   int __pyx_t_1;
8255   int __pyx_t_2;
8256   int __pyx_t_3;
8257   int __pyx_t_4;
8258   __Pyx_RefNannySetupContext("__cinit__", 0);
8259 
8260   /* "View.MemoryView":346
8261  *
8262  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8263  *         self.obj = obj             # <<<<<<<<<<<<<<
8264  *         self.flags = flags
8265  *         if type(self) is memoryview or obj is not None:
8266  */
8267   __Pyx_INCREF(__pyx_v_obj);
8268   __Pyx_GIVEREF(__pyx_v_obj);
8269   __Pyx_GOTREF(__pyx_v_self->obj);
8270   __Pyx_DECREF(__pyx_v_self->obj);
8271   __pyx_v_self->obj = __pyx_v_obj;
8272 
8273   /* "View.MemoryView":347
8274  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8275  *         self.obj = obj
8276  *         self.flags = flags             # <<<<<<<<<<<<<<
8277  *         if type(self) is memoryview or obj is not None:
8278  *             __Pyx_GetBuffer(obj, &self.view, flags)
8279  */
8280   __pyx_v_self->flags = __pyx_v_flags;
8281 
8282   /* "View.MemoryView":348
8283  *         self.obj = obj
8284  *         self.flags = flags
8285  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
8286  *             __Pyx_GetBuffer(obj, &self.view, flags)
8287  *             if <PyObject *> self.view.obj == NULL:
8288  */
8289   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8290   __pyx_t_3 = (__pyx_t_2 != 0);
8291   if (!__pyx_t_3) {
8292   } else {
8293     __pyx_t_1 = __pyx_t_3;
8294     goto __pyx_L4_bool_binop_done;
8295   }
8296   __pyx_t_3 = (__pyx_v_obj != Py_None);
8297   __pyx_t_2 = (__pyx_t_3 != 0);
8298   __pyx_t_1 = __pyx_t_2;
8299   __pyx_L4_bool_binop_done:;
8300   if (__pyx_t_1) {
8301 
8302     /* "View.MemoryView":349
8303  *         self.flags = flags
8304  *         if type(self) is memoryview or obj is not None:
8305  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
8306  *             if <PyObject *> self.view.obj == NULL:
8307  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8308  */
8309     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
8310 
8311     /* "View.MemoryView":350
8312  *         if type(self) is memoryview or obj is not None:
8313  *             __Pyx_GetBuffer(obj, &self.view, flags)
8314  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
8315  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8316  *                 Py_INCREF(Py_None)
8317  */
8318     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8319     if (__pyx_t_1) {
8320 
8321       /* "View.MemoryView":351
8322  *             __Pyx_GetBuffer(obj, &self.view, flags)
8323  *             if <PyObject *> self.view.obj == NULL:
8324  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
8325  *                 Py_INCREF(Py_None)
8326  *
8327  */
8328       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8329 
8330       /* "View.MemoryView":352
8331  *             if <PyObject *> self.view.obj == NULL:
8332  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8333  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
8334  *
8335  *         global __pyx_memoryview_thread_locks_used
8336  */
8337       Py_INCREF(Py_None);
8338 
8339       /* "View.MemoryView":350
8340  *         if type(self) is memoryview or obj is not None:
8341  *             __Pyx_GetBuffer(obj, &self.view, flags)
8342  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
8343  *                 (<__pyx_buffer *> &self.view).obj = Py_None
8344  *                 Py_INCREF(Py_None)
8345  */
8346     }
8347 
8348     /* "View.MemoryView":348
8349  *         self.obj = obj
8350  *         self.flags = flags
8351  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
8352  *             __Pyx_GetBuffer(obj, &self.view, flags)
8353  *             if <PyObject *> self.view.obj == NULL:
8354  */
8355   }
8356 
8357   /* "View.MemoryView":355
8358  *
8359  *         global __pyx_memoryview_thread_locks_used
8360  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
8361  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8362  *             __pyx_memoryview_thread_locks_used += 1
8363  */
8364   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8365   if (__pyx_t_1) {
8366 
8367     /* "View.MemoryView":356
8368  *         global __pyx_memoryview_thread_locks_used
8369  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8370  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
8371  *             __pyx_memoryview_thread_locks_used += 1
8372  *         if self.lock is NULL:
8373  */
8374     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8375 
8376     /* "View.MemoryView":357
8377  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8378  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8379  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
8380  *         if self.lock is NULL:
8381  *             self.lock = PyThread_allocate_lock()
8382  */
8383     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8384 
8385     /* "View.MemoryView":355
8386  *
8387  *         global __pyx_memoryview_thread_locks_used
8388  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
8389  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8390  *             __pyx_memoryview_thread_locks_used += 1
8391  */
8392   }
8393 
8394   /* "View.MemoryView":358
8395  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8396  *             __pyx_memoryview_thread_locks_used += 1
8397  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
8398  *             self.lock = PyThread_allocate_lock()
8399  *             if self.lock is NULL:
8400  */
8401   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8402   if (__pyx_t_1) {
8403 
8404     /* "View.MemoryView":359
8405  *             __pyx_memoryview_thread_locks_used += 1
8406  *         if self.lock is NULL:
8407  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
8408  *             if self.lock is NULL:
8409  *                 raise MemoryError
8410  */
8411     __pyx_v_self->lock = PyThread_allocate_lock();
8412 
8413     /* "View.MemoryView":360
8414  *         if self.lock is NULL:
8415  *             self.lock = PyThread_allocate_lock()
8416  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
8417  *                 raise MemoryError
8418  *
8419  */
8420     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8421     if (unlikely(__pyx_t_1)) {
8422 
8423       /* "View.MemoryView":361
8424  *             self.lock = PyThread_allocate_lock()
8425  *             if self.lock is NULL:
8426  *                 raise MemoryError             # <<<<<<<<<<<<<<
8427  *
8428  *         if flags & PyBUF_FORMAT:
8429  */
8430       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
8431 
8432       /* "View.MemoryView":360
8433  *         if self.lock is NULL:
8434  *             self.lock = PyThread_allocate_lock()
8435  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
8436  *                 raise MemoryError
8437  *
8438  */
8439     }
8440 
8441     /* "View.MemoryView":358
8442  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8443  *             __pyx_memoryview_thread_locks_used += 1
8444  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
8445  *             self.lock = PyThread_allocate_lock()
8446  *             if self.lock is NULL:
8447  */
8448   }
8449 
8450   /* "View.MemoryView":363
8451  *                 raise MemoryError
8452  *
8453  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8454  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8455  *         else:
8456  */
8457   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8458   if (__pyx_t_1) {
8459 
8460     /* "View.MemoryView":364
8461  *
8462  *         if flags & PyBUF_FORMAT:
8463  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
8464  *         else:
8465  *             self.dtype_is_object = dtype_is_object
8466  */
8467     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
8468     if (__pyx_t_2) {
8469     } else {
8470       __pyx_t_1 = __pyx_t_2;
8471       goto __pyx_L11_bool_binop_done;
8472     }
8473     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
8474     __pyx_t_1 = __pyx_t_2;
8475     __pyx_L11_bool_binop_done:;
8476     __pyx_v_self->dtype_is_object = __pyx_t_1;
8477 
8478     /* "View.MemoryView":363
8479  *                 raise MemoryError
8480  *
8481  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8482  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8483  *         else:
8484  */
8485     goto __pyx_L10;
8486   }
8487 
8488   /* "View.MemoryView":366
8489  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8490  *         else:
8491  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
8492  *
8493  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8494  */
8495   /*else*/ {
8496     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8497   }
8498   __pyx_L10:;
8499 
8500   /* "View.MemoryView":368
8501  *             self.dtype_is_object = dtype_is_object
8502  *
8503  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
8504  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
8505  *         self.typeinfo = NULL
8506  */
8507   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
8508 
8509   /* "View.MemoryView":370
8510  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8511  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
8512  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
8513  *
8514  *     def __dealloc__(memoryview self):
8515  */
8516   __pyx_v_self->typeinfo = NULL;
8517 
8518   /* "View.MemoryView":345
8519  *     cdef __Pyx_TypeInfo *typeinfo
8520  *
8521  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
8522  *         self.obj = obj
8523  *         self.flags = flags
8524  */
8525 
8526   /* function exit code */
8527   __pyx_r = 0;
8528   goto __pyx_L0;
8529   __pyx_L1_error:;
8530   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8531   __pyx_r = -1;
8532   __pyx_L0:;
8533   __Pyx_RefNannyFinishContext();
8534   return __pyx_r;
8535 }
8536 
8537 /* "View.MemoryView":372
8538  *         self.typeinfo = NULL
8539  *
8540  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
8541  *         if self.obj is not None:
8542  *             __Pyx_ReleaseBuffer(&self.view)
8543  */
8544 
8545 /* Python wrapper */
8546 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)8547 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8548   __Pyx_RefNannyDeclarations
8549   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8550   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8551 
8552   /* function exit code */
8553   __Pyx_RefNannyFinishContext();
8554 }
8555 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)8556 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8557   int __pyx_v_i;
8558   __Pyx_RefNannyDeclarations
8559   int __pyx_t_1;
8560   int __pyx_t_2;
8561   int __pyx_t_3;
8562   int __pyx_t_4;
8563   int __pyx_t_5;
8564   PyThread_type_lock __pyx_t_6;
8565   PyThread_type_lock __pyx_t_7;
8566   __Pyx_RefNannySetupContext("__dealloc__", 0);
8567 
8568   /* "View.MemoryView":373
8569  *
8570  *     def __dealloc__(memoryview self):
8571  *         if self.obj is not None:             # <<<<<<<<<<<<<<
8572  *             __Pyx_ReleaseBuffer(&self.view)
8573  *
8574  */
8575   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8576   __pyx_t_2 = (__pyx_t_1 != 0);
8577   if (__pyx_t_2) {
8578 
8579     /* "View.MemoryView":374
8580  *     def __dealloc__(memoryview self):
8581  *         if self.obj is not None:
8582  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
8583  *
8584  *         cdef int i
8585  */
8586     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8587 
8588     /* "View.MemoryView":373
8589  *
8590  *     def __dealloc__(memoryview self):
8591  *         if self.obj is not None:             # <<<<<<<<<<<<<<
8592  *             __Pyx_ReleaseBuffer(&self.view)
8593  *
8594  */
8595   }
8596 
8597   /* "View.MemoryView":378
8598  *         cdef int i
8599  *         global __pyx_memoryview_thread_locks_used
8600  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
8601  *             for i in range(__pyx_memoryview_thread_locks_used):
8602  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8603  */
8604   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
8605   if (__pyx_t_2) {
8606 
8607     /* "View.MemoryView":379
8608  *         global __pyx_memoryview_thread_locks_used
8609  *         if self.lock != NULL:
8610  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
8611  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8612  *                     __pyx_memoryview_thread_locks_used -= 1
8613  */
8614     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
8615     __pyx_t_4 = __pyx_t_3;
8616     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
8617       __pyx_v_i = __pyx_t_5;
8618 
8619       /* "View.MemoryView":380
8620  *         if self.lock != NULL:
8621  *             for i in range(__pyx_memoryview_thread_locks_used):
8622  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
8623  *                     __pyx_memoryview_thread_locks_used -= 1
8624  *                     if i != __pyx_memoryview_thread_locks_used:
8625  */
8626       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
8627       if (__pyx_t_2) {
8628 
8629         /* "View.MemoryView":381
8630  *             for i in range(__pyx_memoryview_thread_locks_used):
8631  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8632  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
8633  *                     if i != __pyx_memoryview_thread_locks_used:
8634  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8635  */
8636         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8637 
8638         /* "View.MemoryView":382
8639  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8640  *                     __pyx_memoryview_thread_locks_used -= 1
8641  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
8642  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8643  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8644  */
8645         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
8646         if (__pyx_t_2) {
8647 
8648           /* "View.MemoryView":384
8649  *                     if i != __pyx_memoryview_thread_locks_used:
8650  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8651  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
8652  *                     break
8653  *             else:
8654  */
8655           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8656           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8657 
8658           /* "View.MemoryView":383
8659  *                     __pyx_memoryview_thread_locks_used -= 1
8660  *                     if i != __pyx_memoryview_thread_locks_used:
8661  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
8662  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8663  *                     break
8664  */
8665           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
8666           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
8667 
8668           /* "View.MemoryView":382
8669  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8670  *                     __pyx_memoryview_thread_locks_used -= 1
8671  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
8672  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8673  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8674  */
8675         }
8676 
8677         /* "View.MemoryView":385
8678  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8679  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8680  *                     break             # <<<<<<<<<<<<<<
8681  *             else:
8682  *                 PyThread_free_lock(self.lock)
8683  */
8684         goto __pyx_L6_break;
8685 
8686         /* "View.MemoryView":380
8687  *         if self.lock != NULL:
8688  *             for i in range(__pyx_memoryview_thread_locks_used):
8689  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
8690  *                     __pyx_memoryview_thread_locks_used -= 1
8691  *                     if i != __pyx_memoryview_thread_locks_used:
8692  */
8693       }
8694     }
8695     /*else*/ {
8696 
8697       /* "View.MemoryView":387
8698  *                     break
8699  *             else:
8700  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
8701  *
8702  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
8703  */
8704       PyThread_free_lock(__pyx_v_self->lock);
8705     }
8706     __pyx_L6_break:;
8707 
8708     /* "View.MemoryView":378
8709  *         cdef int i
8710  *         global __pyx_memoryview_thread_locks_used
8711  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
8712  *             for i in range(__pyx_memoryview_thread_locks_used):
8713  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
8714  */
8715   }
8716 
8717   /* "View.MemoryView":372
8718  *         self.typeinfo = NULL
8719  *
8720  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
8721  *         if self.obj is not None:
8722  *             __Pyx_ReleaseBuffer(&self.view)
8723  */
8724 
8725   /* function exit code */
8726   __Pyx_RefNannyFinishContext();
8727 }
8728 
8729 /* "View.MemoryView":389
8730  *                 PyThread_free_lock(self.lock)
8731  *
8732  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
8733  *         cdef Py_ssize_t dim
8734  *         cdef char *itemp = <char *> self.view.buf
8735  */
8736 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)8737 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8738   Py_ssize_t __pyx_v_dim;
8739   char *__pyx_v_itemp;
8740   PyObject *__pyx_v_idx = NULL;
8741   char *__pyx_r;
8742   __Pyx_RefNannyDeclarations
8743   Py_ssize_t __pyx_t_1;
8744   PyObject *__pyx_t_2 = NULL;
8745   Py_ssize_t __pyx_t_3;
8746   PyObject *(*__pyx_t_4)(PyObject *);
8747   PyObject *__pyx_t_5 = NULL;
8748   Py_ssize_t __pyx_t_6;
8749   char *__pyx_t_7;
8750   __Pyx_RefNannySetupContext("get_item_pointer", 0);
8751 
8752   /* "View.MemoryView":391
8753  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
8754  *         cdef Py_ssize_t dim
8755  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
8756  *
8757  *         for dim, idx in enumerate(index):
8758  */
8759   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8760 
8761   /* "View.MemoryView":393
8762  *         cdef char *itemp = <char *> self.view.buf
8763  *
8764  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
8765  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
8766  *
8767  */
8768   __pyx_t_1 = 0;
8769   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8770     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
8771     __pyx_t_4 = NULL;
8772   } else {
8773     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
8774     __Pyx_GOTREF(__pyx_t_2);
8775     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
8776   }
8777   for (;;) {
8778     if (likely(!__pyx_t_4)) {
8779       if (likely(PyList_CheckExact(__pyx_t_2))) {
8780         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
8781         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8782         __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(1, 393, __pyx_L1_error)
8783         #else
8784         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
8785         __Pyx_GOTREF(__pyx_t_5);
8786         #endif
8787       } else {
8788         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
8789         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8790         __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(1, 393, __pyx_L1_error)
8791         #else
8792         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
8793         __Pyx_GOTREF(__pyx_t_5);
8794         #endif
8795       }
8796     } else {
8797       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8798       if (unlikely(!__pyx_t_5)) {
8799         PyObject* exc_type = PyErr_Occurred();
8800         if (exc_type) {
8801           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8802           else __PYX_ERR(1, 393, __pyx_L1_error)
8803         }
8804         break;
8805       }
8806       __Pyx_GOTREF(__pyx_t_5);
8807     }
8808     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8809     __pyx_t_5 = 0;
8810     __pyx_v_dim = __pyx_t_1;
8811     __pyx_t_1 = (__pyx_t_1 + 1);
8812 
8813     /* "View.MemoryView":394
8814  *
8815  *         for dim, idx in enumerate(index):
8816  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
8817  *
8818  *         return itemp
8819  */
8820     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
8821     __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(1, 394, __pyx_L1_error)
8822     __pyx_v_itemp = __pyx_t_7;
8823 
8824     /* "View.MemoryView":393
8825  *         cdef char *itemp = <char *> self.view.buf
8826  *
8827  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
8828  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
8829  *
8830  */
8831   }
8832   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8833 
8834   /* "View.MemoryView":396
8835  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
8836  *
8837  *         return itemp             # <<<<<<<<<<<<<<
8838  *
8839  *
8840  */
8841   __pyx_r = __pyx_v_itemp;
8842   goto __pyx_L0;
8843 
8844   /* "View.MemoryView":389
8845  *                 PyThread_free_lock(self.lock)
8846  *
8847  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
8848  *         cdef Py_ssize_t dim
8849  *         cdef char *itemp = <char *> self.view.buf
8850  */
8851 
8852   /* function exit code */
8853   __pyx_L1_error:;
8854   __Pyx_XDECREF(__pyx_t_2);
8855   __Pyx_XDECREF(__pyx_t_5);
8856   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8857   __pyx_r = NULL;
8858   __pyx_L0:;
8859   __Pyx_XDECREF(__pyx_v_idx);
8860   __Pyx_RefNannyFinishContext();
8861   return __pyx_r;
8862 }
8863 
8864 /* "View.MemoryView":399
8865  *
8866  *
8867  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
8868  *         if index is Ellipsis:
8869  *             return self
8870  */
8871 
8872 /* Python wrapper */
8873 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)8874 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8875   PyObject *__pyx_r = 0;
8876   __Pyx_RefNannyDeclarations
8877   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8878   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8879 
8880   /* function exit code */
8881   __Pyx_RefNannyFinishContext();
8882   return __pyx_r;
8883 }
8884 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)8885 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8886   PyObject *__pyx_v_have_slices = NULL;
8887   PyObject *__pyx_v_indices = NULL;
8888   char *__pyx_v_itemp;
8889   PyObject *__pyx_r = NULL;
8890   __Pyx_RefNannyDeclarations
8891   int __pyx_t_1;
8892   int __pyx_t_2;
8893   PyObject *__pyx_t_3 = NULL;
8894   PyObject *__pyx_t_4 = NULL;
8895   PyObject *__pyx_t_5 = NULL;
8896   char *__pyx_t_6;
8897   __Pyx_RefNannySetupContext("__getitem__", 0);
8898 
8899   /* "View.MemoryView":400
8900  *
8901  *     def __getitem__(memoryview self, object index):
8902  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
8903  *             return self
8904  *
8905  */
8906   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8907   __pyx_t_2 = (__pyx_t_1 != 0);
8908   if (__pyx_t_2) {
8909 
8910     /* "View.MemoryView":401
8911  *     def __getitem__(memoryview self, object index):
8912  *         if index is Ellipsis:
8913  *             return self             # <<<<<<<<<<<<<<
8914  *
8915  *         have_slices, indices = _unellipsify(index, self.view.ndim)
8916  */
8917     __Pyx_XDECREF(__pyx_r);
8918     __Pyx_INCREF(((PyObject *)__pyx_v_self));
8919     __pyx_r = ((PyObject *)__pyx_v_self);
8920     goto __pyx_L0;
8921 
8922     /* "View.MemoryView":400
8923  *
8924  *     def __getitem__(memoryview self, object index):
8925  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
8926  *             return self
8927  *
8928  */
8929   }
8930 
8931   /* "View.MemoryView":403
8932  *             return self
8933  *
8934  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
8935  *
8936  *         cdef char *itemp
8937  */
8938   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
8939   __Pyx_GOTREF(__pyx_t_3);
8940   if (likely(__pyx_t_3 != Py_None)) {
8941     PyObject* sequence = __pyx_t_3;
8942     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8943     if (unlikely(size != 2)) {
8944       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8945       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8946       __PYX_ERR(1, 403, __pyx_L1_error)
8947     }
8948     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8949     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8950     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8951     __Pyx_INCREF(__pyx_t_4);
8952     __Pyx_INCREF(__pyx_t_5);
8953     #else
8954     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
8955     __Pyx_GOTREF(__pyx_t_4);
8956     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
8957     __Pyx_GOTREF(__pyx_t_5);
8958     #endif
8959     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8960   } else {
8961     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
8962   }
8963   __pyx_v_have_slices = __pyx_t_4;
8964   __pyx_t_4 = 0;
8965   __pyx_v_indices = __pyx_t_5;
8966   __pyx_t_5 = 0;
8967 
8968   /* "View.MemoryView":406
8969  *
8970  *         cdef char *itemp
8971  *         if have_slices:             # <<<<<<<<<<<<<<
8972  *             return memview_slice(self, indices)
8973  *         else:
8974  */
8975   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
8976   if (__pyx_t_2) {
8977 
8978     /* "View.MemoryView":407
8979  *         cdef char *itemp
8980  *         if have_slices:
8981  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
8982  *         else:
8983  *             itemp = self.get_item_pointer(indices)
8984  */
8985     __Pyx_XDECREF(__pyx_r);
8986     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
8987     __Pyx_GOTREF(__pyx_t_3);
8988     __pyx_r = __pyx_t_3;
8989     __pyx_t_3 = 0;
8990     goto __pyx_L0;
8991 
8992     /* "View.MemoryView":406
8993  *
8994  *         cdef char *itemp
8995  *         if have_slices:             # <<<<<<<<<<<<<<
8996  *             return memview_slice(self, indices)
8997  *         else:
8998  */
8999   }
9000 
9001   /* "View.MemoryView":409
9002  *             return memview_slice(self, indices)
9003  *         else:
9004  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
9005  *             return self.convert_item_to_object(itemp)
9006  *
9007  */
9008   /*else*/ {
9009     __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(1, 409, __pyx_L1_error)
9010     __pyx_v_itemp = __pyx_t_6;
9011 
9012     /* "View.MemoryView":410
9013  *         else:
9014  *             itemp = self.get_item_pointer(indices)
9015  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
9016  *
9017  *     def __setitem__(memoryview self, object index, object value):
9018  */
9019     __Pyx_XDECREF(__pyx_r);
9020     __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(1, 410, __pyx_L1_error)
9021     __Pyx_GOTREF(__pyx_t_3);
9022     __pyx_r = __pyx_t_3;
9023     __pyx_t_3 = 0;
9024     goto __pyx_L0;
9025   }
9026 
9027   /* "View.MemoryView":399
9028  *
9029  *
9030  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
9031  *         if index is Ellipsis:
9032  *             return self
9033  */
9034 
9035   /* function exit code */
9036   __pyx_L1_error:;
9037   __Pyx_XDECREF(__pyx_t_3);
9038   __Pyx_XDECREF(__pyx_t_4);
9039   __Pyx_XDECREF(__pyx_t_5);
9040   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9041   __pyx_r = NULL;
9042   __pyx_L0:;
9043   __Pyx_XDECREF(__pyx_v_have_slices);
9044   __Pyx_XDECREF(__pyx_v_indices);
9045   __Pyx_XGIVEREF(__pyx_r);
9046   __Pyx_RefNannyFinishContext();
9047   return __pyx_r;
9048 }
9049 
9050 /* "View.MemoryView":412
9051  *             return self.convert_item_to_object(itemp)
9052  *
9053  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
9054  *         if self.view.readonly:
9055  *             raise TypeError("Cannot assign to read-only memoryview")
9056  */
9057 
9058 /* Python wrapper */
9059 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)9060 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9061   int __pyx_r;
9062   __Pyx_RefNannyDeclarations
9063   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9064   __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));
9065 
9066   /* function exit code */
9067   __Pyx_RefNannyFinishContext();
9068   return __pyx_r;
9069 }
9070 
__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)9071 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) {
9072   PyObject *__pyx_v_have_slices = NULL;
9073   PyObject *__pyx_v_obj = NULL;
9074   int __pyx_r;
9075   __Pyx_RefNannyDeclarations
9076   int __pyx_t_1;
9077   PyObject *__pyx_t_2 = NULL;
9078   PyObject *__pyx_t_3 = NULL;
9079   PyObject *__pyx_t_4 = NULL;
9080   __Pyx_RefNannySetupContext("__setitem__", 0);
9081   __Pyx_INCREF(__pyx_v_index);
9082 
9083   /* "View.MemoryView":413
9084  *
9085  *     def __setitem__(memoryview self, object index, object value):
9086  *         if self.view.readonly:             # <<<<<<<<<<<<<<
9087  *             raise TypeError("Cannot assign to read-only memoryview")
9088  *
9089  */
9090   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9091   if (unlikely(__pyx_t_1)) {
9092 
9093     /* "View.MemoryView":414
9094  *     def __setitem__(memoryview self, object index, object value):
9095  *         if self.view.readonly:
9096  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
9097  *
9098  *         have_slices, index = _unellipsify(index, self.view.ndim)
9099  */
9100     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
9101     __Pyx_GOTREF(__pyx_t_2);
9102     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9103     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9104     __PYX_ERR(1, 414, __pyx_L1_error)
9105 
9106     /* "View.MemoryView":413
9107  *
9108  *     def __setitem__(memoryview self, object index, object value):
9109  *         if self.view.readonly:             # <<<<<<<<<<<<<<
9110  *             raise TypeError("Cannot assign to read-only memoryview")
9111  *
9112  */
9113   }
9114 
9115   /* "View.MemoryView":416
9116  *             raise TypeError("Cannot assign to read-only memoryview")
9117  *
9118  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
9119  *
9120  *         if have_slices:
9121  */
9122   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
9123   __Pyx_GOTREF(__pyx_t_2);
9124   if (likely(__pyx_t_2 != Py_None)) {
9125     PyObject* sequence = __pyx_t_2;
9126     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9127     if (unlikely(size != 2)) {
9128       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9129       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9130       __PYX_ERR(1, 416, __pyx_L1_error)
9131     }
9132     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9133     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9134     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9135     __Pyx_INCREF(__pyx_t_3);
9136     __Pyx_INCREF(__pyx_t_4);
9137     #else
9138     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
9139     __Pyx_GOTREF(__pyx_t_3);
9140     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
9141     __Pyx_GOTREF(__pyx_t_4);
9142     #endif
9143     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9144   } else {
9145     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
9146   }
9147   __pyx_v_have_slices = __pyx_t_3;
9148   __pyx_t_3 = 0;
9149   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9150   __pyx_t_4 = 0;
9151 
9152   /* "View.MemoryView":418
9153  *         have_slices, index = _unellipsify(index, self.view.ndim)
9154  *
9155  *         if have_slices:             # <<<<<<<<<<<<<<
9156  *             obj = self.is_slice(value)
9157  *             if obj:
9158  */
9159   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
9160   if (__pyx_t_1) {
9161 
9162     /* "View.MemoryView":419
9163  *
9164  *         if have_slices:
9165  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
9166  *             if obj:
9167  *                 self.setitem_slice_assignment(self[index], obj)
9168  */
9169     __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(1, 419, __pyx_L1_error)
9170     __Pyx_GOTREF(__pyx_t_2);
9171     __pyx_v_obj = __pyx_t_2;
9172     __pyx_t_2 = 0;
9173 
9174     /* "View.MemoryView":420
9175  *         if have_slices:
9176  *             obj = self.is_slice(value)
9177  *             if obj:             # <<<<<<<<<<<<<<
9178  *                 self.setitem_slice_assignment(self[index], obj)
9179  *             else:
9180  */
9181     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
9182     if (__pyx_t_1) {
9183 
9184       /* "View.MemoryView":421
9185  *             obj = self.is_slice(value)
9186  *             if obj:
9187  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
9188  *             else:
9189  *                 self.setitem_slice_assign_scalar(self[index], value)
9190  */
9191       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
9192       __Pyx_GOTREF(__pyx_t_2);
9193       __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(1, 421, __pyx_L1_error)
9194       __Pyx_GOTREF(__pyx_t_4);
9195       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9196       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9197 
9198       /* "View.MemoryView":420
9199  *         if have_slices:
9200  *             obj = self.is_slice(value)
9201  *             if obj:             # <<<<<<<<<<<<<<
9202  *                 self.setitem_slice_assignment(self[index], obj)
9203  *             else:
9204  */
9205       goto __pyx_L5;
9206     }
9207 
9208     /* "View.MemoryView":423
9209  *                 self.setitem_slice_assignment(self[index], obj)
9210  *             else:
9211  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
9212  *         else:
9213  *             self.setitem_indexed(index, value)
9214  */
9215     /*else*/ {
9216       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
9217       __Pyx_GOTREF(__pyx_t_4);
9218       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
9219       __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(1, 423, __pyx_L1_error)
9220       __Pyx_GOTREF(__pyx_t_2);
9221       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9222       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9223     }
9224     __pyx_L5:;
9225 
9226     /* "View.MemoryView":418
9227  *         have_slices, index = _unellipsify(index, self.view.ndim)
9228  *
9229  *         if have_slices:             # <<<<<<<<<<<<<<
9230  *             obj = self.is_slice(value)
9231  *             if obj:
9232  */
9233     goto __pyx_L4;
9234   }
9235 
9236   /* "View.MemoryView":425
9237  *                 self.setitem_slice_assign_scalar(self[index], value)
9238  *         else:
9239  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
9240  *
9241  *     cdef is_slice(self, obj):
9242  */
9243   /*else*/ {
9244     __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(1, 425, __pyx_L1_error)
9245     __Pyx_GOTREF(__pyx_t_2);
9246     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9247   }
9248   __pyx_L4:;
9249 
9250   /* "View.MemoryView":412
9251  *             return self.convert_item_to_object(itemp)
9252  *
9253  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
9254  *         if self.view.readonly:
9255  *             raise TypeError("Cannot assign to read-only memoryview")
9256  */
9257 
9258   /* function exit code */
9259   __pyx_r = 0;
9260   goto __pyx_L0;
9261   __pyx_L1_error:;
9262   __Pyx_XDECREF(__pyx_t_2);
9263   __Pyx_XDECREF(__pyx_t_3);
9264   __Pyx_XDECREF(__pyx_t_4);
9265   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9266   __pyx_r = -1;
9267   __pyx_L0:;
9268   __Pyx_XDECREF(__pyx_v_have_slices);
9269   __Pyx_XDECREF(__pyx_v_obj);
9270   __Pyx_XDECREF(__pyx_v_index);
9271   __Pyx_RefNannyFinishContext();
9272   return __pyx_r;
9273 }
9274 
9275 /* "View.MemoryView":427
9276  *             self.setitem_indexed(index, value)
9277  *
9278  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
9279  *         if not isinstance(obj, memoryview):
9280  *             try:
9281  */
9282 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)9283 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9284   PyObject *__pyx_r = NULL;
9285   __Pyx_RefNannyDeclarations
9286   int __pyx_t_1;
9287   int __pyx_t_2;
9288   PyObject *__pyx_t_3 = NULL;
9289   PyObject *__pyx_t_4 = NULL;
9290   PyObject *__pyx_t_5 = NULL;
9291   PyObject *__pyx_t_6 = NULL;
9292   PyObject *__pyx_t_7 = NULL;
9293   PyObject *__pyx_t_8 = NULL;
9294   int __pyx_t_9;
9295   __Pyx_RefNannySetupContext("is_slice", 0);
9296   __Pyx_INCREF(__pyx_v_obj);
9297 
9298   /* "View.MemoryView":428
9299  *
9300  *     cdef is_slice(self, obj):
9301  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
9302  *             try:
9303  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9304  */
9305   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9306   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9307   if (__pyx_t_2) {
9308 
9309     /* "View.MemoryView":429
9310  *     cdef is_slice(self, obj):
9311  *         if not isinstance(obj, memoryview):
9312  *             try:             # <<<<<<<<<<<<<<
9313  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9314  *                                  self.dtype_is_object)
9315  */
9316     {
9317       __Pyx_PyThreadState_declare
9318       __Pyx_PyThreadState_assign
9319       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9320       __Pyx_XGOTREF(__pyx_t_3);
9321       __Pyx_XGOTREF(__pyx_t_4);
9322       __Pyx_XGOTREF(__pyx_t_5);
9323       /*try:*/ {
9324 
9325         /* "View.MemoryView":430
9326  *         if not isinstance(obj, memoryview):
9327  *             try:
9328  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
9329  *                                  self.dtype_is_object)
9330  *             except TypeError:
9331  */
9332         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
9333         __Pyx_GOTREF(__pyx_t_6);
9334 
9335         /* "View.MemoryView":431
9336  *             try:
9337  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9338  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
9339  *             except TypeError:
9340  *                 return None
9341  */
9342         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
9343         __Pyx_GOTREF(__pyx_t_7);
9344 
9345         /* "View.MemoryView":430
9346  *         if not isinstance(obj, memoryview):
9347  *             try:
9348  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
9349  *                                  self.dtype_is_object)
9350  *             except TypeError:
9351  */
9352         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
9353         __Pyx_GOTREF(__pyx_t_8);
9354         __Pyx_INCREF(__pyx_v_obj);
9355         __Pyx_GIVEREF(__pyx_v_obj);
9356         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9357         __Pyx_GIVEREF(__pyx_t_6);
9358         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9359         __Pyx_GIVEREF(__pyx_t_7);
9360         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9361         __pyx_t_6 = 0;
9362         __pyx_t_7 = 0;
9363         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
9364         __Pyx_GOTREF(__pyx_t_7);
9365         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9366         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9367         __pyx_t_7 = 0;
9368 
9369         /* "View.MemoryView":429
9370  *     cdef is_slice(self, obj):
9371  *         if not isinstance(obj, memoryview):
9372  *             try:             # <<<<<<<<<<<<<<
9373  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9374  *                                  self.dtype_is_object)
9375  */
9376       }
9377       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9378       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9379       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9380       goto __pyx_L9_try_end;
9381       __pyx_L4_error:;
9382       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9383       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9384       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9385 
9386       /* "View.MemoryView":432
9387  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9388  *                                  self.dtype_is_object)
9389  *             except TypeError:             # <<<<<<<<<<<<<<
9390  *                 return None
9391  *
9392  */
9393       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9394       if (__pyx_t_9) {
9395         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9396         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
9397         __Pyx_GOTREF(__pyx_t_7);
9398         __Pyx_GOTREF(__pyx_t_8);
9399         __Pyx_GOTREF(__pyx_t_6);
9400 
9401         /* "View.MemoryView":433
9402  *                                  self.dtype_is_object)
9403  *             except TypeError:
9404  *                 return None             # <<<<<<<<<<<<<<
9405  *
9406  *         return obj
9407  */
9408         __Pyx_XDECREF(__pyx_r);
9409         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9410         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9411         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9412         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9413         goto __pyx_L7_except_return;
9414       }
9415       goto __pyx_L6_except_error;
9416       __pyx_L6_except_error:;
9417 
9418       /* "View.MemoryView":429
9419  *     cdef is_slice(self, obj):
9420  *         if not isinstance(obj, memoryview):
9421  *             try:             # <<<<<<<<<<<<<<
9422  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9423  *                                  self.dtype_is_object)
9424  */
9425       __Pyx_XGIVEREF(__pyx_t_3);
9426       __Pyx_XGIVEREF(__pyx_t_4);
9427       __Pyx_XGIVEREF(__pyx_t_5);
9428       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9429       goto __pyx_L1_error;
9430       __pyx_L7_except_return:;
9431       __Pyx_XGIVEREF(__pyx_t_3);
9432       __Pyx_XGIVEREF(__pyx_t_4);
9433       __Pyx_XGIVEREF(__pyx_t_5);
9434       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9435       goto __pyx_L0;
9436       __pyx_L9_try_end:;
9437     }
9438 
9439     /* "View.MemoryView":428
9440  *
9441  *     cdef is_slice(self, obj):
9442  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
9443  *             try:
9444  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9445  */
9446   }
9447 
9448   /* "View.MemoryView":435
9449  *                 return None
9450  *
9451  *         return obj             # <<<<<<<<<<<<<<
9452  *
9453  *     cdef setitem_slice_assignment(self, dst, src):
9454  */
9455   __Pyx_XDECREF(__pyx_r);
9456   __Pyx_INCREF(__pyx_v_obj);
9457   __pyx_r = __pyx_v_obj;
9458   goto __pyx_L0;
9459 
9460   /* "View.MemoryView":427
9461  *             self.setitem_indexed(index, value)
9462  *
9463  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
9464  *         if not isinstance(obj, memoryview):
9465  *             try:
9466  */
9467 
9468   /* function exit code */
9469   __pyx_L1_error:;
9470   __Pyx_XDECREF(__pyx_t_6);
9471   __Pyx_XDECREF(__pyx_t_7);
9472   __Pyx_XDECREF(__pyx_t_8);
9473   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9474   __pyx_r = 0;
9475   __pyx_L0:;
9476   __Pyx_XDECREF(__pyx_v_obj);
9477   __Pyx_XGIVEREF(__pyx_r);
9478   __Pyx_RefNannyFinishContext();
9479   return __pyx_r;
9480 }
9481 
9482 /* "View.MemoryView":437
9483  *         return obj
9484  *
9485  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
9486  *         cdef __Pyx_memviewslice dst_slice
9487  *         cdef __Pyx_memviewslice src_slice
9488  */
9489 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)9490 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9491   __Pyx_memviewslice __pyx_v_dst_slice;
9492   __Pyx_memviewslice __pyx_v_src_slice;
9493   PyObject *__pyx_r = NULL;
9494   __Pyx_RefNannyDeclarations
9495   PyObject *__pyx_t_1 = NULL;
9496   int __pyx_t_2;
9497   int __pyx_t_3;
9498   int __pyx_t_4;
9499   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
9500 
9501   /* "View.MemoryView":441
9502  *         cdef __Pyx_memviewslice src_slice
9503  *
9504  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
9505  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9506  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9507  */
9508   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
9509 
9510   /* "View.MemoryView":442
9511  *
9512  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
9513  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
9514  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9515  *
9516  */
9517   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
9518 
9519   /* "View.MemoryView":443
9520  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
9521  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9522  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
9523  *
9524  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9525  */
9526   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
9527   __Pyx_GOTREF(__pyx_t_1);
9528   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
9529   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9530   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
9531   __Pyx_GOTREF(__pyx_t_1);
9532   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
9533   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9534 
9535   /* "View.MemoryView":441
9536  *         cdef __Pyx_memviewslice src_slice
9537  *
9538  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
9539  *                                  get_slice_from_memview(dst, &dst_slice)[0],
9540  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9541  */
9542   __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
9543 
9544   /* "View.MemoryView":437
9545  *         return obj
9546  *
9547  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
9548  *         cdef __Pyx_memviewslice dst_slice
9549  *         cdef __Pyx_memviewslice src_slice
9550  */
9551 
9552   /* function exit code */
9553   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9554   goto __pyx_L0;
9555   __pyx_L1_error:;
9556   __Pyx_XDECREF(__pyx_t_1);
9557   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9558   __pyx_r = 0;
9559   __pyx_L0:;
9560   __Pyx_XGIVEREF(__pyx_r);
9561   __Pyx_RefNannyFinishContext();
9562   return __pyx_r;
9563 }
9564 
9565 /* "View.MemoryView":445
9566  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9567  *
9568  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
9569  *         cdef int array[128]
9570  *         cdef void *tmp = NULL
9571  */
9572 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)9573 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) {
9574   int __pyx_v_array[0x80];
9575   void *__pyx_v_tmp;
9576   void *__pyx_v_item;
9577   __Pyx_memviewslice *__pyx_v_dst_slice;
9578   __Pyx_memviewslice __pyx_v_tmp_slice;
9579   PyObject *__pyx_r = NULL;
9580   __Pyx_RefNannyDeclarations
9581   int __pyx_t_1;
9582   PyObject *__pyx_t_2 = NULL;
9583   int __pyx_t_3;
9584   int __pyx_t_4;
9585   char const *__pyx_t_5;
9586   PyObject *__pyx_t_6 = NULL;
9587   PyObject *__pyx_t_7 = NULL;
9588   PyObject *__pyx_t_8 = NULL;
9589   PyObject *__pyx_t_9 = NULL;
9590   PyObject *__pyx_t_10 = NULL;
9591   PyObject *__pyx_t_11 = NULL;
9592   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
9593 
9594   /* "View.MemoryView":447
9595  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9596  *         cdef int array[128]
9597  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
9598  *         cdef void *item
9599  *
9600  */
9601   __pyx_v_tmp = NULL;
9602 
9603   /* "View.MemoryView":452
9604  *         cdef __Pyx_memviewslice *dst_slice
9605  *         cdef __Pyx_memviewslice tmp_slice
9606  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
9607  *
9608  *         if <size_t>self.view.itemsize > sizeof(array):
9609  */
9610   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
9611 
9612   /* "View.MemoryView":454
9613  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
9614  *
9615  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
9616  *             tmp = PyMem_Malloc(self.view.itemsize)
9617  *             if tmp == NULL:
9618  */
9619   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
9620   if (__pyx_t_1) {
9621 
9622     /* "View.MemoryView":455
9623  *
9624  *         if <size_t>self.view.itemsize > sizeof(array):
9625  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
9626  *             if tmp == NULL:
9627  *                 raise MemoryError
9628  */
9629     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9630 
9631     /* "View.MemoryView":456
9632  *         if <size_t>self.view.itemsize > sizeof(array):
9633  *             tmp = PyMem_Malloc(self.view.itemsize)
9634  *             if tmp == NULL:             # <<<<<<<<<<<<<<
9635  *                 raise MemoryError
9636  *             item = tmp
9637  */
9638     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
9639     if (unlikely(__pyx_t_1)) {
9640 
9641       /* "View.MemoryView":457
9642  *             tmp = PyMem_Malloc(self.view.itemsize)
9643  *             if tmp == NULL:
9644  *                 raise MemoryError             # <<<<<<<<<<<<<<
9645  *             item = tmp
9646  *         else:
9647  */
9648       PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
9649 
9650       /* "View.MemoryView":456
9651  *         if <size_t>self.view.itemsize > sizeof(array):
9652  *             tmp = PyMem_Malloc(self.view.itemsize)
9653  *             if tmp == NULL:             # <<<<<<<<<<<<<<
9654  *                 raise MemoryError
9655  *             item = tmp
9656  */
9657     }
9658 
9659     /* "View.MemoryView":458
9660  *             if tmp == NULL:
9661  *                 raise MemoryError
9662  *             item = tmp             # <<<<<<<<<<<<<<
9663  *         else:
9664  *             item = <void *> array
9665  */
9666     __pyx_v_item = __pyx_v_tmp;
9667 
9668     /* "View.MemoryView":454
9669  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
9670  *
9671  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
9672  *             tmp = PyMem_Malloc(self.view.itemsize)
9673  *             if tmp == NULL:
9674  */
9675     goto __pyx_L3;
9676   }
9677 
9678   /* "View.MemoryView":460
9679  *             item = tmp
9680  *         else:
9681  *             item = <void *> array             # <<<<<<<<<<<<<<
9682  *
9683  *         try:
9684  */
9685   /*else*/ {
9686     __pyx_v_item = ((void *)__pyx_v_array);
9687   }
9688   __pyx_L3:;
9689 
9690   /* "View.MemoryView":462
9691  *             item = <void *> array
9692  *
9693  *         try:             # <<<<<<<<<<<<<<
9694  *             if self.dtype_is_object:
9695  *                 (<PyObject **> item)[0] = <PyObject *> value
9696  */
9697   /*try:*/ {
9698 
9699     /* "View.MemoryView":463
9700  *
9701  *         try:
9702  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
9703  *                 (<PyObject **> item)[0] = <PyObject *> value
9704  *             else:
9705  */
9706     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9707     if (__pyx_t_1) {
9708 
9709       /* "View.MemoryView":464
9710  *         try:
9711  *             if self.dtype_is_object:
9712  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
9713  *             else:
9714  *                 self.assign_item_from_object(<char *> item, value)
9715  */
9716       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9717 
9718       /* "View.MemoryView":463
9719  *
9720  *         try:
9721  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
9722  *                 (<PyObject **> item)[0] = <PyObject *> value
9723  *             else:
9724  */
9725       goto __pyx_L8;
9726     }
9727 
9728     /* "View.MemoryView":466
9729  *                 (<PyObject **> item)[0] = <PyObject *> value
9730  *             else:
9731  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
9732  *
9733  *
9734  */
9735     /*else*/ {
9736       __pyx_t_2 = ((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_2)) __PYX_ERR(1, 466, __pyx_L6_error)
9737       __Pyx_GOTREF(__pyx_t_2);
9738       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9739     }
9740     __pyx_L8:;
9741 
9742     /* "View.MemoryView":470
9743  *
9744  *
9745  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
9746  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9747  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9748  */
9749     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
9750     if (__pyx_t_1) {
9751 
9752       /* "View.MemoryView":471
9753  *
9754  *             if self.view.suboffsets != NULL:
9755  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
9756  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9757  *                                 item, self.dtype_is_object)
9758  */
9759       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
9760       __Pyx_GOTREF(__pyx_t_2);
9761       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9762 
9763       /* "View.MemoryView":470
9764  *
9765  *
9766  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
9767  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9768  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9769  */
9770     }
9771 
9772     /* "View.MemoryView":472
9773  *             if self.view.suboffsets != NULL:
9774  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9775  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
9776  *                                 item, self.dtype_is_object)
9777  *         finally:
9778  */
9779     __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);
9780   }
9781 
9782   /* "View.MemoryView":475
9783  *                                 item, self.dtype_is_object)
9784  *         finally:
9785  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
9786  *
9787  *     cdef setitem_indexed(self, index, value):
9788  */
9789   /*finally:*/ {
9790     /*normal exit:*/{
9791       PyMem_Free(__pyx_v_tmp);
9792       goto __pyx_L7;
9793     }
9794     __pyx_L6_error:;
9795     /*exception exit:*/{
9796       __Pyx_PyThreadState_declare
9797       __Pyx_PyThreadState_assign
9798       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
9799       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9800       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
9801       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
9802       __Pyx_XGOTREF(__pyx_t_6);
9803       __Pyx_XGOTREF(__pyx_t_7);
9804       __Pyx_XGOTREF(__pyx_t_8);
9805       __Pyx_XGOTREF(__pyx_t_9);
9806       __Pyx_XGOTREF(__pyx_t_10);
9807       __Pyx_XGOTREF(__pyx_t_11);
9808       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
9809       {
9810         PyMem_Free(__pyx_v_tmp);
9811       }
9812       if (PY_MAJOR_VERSION >= 3) {
9813         __Pyx_XGIVEREF(__pyx_t_9);
9814         __Pyx_XGIVEREF(__pyx_t_10);
9815         __Pyx_XGIVEREF(__pyx_t_11);
9816         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
9817       }
9818       __Pyx_XGIVEREF(__pyx_t_6);
9819       __Pyx_XGIVEREF(__pyx_t_7);
9820       __Pyx_XGIVEREF(__pyx_t_8);
9821       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
9822       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
9823       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
9824       goto __pyx_L1_error;
9825     }
9826     __pyx_L7:;
9827   }
9828 
9829   /* "View.MemoryView":445
9830  *                                  src.ndim, dst.ndim, self.dtype_is_object)
9831  *
9832  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
9833  *         cdef int array[128]
9834  *         cdef void *tmp = NULL
9835  */
9836 
9837   /* function exit code */
9838   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9839   goto __pyx_L0;
9840   __pyx_L1_error:;
9841   __Pyx_XDECREF(__pyx_t_2);
9842   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9843   __pyx_r = 0;
9844   __pyx_L0:;
9845   __Pyx_XGIVEREF(__pyx_r);
9846   __Pyx_RefNannyFinishContext();
9847   return __pyx_r;
9848 }
9849 
9850 /* "View.MemoryView":477
9851  *             PyMem_Free(tmp)
9852  *
9853  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
9854  *         cdef char *itemp = self.get_item_pointer(index)
9855  *         self.assign_item_from_object(itemp, value)
9856  */
9857 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)9858 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9859   char *__pyx_v_itemp;
9860   PyObject *__pyx_r = NULL;
9861   __Pyx_RefNannyDeclarations
9862   char *__pyx_t_1;
9863   PyObject *__pyx_t_2 = NULL;
9864   __Pyx_RefNannySetupContext("setitem_indexed", 0);
9865 
9866   /* "View.MemoryView":478
9867  *
9868  *     cdef setitem_indexed(self, index, value):
9869  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
9870  *         self.assign_item_from_object(itemp, value)
9871  *
9872  */
9873   __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(1, 478, __pyx_L1_error)
9874   __pyx_v_itemp = __pyx_t_1;
9875 
9876   /* "View.MemoryView":479
9877  *     cdef setitem_indexed(self, index, value):
9878  *         cdef char *itemp = self.get_item_pointer(index)
9879  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
9880  *
9881  *     cdef convert_item_to_object(self, char *itemp):
9882  */
9883   __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(1, 479, __pyx_L1_error)
9884   __Pyx_GOTREF(__pyx_t_2);
9885   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9886 
9887   /* "View.MemoryView":477
9888  *             PyMem_Free(tmp)
9889  *
9890  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
9891  *         cdef char *itemp = self.get_item_pointer(index)
9892  *         self.assign_item_from_object(itemp, value)
9893  */
9894 
9895   /* function exit code */
9896   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9897   goto __pyx_L0;
9898   __pyx_L1_error:;
9899   __Pyx_XDECREF(__pyx_t_2);
9900   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9901   __pyx_r = 0;
9902   __pyx_L0:;
9903   __Pyx_XGIVEREF(__pyx_r);
9904   __Pyx_RefNannyFinishContext();
9905   return __pyx_r;
9906 }
9907 
9908 /* "View.MemoryView":481
9909  *         self.assign_item_from_object(itemp, value)
9910  *
9911  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
9912  *         """Only used if instantiated manually by the user, or if Cython doesn't
9913  *         know how to convert the type"""
9914  */
9915 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)9916 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9917   PyObject *__pyx_v_struct = NULL;
9918   PyObject *__pyx_v_bytesitem = 0;
9919   PyObject *__pyx_v_result = NULL;
9920   PyObject *__pyx_r = NULL;
9921   __Pyx_RefNannyDeclarations
9922   PyObject *__pyx_t_1 = NULL;
9923   PyObject *__pyx_t_2 = NULL;
9924   PyObject *__pyx_t_3 = NULL;
9925   PyObject *__pyx_t_4 = NULL;
9926   PyObject *__pyx_t_5 = NULL;
9927   PyObject *__pyx_t_6 = NULL;
9928   PyObject *__pyx_t_7 = NULL;
9929   int __pyx_t_8;
9930   PyObject *__pyx_t_9 = NULL;
9931   size_t __pyx_t_10;
9932   int __pyx_t_11;
9933   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9934 
9935   /* "View.MemoryView":484
9936  *         """Only used if instantiated manually by the user, or if Cython doesn't
9937  *         know how to convert the type"""
9938  *         import struct             # <<<<<<<<<<<<<<
9939  *         cdef bytes bytesitem
9940  *
9941  */
9942   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
9943   __Pyx_GOTREF(__pyx_t_1);
9944   __pyx_v_struct = __pyx_t_1;
9945   __pyx_t_1 = 0;
9946 
9947   /* "View.MemoryView":487
9948  *         cdef bytes bytesitem
9949  *
9950  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
9951  *         try:
9952  *             result = struct.unpack(self.view.format, bytesitem)
9953  */
9954   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
9955   __Pyx_GOTREF(__pyx_t_1);
9956   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9957   __pyx_t_1 = 0;
9958 
9959   /* "View.MemoryView":488
9960  *
9961  *         bytesitem = itemp[:self.view.itemsize]
9962  *         try:             # <<<<<<<<<<<<<<
9963  *             result = struct.unpack(self.view.format, bytesitem)
9964  *         except struct.error:
9965  */
9966   {
9967     __Pyx_PyThreadState_declare
9968     __Pyx_PyThreadState_assign
9969     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9970     __Pyx_XGOTREF(__pyx_t_2);
9971     __Pyx_XGOTREF(__pyx_t_3);
9972     __Pyx_XGOTREF(__pyx_t_4);
9973     /*try:*/ {
9974 
9975       /* "View.MemoryView":489
9976  *         bytesitem = itemp[:self.view.itemsize]
9977  *         try:
9978  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
9979  *         except struct.error:
9980  *             raise ValueError("Unable to convert item to object")
9981  */
9982       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
9983       __Pyx_GOTREF(__pyx_t_5);
9984       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
9985       __Pyx_GOTREF(__pyx_t_6);
9986       __pyx_t_7 = NULL;
9987       __pyx_t_8 = 0;
9988       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9989         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9990         if (likely(__pyx_t_7)) {
9991           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9992           __Pyx_INCREF(__pyx_t_7);
9993           __Pyx_INCREF(function);
9994           __Pyx_DECREF_SET(__pyx_t_5, function);
9995           __pyx_t_8 = 1;
9996         }
9997       }
9998       #if CYTHON_FAST_PYCALL
9999       if (PyFunction_Check(__pyx_t_5)) {
10000         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10001         __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(1, 489, __pyx_L3_error)
10002         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10003         __Pyx_GOTREF(__pyx_t_1);
10004         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10005       } else
10006       #endif
10007       #if CYTHON_FAST_PYCCALL
10008       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10009         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10010         __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(1, 489, __pyx_L3_error)
10011         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10012         __Pyx_GOTREF(__pyx_t_1);
10013         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10014       } else
10015       #endif
10016       {
10017         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
10018         __Pyx_GOTREF(__pyx_t_9);
10019         if (__pyx_t_7) {
10020           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10021         }
10022         __Pyx_GIVEREF(__pyx_t_6);
10023         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10024         __Pyx_INCREF(__pyx_v_bytesitem);
10025         __Pyx_GIVEREF(__pyx_v_bytesitem);
10026         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10027         __pyx_t_6 = 0;
10028         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
10029         __Pyx_GOTREF(__pyx_t_1);
10030         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10031       }
10032       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10033       __pyx_v_result = __pyx_t_1;
10034       __pyx_t_1 = 0;
10035 
10036       /* "View.MemoryView":488
10037  *
10038  *         bytesitem = itemp[:self.view.itemsize]
10039  *         try:             # <<<<<<<<<<<<<<
10040  *             result = struct.unpack(self.view.format, bytesitem)
10041  *         except struct.error:
10042  */
10043     }
10044 
10045     /* "View.MemoryView":493
10046  *             raise ValueError("Unable to convert item to object")
10047  *         else:
10048  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
10049  *                 return result[0]
10050  *             return result
10051  */
10052     /*else:*/ {
10053       __pyx_t_10 = strlen(__pyx_v_self->view.format);
10054       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10055       if (__pyx_t_11) {
10056 
10057         /* "View.MemoryView":494
10058  *         else:
10059  *             if len(self.view.format) == 1:
10060  *                 return result[0]             # <<<<<<<<<<<<<<
10061  *             return result
10062  *
10063  */
10064         __Pyx_XDECREF(__pyx_r);
10065         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L5_except_error)
10066         __Pyx_GOTREF(__pyx_t_1);
10067         __pyx_r = __pyx_t_1;
10068         __pyx_t_1 = 0;
10069         goto __pyx_L6_except_return;
10070 
10071         /* "View.MemoryView":493
10072  *             raise ValueError("Unable to convert item to object")
10073  *         else:
10074  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
10075  *                 return result[0]
10076  *             return result
10077  */
10078       }
10079 
10080       /* "View.MemoryView":495
10081  *             if len(self.view.format) == 1:
10082  *                 return result[0]
10083  *             return result             # <<<<<<<<<<<<<<
10084  *
10085  *     cdef assign_item_from_object(self, char *itemp, object value):
10086  */
10087       __Pyx_XDECREF(__pyx_r);
10088       __Pyx_INCREF(__pyx_v_result);
10089       __pyx_r = __pyx_v_result;
10090       goto __pyx_L6_except_return;
10091     }
10092     __pyx_L3_error:;
10093     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10094     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10095     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10096     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10097     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10098 
10099     /* "View.MemoryView":490
10100  *         try:
10101  *             result = struct.unpack(self.view.format, bytesitem)
10102  *         except struct.error:             # <<<<<<<<<<<<<<
10103  *             raise ValueError("Unable to convert item to object")
10104  *         else:
10105  */
10106     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10107     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
10108     __Pyx_GOTREF(__pyx_t_6);
10109     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10110     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10111     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10112     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10113     if (__pyx_t_8) {
10114       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10115       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
10116       __Pyx_GOTREF(__pyx_t_9);
10117       __Pyx_GOTREF(__pyx_t_5);
10118       __Pyx_GOTREF(__pyx_t_1);
10119 
10120       /* "View.MemoryView":491
10121  *             result = struct.unpack(self.view.format, bytesitem)
10122  *         except struct.error:
10123  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
10124  *         else:
10125  *             if len(self.view.format) == 1:
10126  */
10127       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
10128       __Pyx_GOTREF(__pyx_t_6);
10129       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10130       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10131       __PYX_ERR(1, 491, __pyx_L5_except_error)
10132     }
10133     goto __pyx_L5_except_error;
10134     __pyx_L5_except_error:;
10135 
10136     /* "View.MemoryView":488
10137  *
10138  *         bytesitem = itemp[:self.view.itemsize]
10139  *         try:             # <<<<<<<<<<<<<<
10140  *             result = struct.unpack(self.view.format, bytesitem)
10141  *         except struct.error:
10142  */
10143     __Pyx_XGIVEREF(__pyx_t_2);
10144     __Pyx_XGIVEREF(__pyx_t_3);
10145     __Pyx_XGIVEREF(__pyx_t_4);
10146     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10147     goto __pyx_L1_error;
10148     __pyx_L6_except_return:;
10149     __Pyx_XGIVEREF(__pyx_t_2);
10150     __Pyx_XGIVEREF(__pyx_t_3);
10151     __Pyx_XGIVEREF(__pyx_t_4);
10152     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10153     goto __pyx_L0;
10154   }
10155 
10156   /* "View.MemoryView":481
10157  *         self.assign_item_from_object(itemp, value)
10158  *
10159  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
10160  *         """Only used if instantiated manually by the user, or if Cython doesn't
10161  *         know how to convert the type"""
10162  */
10163 
10164   /* function exit code */
10165   __pyx_L1_error:;
10166   __Pyx_XDECREF(__pyx_t_1);
10167   __Pyx_XDECREF(__pyx_t_5);
10168   __Pyx_XDECREF(__pyx_t_6);
10169   __Pyx_XDECREF(__pyx_t_7);
10170   __Pyx_XDECREF(__pyx_t_9);
10171   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10172   __pyx_r = 0;
10173   __pyx_L0:;
10174   __Pyx_XDECREF(__pyx_v_struct);
10175   __Pyx_XDECREF(__pyx_v_bytesitem);
10176   __Pyx_XDECREF(__pyx_v_result);
10177   __Pyx_XGIVEREF(__pyx_r);
10178   __Pyx_RefNannyFinishContext();
10179   return __pyx_r;
10180 }
10181 
10182 /* "View.MemoryView":497
10183  *             return result
10184  *
10185  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
10186  *         """Only used if instantiated manually by the user, or if Cython doesn't
10187  *         know how to convert the type"""
10188  */
10189 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)10190 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10191   PyObject *__pyx_v_struct = NULL;
10192   char __pyx_v_c;
10193   PyObject *__pyx_v_bytesvalue = 0;
10194   Py_ssize_t __pyx_v_i;
10195   PyObject *__pyx_r = NULL;
10196   __Pyx_RefNannyDeclarations
10197   PyObject *__pyx_t_1 = NULL;
10198   int __pyx_t_2;
10199   int __pyx_t_3;
10200   PyObject *__pyx_t_4 = NULL;
10201   PyObject *__pyx_t_5 = NULL;
10202   PyObject *__pyx_t_6 = NULL;
10203   int __pyx_t_7;
10204   PyObject *__pyx_t_8 = NULL;
10205   Py_ssize_t __pyx_t_9;
10206   PyObject *__pyx_t_10 = NULL;
10207   char *__pyx_t_11;
10208   char *__pyx_t_12;
10209   char *__pyx_t_13;
10210   char *__pyx_t_14;
10211   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10212 
10213   /* "View.MemoryView":500
10214  *         """Only used if instantiated manually by the user, or if Cython doesn't
10215  *         know how to convert the type"""
10216  *         import struct             # <<<<<<<<<<<<<<
10217  *         cdef char c
10218  *         cdef bytes bytesvalue
10219  */
10220   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
10221   __Pyx_GOTREF(__pyx_t_1);
10222   __pyx_v_struct = __pyx_t_1;
10223   __pyx_t_1 = 0;
10224 
10225   /* "View.MemoryView":505
10226  *         cdef Py_ssize_t i
10227  *
10228  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
10229  *             bytesvalue = struct.pack(self.view.format, *value)
10230  *         else:
10231  */
10232   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10233   __pyx_t_3 = (__pyx_t_2 != 0);
10234   if (__pyx_t_3) {
10235 
10236     /* "View.MemoryView":506
10237  *
10238  *         if isinstance(value, tuple):
10239  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
10240  *         else:
10241  *             bytesvalue = struct.pack(self.view.format, value)
10242  */
10243     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
10244     __Pyx_GOTREF(__pyx_t_1);
10245     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
10246     __Pyx_GOTREF(__pyx_t_4);
10247     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
10248     __Pyx_GOTREF(__pyx_t_5);
10249     __Pyx_GIVEREF(__pyx_t_4);
10250     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10251     __pyx_t_4 = 0;
10252     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
10253     __Pyx_GOTREF(__pyx_t_4);
10254     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
10255     __Pyx_GOTREF(__pyx_t_6);
10256     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10257     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10258     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
10259     __Pyx_GOTREF(__pyx_t_4);
10260     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10261     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10262     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(1, 506, __pyx_L1_error)
10263     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10264     __pyx_t_4 = 0;
10265 
10266     /* "View.MemoryView":505
10267  *         cdef Py_ssize_t i
10268  *
10269  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
10270  *             bytesvalue = struct.pack(self.view.format, *value)
10271  *         else:
10272  */
10273     goto __pyx_L3;
10274   }
10275 
10276   /* "View.MemoryView":508
10277  *             bytesvalue = struct.pack(self.view.format, *value)
10278  *         else:
10279  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
10280  *
10281  *         for i, c in enumerate(bytesvalue):
10282  */
10283   /*else*/ {
10284     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
10285     __Pyx_GOTREF(__pyx_t_6);
10286     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
10287     __Pyx_GOTREF(__pyx_t_1);
10288     __pyx_t_5 = NULL;
10289     __pyx_t_7 = 0;
10290     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10291       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10292       if (likely(__pyx_t_5)) {
10293         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10294         __Pyx_INCREF(__pyx_t_5);
10295         __Pyx_INCREF(function);
10296         __Pyx_DECREF_SET(__pyx_t_6, function);
10297         __pyx_t_7 = 1;
10298       }
10299     }
10300     #if CYTHON_FAST_PYCALL
10301     if (PyFunction_Check(__pyx_t_6)) {
10302       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10303       __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(1, 508, __pyx_L1_error)
10304       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10305       __Pyx_GOTREF(__pyx_t_4);
10306       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10307     } else
10308     #endif
10309     #if CYTHON_FAST_PYCCALL
10310     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10311       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10312       __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(1, 508, __pyx_L1_error)
10313       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10314       __Pyx_GOTREF(__pyx_t_4);
10315       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10316     } else
10317     #endif
10318     {
10319       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
10320       __Pyx_GOTREF(__pyx_t_8);
10321       if (__pyx_t_5) {
10322         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
10323       }
10324       __Pyx_GIVEREF(__pyx_t_1);
10325       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
10326       __Pyx_INCREF(__pyx_v_value);
10327       __Pyx_GIVEREF(__pyx_v_value);
10328       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
10329       __pyx_t_1 = 0;
10330       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
10331       __Pyx_GOTREF(__pyx_t_4);
10332       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10333     }
10334     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10335     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(1, 508, __pyx_L1_error)
10336     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10337     __pyx_t_4 = 0;
10338   }
10339   __pyx_L3:;
10340 
10341   /* "View.MemoryView":510
10342  *             bytesvalue = struct.pack(self.view.format, value)
10343  *
10344  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
10345  *             itemp[i] = c
10346  *
10347  */
10348   __pyx_t_9 = 0;
10349   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10350     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
10351     __PYX_ERR(1, 510, __pyx_L1_error)
10352   }
10353   __Pyx_INCREF(__pyx_v_bytesvalue);
10354   __pyx_t_10 = __pyx_v_bytesvalue;
10355   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
10356   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
10357   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10358     __pyx_t_11 = __pyx_t_14;
10359     __pyx_v_c = (__pyx_t_11[0]);
10360 
10361     /* "View.MemoryView":511
10362  *
10363  *         for i, c in enumerate(bytesvalue):
10364  *             itemp[i] = c             # <<<<<<<<<<<<<<
10365  *
10366  *     @cname('getbuffer')
10367  */
10368     __pyx_v_i = __pyx_t_9;
10369 
10370     /* "View.MemoryView":510
10371  *             bytesvalue = struct.pack(self.view.format, value)
10372  *
10373  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
10374  *             itemp[i] = c
10375  *
10376  */
10377     __pyx_t_9 = (__pyx_t_9 + 1);
10378 
10379     /* "View.MemoryView":511
10380  *
10381  *         for i, c in enumerate(bytesvalue):
10382  *             itemp[i] = c             # <<<<<<<<<<<<<<
10383  *
10384  *     @cname('getbuffer')
10385  */
10386     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10387   }
10388   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10389 
10390   /* "View.MemoryView":497
10391  *             return result
10392  *
10393  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
10394  *         """Only used if instantiated manually by the user, or if Cython doesn't
10395  *         know how to convert the type"""
10396  */
10397 
10398   /* function exit code */
10399   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10400   goto __pyx_L0;
10401   __pyx_L1_error:;
10402   __Pyx_XDECREF(__pyx_t_1);
10403   __Pyx_XDECREF(__pyx_t_4);
10404   __Pyx_XDECREF(__pyx_t_5);
10405   __Pyx_XDECREF(__pyx_t_6);
10406   __Pyx_XDECREF(__pyx_t_8);
10407   __Pyx_XDECREF(__pyx_t_10);
10408   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10409   __pyx_r = 0;
10410   __pyx_L0:;
10411   __Pyx_XDECREF(__pyx_v_struct);
10412   __Pyx_XDECREF(__pyx_v_bytesvalue);
10413   __Pyx_XGIVEREF(__pyx_r);
10414   __Pyx_RefNannyFinishContext();
10415   return __pyx_r;
10416 }
10417 
10418 /* "View.MemoryView":514
10419  *
10420  *     @cname('getbuffer')
10421  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
10422  *         if flags & PyBUF_WRITABLE and self.view.readonly:
10423  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10424  */
10425 
10426 /* Python wrapper */
10427 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)10428 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10429   int __pyx_r;
10430   __Pyx_RefNannyDeclarations
10431   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10432   __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));
10433 
10434   /* function exit code */
10435   __Pyx_RefNannyFinishContext();
10436   return __pyx_r;
10437 }
10438 
__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)10439 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) {
10440   int __pyx_r;
10441   __Pyx_RefNannyDeclarations
10442   int __pyx_t_1;
10443   int __pyx_t_2;
10444   PyObject *__pyx_t_3 = NULL;
10445   Py_ssize_t *__pyx_t_4;
10446   char *__pyx_t_5;
10447   void *__pyx_t_6;
10448   int __pyx_t_7;
10449   Py_ssize_t __pyx_t_8;
10450   if (__pyx_v_info == NULL) {
10451     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10452     return -1;
10453   }
10454   __Pyx_RefNannySetupContext("__getbuffer__", 0);
10455   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10456   __Pyx_GIVEREF(__pyx_v_info->obj);
10457 
10458   /* "View.MemoryView":515
10459  *     @cname('getbuffer')
10460  *     def __getbuffer__(self, Py_buffer *info, int flags):
10461  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
10462  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10463  *
10464  */
10465   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10466   if (__pyx_t_2) {
10467   } else {
10468     __pyx_t_1 = __pyx_t_2;
10469     goto __pyx_L4_bool_binop_done;
10470   }
10471   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
10472   __pyx_t_1 = __pyx_t_2;
10473   __pyx_L4_bool_binop_done:;
10474   if (unlikely(__pyx_t_1)) {
10475 
10476     /* "View.MemoryView":516
10477  *     def __getbuffer__(self, Py_buffer *info, int flags):
10478  *         if flags & PyBUF_WRITABLE and self.view.readonly:
10479  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
10480  *
10481  *         if flags & PyBUF_ND:
10482  */
10483     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
10484     __Pyx_GOTREF(__pyx_t_3);
10485     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10486     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10487     __PYX_ERR(1, 516, __pyx_L1_error)
10488 
10489     /* "View.MemoryView":515
10490  *     @cname('getbuffer')
10491  *     def __getbuffer__(self, Py_buffer *info, int flags):
10492  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
10493  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10494  *
10495  */
10496   }
10497 
10498   /* "View.MemoryView":518
10499  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10500  *
10501  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
10502  *             info.shape = self.view.shape
10503  *         else:
10504  */
10505   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10506   if (__pyx_t_1) {
10507 
10508     /* "View.MemoryView":519
10509  *
10510  *         if flags & PyBUF_ND:
10511  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
10512  *         else:
10513  *             info.shape = NULL
10514  */
10515     __pyx_t_4 = __pyx_v_self->view.shape;
10516     __pyx_v_info->shape = __pyx_t_4;
10517 
10518     /* "View.MemoryView":518
10519  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10520  *
10521  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
10522  *             info.shape = self.view.shape
10523  *         else:
10524  */
10525     goto __pyx_L6;
10526   }
10527 
10528   /* "View.MemoryView":521
10529  *             info.shape = self.view.shape
10530  *         else:
10531  *             info.shape = NULL             # <<<<<<<<<<<<<<
10532  *
10533  *         if flags & PyBUF_STRIDES:
10534  */
10535   /*else*/ {
10536     __pyx_v_info->shape = NULL;
10537   }
10538   __pyx_L6:;
10539 
10540   /* "View.MemoryView":523
10541  *             info.shape = NULL
10542  *
10543  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
10544  *             info.strides = self.view.strides
10545  *         else:
10546  */
10547   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10548   if (__pyx_t_1) {
10549 
10550     /* "View.MemoryView":524
10551  *
10552  *         if flags & PyBUF_STRIDES:
10553  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
10554  *         else:
10555  *             info.strides = NULL
10556  */
10557     __pyx_t_4 = __pyx_v_self->view.strides;
10558     __pyx_v_info->strides = __pyx_t_4;
10559 
10560     /* "View.MemoryView":523
10561  *             info.shape = NULL
10562  *
10563  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
10564  *             info.strides = self.view.strides
10565  *         else:
10566  */
10567     goto __pyx_L7;
10568   }
10569 
10570   /* "View.MemoryView":526
10571  *             info.strides = self.view.strides
10572  *         else:
10573  *             info.strides = NULL             # <<<<<<<<<<<<<<
10574  *
10575  *         if flags & PyBUF_INDIRECT:
10576  */
10577   /*else*/ {
10578     __pyx_v_info->strides = NULL;
10579   }
10580   __pyx_L7:;
10581 
10582   /* "View.MemoryView":528
10583  *             info.strides = NULL
10584  *
10585  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
10586  *             info.suboffsets = self.view.suboffsets
10587  *         else:
10588  */
10589   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10590   if (__pyx_t_1) {
10591 
10592     /* "View.MemoryView":529
10593  *
10594  *         if flags & PyBUF_INDIRECT:
10595  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
10596  *         else:
10597  *             info.suboffsets = NULL
10598  */
10599     __pyx_t_4 = __pyx_v_self->view.suboffsets;
10600     __pyx_v_info->suboffsets = __pyx_t_4;
10601 
10602     /* "View.MemoryView":528
10603  *             info.strides = NULL
10604  *
10605  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
10606  *             info.suboffsets = self.view.suboffsets
10607  *         else:
10608  */
10609     goto __pyx_L8;
10610   }
10611 
10612   /* "View.MemoryView":531
10613  *             info.suboffsets = self.view.suboffsets
10614  *         else:
10615  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
10616  *
10617  *         if flags & PyBUF_FORMAT:
10618  */
10619   /*else*/ {
10620     __pyx_v_info->suboffsets = NULL;
10621   }
10622   __pyx_L8:;
10623 
10624   /* "View.MemoryView":533
10625  *             info.suboffsets = NULL
10626  *
10627  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
10628  *             info.format = self.view.format
10629  *         else:
10630  */
10631   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10632   if (__pyx_t_1) {
10633 
10634     /* "View.MemoryView":534
10635  *
10636  *         if flags & PyBUF_FORMAT:
10637  *             info.format = self.view.format             # <<<<<<<<<<<<<<
10638  *         else:
10639  *             info.format = NULL
10640  */
10641     __pyx_t_5 = __pyx_v_self->view.format;
10642     __pyx_v_info->format = __pyx_t_5;
10643 
10644     /* "View.MemoryView":533
10645  *             info.suboffsets = NULL
10646  *
10647  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
10648  *             info.format = self.view.format
10649  *         else:
10650  */
10651     goto __pyx_L9;
10652   }
10653 
10654   /* "View.MemoryView":536
10655  *             info.format = self.view.format
10656  *         else:
10657  *             info.format = NULL             # <<<<<<<<<<<<<<
10658  *
10659  *         info.buf = self.view.buf
10660  */
10661   /*else*/ {
10662     __pyx_v_info->format = NULL;
10663   }
10664   __pyx_L9:;
10665 
10666   /* "View.MemoryView":538
10667  *             info.format = NULL
10668  *
10669  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
10670  *         info.ndim = self.view.ndim
10671  *         info.itemsize = self.view.itemsize
10672  */
10673   __pyx_t_6 = __pyx_v_self->view.buf;
10674   __pyx_v_info->buf = __pyx_t_6;
10675 
10676   /* "View.MemoryView":539
10677  *
10678  *         info.buf = self.view.buf
10679  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
10680  *         info.itemsize = self.view.itemsize
10681  *         info.len = self.view.len
10682  */
10683   __pyx_t_7 = __pyx_v_self->view.ndim;
10684   __pyx_v_info->ndim = __pyx_t_7;
10685 
10686   /* "View.MemoryView":540
10687  *         info.buf = self.view.buf
10688  *         info.ndim = self.view.ndim
10689  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
10690  *         info.len = self.view.len
10691  *         info.readonly = self.view.readonly
10692  */
10693   __pyx_t_8 = __pyx_v_self->view.itemsize;
10694   __pyx_v_info->itemsize = __pyx_t_8;
10695 
10696   /* "View.MemoryView":541
10697  *         info.ndim = self.view.ndim
10698  *         info.itemsize = self.view.itemsize
10699  *         info.len = self.view.len             # <<<<<<<<<<<<<<
10700  *         info.readonly = self.view.readonly
10701  *         info.obj = self
10702  */
10703   __pyx_t_8 = __pyx_v_self->view.len;
10704   __pyx_v_info->len = __pyx_t_8;
10705 
10706   /* "View.MemoryView":542
10707  *         info.itemsize = self.view.itemsize
10708  *         info.len = self.view.len
10709  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
10710  *         info.obj = self
10711  *
10712  */
10713   __pyx_t_1 = __pyx_v_self->view.readonly;
10714   __pyx_v_info->readonly = __pyx_t_1;
10715 
10716   /* "View.MemoryView":543
10717  *         info.len = self.view.len
10718  *         info.readonly = self.view.readonly
10719  *         info.obj = self             # <<<<<<<<<<<<<<
10720  *
10721  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
10722  */
10723   __Pyx_INCREF(((PyObject *)__pyx_v_self));
10724   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10725   __Pyx_GOTREF(__pyx_v_info->obj);
10726   __Pyx_DECREF(__pyx_v_info->obj);
10727   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10728 
10729   /* "View.MemoryView":514
10730  *
10731  *     @cname('getbuffer')
10732  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
10733  *         if flags & PyBUF_WRITABLE and self.view.readonly:
10734  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
10735  */
10736 
10737   /* function exit code */
10738   __pyx_r = 0;
10739   goto __pyx_L0;
10740   __pyx_L1_error:;
10741   __Pyx_XDECREF(__pyx_t_3);
10742   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10743   __pyx_r = -1;
10744   if (__pyx_v_info->obj != NULL) {
10745     __Pyx_GOTREF(__pyx_v_info->obj);
10746     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10747   }
10748   goto __pyx_L2;
10749   __pyx_L0:;
10750   if (__pyx_v_info->obj == Py_None) {
10751     __Pyx_GOTREF(__pyx_v_info->obj);
10752     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10753   }
10754   __pyx_L2:;
10755   __Pyx_RefNannyFinishContext();
10756   return __pyx_r;
10757 }
10758 
10759 /* "View.MemoryView":549
10760  *
10761  *     @property
10762  *     def T(self):             # <<<<<<<<<<<<<<
10763  *         cdef _memoryviewslice result = memoryview_copy(self)
10764  *         transpose_memslice(&result.from_slice)
10765  */
10766 
10767 /* Python wrapper */
10768 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)10769 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10770   PyObject *__pyx_r = 0;
10771   __Pyx_RefNannyDeclarations
10772   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10773   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10774 
10775   /* function exit code */
10776   __Pyx_RefNannyFinishContext();
10777   return __pyx_r;
10778 }
10779 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)10780 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10781   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10782   PyObject *__pyx_r = NULL;
10783   __Pyx_RefNannyDeclarations
10784   PyObject *__pyx_t_1 = NULL;
10785   int __pyx_t_2;
10786   __Pyx_RefNannySetupContext("__get__", 0);
10787 
10788   /* "View.MemoryView":550
10789  *     @property
10790  *     def T(self):
10791  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
10792  *         transpose_memslice(&result.from_slice)
10793  *         return result
10794  */
10795   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
10796   __Pyx_GOTREF(__pyx_t_1);
10797   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
10798   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10799   __pyx_t_1 = 0;
10800 
10801   /* "View.MemoryView":551
10802  *     def T(self):
10803  *         cdef _memoryviewslice result = memoryview_copy(self)
10804  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
10805  *         return result
10806  *
10807  */
10808   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
10809 
10810   /* "View.MemoryView":552
10811  *         cdef _memoryviewslice result = memoryview_copy(self)
10812  *         transpose_memslice(&result.from_slice)
10813  *         return result             # <<<<<<<<<<<<<<
10814  *
10815  *     @property
10816  */
10817   __Pyx_XDECREF(__pyx_r);
10818   __Pyx_INCREF(((PyObject *)__pyx_v_result));
10819   __pyx_r = ((PyObject *)__pyx_v_result);
10820   goto __pyx_L0;
10821 
10822   /* "View.MemoryView":549
10823  *
10824  *     @property
10825  *     def T(self):             # <<<<<<<<<<<<<<
10826  *         cdef _memoryviewslice result = memoryview_copy(self)
10827  *         transpose_memslice(&result.from_slice)
10828  */
10829 
10830   /* function exit code */
10831   __pyx_L1_error:;
10832   __Pyx_XDECREF(__pyx_t_1);
10833   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10834   __pyx_r = NULL;
10835   __pyx_L0:;
10836   __Pyx_XDECREF((PyObject *)__pyx_v_result);
10837   __Pyx_XGIVEREF(__pyx_r);
10838   __Pyx_RefNannyFinishContext();
10839   return __pyx_r;
10840 }
10841 
10842 /* "View.MemoryView":555
10843  *
10844  *     @property
10845  *     def base(self):             # <<<<<<<<<<<<<<
10846  *         return self.obj
10847  *
10848  */
10849 
10850 /* Python wrapper */
10851 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)10852 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10853   PyObject *__pyx_r = 0;
10854   __Pyx_RefNannyDeclarations
10855   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10856   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10857 
10858   /* function exit code */
10859   __Pyx_RefNannyFinishContext();
10860   return __pyx_r;
10861 }
10862 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)10863 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10864   PyObject *__pyx_r = NULL;
10865   __Pyx_RefNannyDeclarations
10866   __Pyx_RefNannySetupContext("__get__", 0);
10867 
10868   /* "View.MemoryView":556
10869  *     @property
10870  *     def base(self):
10871  *         return self.obj             # <<<<<<<<<<<<<<
10872  *
10873  *     @property
10874  */
10875   __Pyx_XDECREF(__pyx_r);
10876   __Pyx_INCREF(__pyx_v_self->obj);
10877   __pyx_r = __pyx_v_self->obj;
10878   goto __pyx_L0;
10879 
10880   /* "View.MemoryView":555
10881  *
10882  *     @property
10883  *     def base(self):             # <<<<<<<<<<<<<<
10884  *         return self.obj
10885  *
10886  */
10887 
10888   /* function exit code */
10889   __pyx_L0:;
10890   __Pyx_XGIVEREF(__pyx_r);
10891   __Pyx_RefNannyFinishContext();
10892   return __pyx_r;
10893 }
10894 
10895 /* "View.MemoryView":559
10896  *
10897  *     @property
10898  *     def shape(self):             # <<<<<<<<<<<<<<
10899  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
10900  *
10901  */
10902 
10903 /* Python wrapper */
10904 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)10905 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10906   PyObject *__pyx_r = 0;
10907   __Pyx_RefNannyDeclarations
10908   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10909   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10910 
10911   /* function exit code */
10912   __Pyx_RefNannyFinishContext();
10913   return __pyx_r;
10914 }
10915 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)10916 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10917   Py_ssize_t __pyx_v_length;
10918   PyObject *__pyx_r = NULL;
10919   __Pyx_RefNannyDeclarations
10920   PyObject *__pyx_t_1 = NULL;
10921   Py_ssize_t *__pyx_t_2;
10922   Py_ssize_t *__pyx_t_3;
10923   Py_ssize_t *__pyx_t_4;
10924   PyObject *__pyx_t_5 = NULL;
10925   __Pyx_RefNannySetupContext("__get__", 0);
10926 
10927   /* "View.MemoryView":560
10928  *     @property
10929  *     def shape(self):
10930  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
10931  *
10932  *     @property
10933  */
10934   __Pyx_XDECREF(__pyx_r);
10935   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
10936   __Pyx_GOTREF(__pyx_t_1);
10937   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10938   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10939     __pyx_t_2 = __pyx_t_4;
10940     __pyx_v_length = (__pyx_t_2[0]);
10941     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
10942     __Pyx_GOTREF(__pyx_t_5);
10943     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
10944     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10945   }
10946   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
10947   __Pyx_GOTREF(__pyx_t_5);
10948   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10949   __pyx_r = __pyx_t_5;
10950   __pyx_t_5 = 0;
10951   goto __pyx_L0;
10952 
10953   /* "View.MemoryView":559
10954  *
10955  *     @property
10956  *     def shape(self):             # <<<<<<<<<<<<<<
10957  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
10958  *
10959  */
10960 
10961   /* function exit code */
10962   __pyx_L1_error:;
10963   __Pyx_XDECREF(__pyx_t_1);
10964   __Pyx_XDECREF(__pyx_t_5);
10965   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10966   __pyx_r = NULL;
10967   __pyx_L0:;
10968   __Pyx_XGIVEREF(__pyx_r);
10969   __Pyx_RefNannyFinishContext();
10970   return __pyx_r;
10971 }
10972 
10973 /* "View.MemoryView":563
10974  *
10975  *     @property
10976  *     def strides(self):             # <<<<<<<<<<<<<<
10977  *         if self.view.strides == NULL:
10978  *
10979  */
10980 
10981 /* Python wrapper */
10982 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)10983 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10984   PyObject *__pyx_r = 0;
10985   __Pyx_RefNannyDeclarations
10986   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10987   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10988 
10989   /* function exit code */
10990   __Pyx_RefNannyFinishContext();
10991   return __pyx_r;
10992 }
10993 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)10994 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10995   Py_ssize_t __pyx_v_stride;
10996   PyObject *__pyx_r = NULL;
10997   __Pyx_RefNannyDeclarations
10998   int __pyx_t_1;
10999   PyObject *__pyx_t_2 = NULL;
11000   Py_ssize_t *__pyx_t_3;
11001   Py_ssize_t *__pyx_t_4;
11002   Py_ssize_t *__pyx_t_5;
11003   PyObject *__pyx_t_6 = NULL;
11004   __Pyx_RefNannySetupContext("__get__", 0);
11005 
11006   /* "View.MemoryView":564
11007  *     @property
11008  *     def strides(self):
11009  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
11010  *
11011  *             raise ValueError("Buffer view does not expose strides")
11012  */
11013   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11014   if (unlikely(__pyx_t_1)) {
11015 
11016     /* "View.MemoryView":566
11017  *         if self.view.strides == NULL:
11018  *
11019  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
11020  *
11021  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11022  */
11023     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
11024     __Pyx_GOTREF(__pyx_t_2);
11025     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11026     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11027     __PYX_ERR(1, 566, __pyx_L1_error)
11028 
11029     /* "View.MemoryView":564
11030  *     @property
11031  *     def strides(self):
11032  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
11033  *
11034  *             raise ValueError("Buffer view does not expose strides")
11035  */
11036   }
11037 
11038   /* "View.MemoryView":568
11039  *             raise ValueError("Buffer view does not expose strides")
11040  *
11041  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
11042  *
11043  *     @property
11044  */
11045   __Pyx_XDECREF(__pyx_r);
11046   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
11047   __Pyx_GOTREF(__pyx_t_2);
11048   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11049   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11050     __pyx_t_3 = __pyx_t_5;
11051     __pyx_v_stride = (__pyx_t_3[0]);
11052     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
11053     __Pyx_GOTREF(__pyx_t_6);
11054     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
11055     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11056   }
11057   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
11058   __Pyx_GOTREF(__pyx_t_6);
11059   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11060   __pyx_r = __pyx_t_6;
11061   __pyx_t_6 = 0;
11062   goto __pyx_L0;
11063 
11064   /* "View.MemoryView":563
11065  *
11066  *     @property
11067  *     def strides(self):             # <<<<<<<<<<<<<<
11068  *         if self.view.strides == NULL:
11069  *
11070  */
11071 
11072   /* function exit code */
11073   __pyx_L1_error:;
11074   __Pyx_XDECREF(__pyx_t_2);
11075   __Pyx_XDECREF(__pyx_t_6);
11076   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11077   __pyx_r = NULL;
11078   __pyx_L0:;
11079   __Pyx_XGIVEREF(__pyx_r);
11080   __Pyx_RefNannyFinishContext();
11081   return __pyx_r;
11082 }
11083 
11084 /* "View.MemoryView":571
11085  *
11086  *     @property
11087  *     def suboffsets(self):             # <<<<<<<<<<<<<<
11088  *         if self.view.suboffsets == NULL:
11089  *             return (-1,) * self.view.ndim
11090  */
11091 
11092 /* Python wrapper */
11093 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)11094 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11095   PyObject *__pyx_r = 0;
11096   __Pyx_RefNannyDeclarations
11097   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11098   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11099 
11100   /* function exit code */
11101   __Pyx_RefNannyFinishContext();
11102   return __pyx_r;
11103 }
11104 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)11105 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11106   Py_ssize_t __pyx_v_suboffset;
11107   PyObject *__pyx_r = NULL;
11108   __Pyx_RefNannyDeclarations
11109   int __pyx_t_1;
11110   PyObject *__pyx_t_2 = NULL;
11111   PyObject *__pyx_t_3 = NULL;
11112   Py_ssize_t *__pyx_t_4;
11113   Py_ssize_t *__pyx_t_5;
11114   Py_ssize_t *__pyx_t_6;
11115   __Pyx_RefNannySetupContext("__get__", 0);
11116 
11117   /* "View.MemoryView":572
11118  *     @property
11119  *     def suboffsets(self):
11120  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
11121  *             return (-1,) * self.view.ndim
11122  *
11123  */
11124   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11125   if (__pyx_t_1) {
11126 
11127     /* "View.MemoryView":573
11128  *     def suboffsets(self):
11129  *         if self.view.suboffsets == NULL:
11130  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
11131  *
11132  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11133  */
11134     __Pyx_XDECREF(__pyx_r);
11135     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
11136     __Pyx_GOTREF(__pyx_t_2);
11137     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
11138     __Pyx_GOTREF(__pyx_t_3);
11139     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11140     __pyx_r = __pyx_t_3;
11141     __pyx_t_3 = 0;
11142     goto __pyx_L0;
11143 
11144     /* "View.MemoryView":572
11145  *     @property
11146  *     def suboffsets(self):
11147  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
11148  *             return (-1,) * self.view.ndim
11149  *
11150  */
11151   }
11152 
11153   /* "View.MemoryView":575
11154  *             return (-1,) * self.view.ndim
11155  *
11156  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
11157  *
11158  *     @property
11159  */
11160   __Pyx_XDECREF(__pyx_r);
11161   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
11162   __Pyx_GOTREF(__pyx_t_3);
11163   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11164   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11165     __pyx_t_4 = __pyx_t_6;
11166     __pyx_v_suboffset = (__pyx_t_4[0]);
11167     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
11168     __Pyx_GOTREF(__pyx_t_2);
11169     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
11170     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11171   }
11172   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
11173   __Pyx_GOTREF(__pyx_t_2);
11174   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11175   __pyx_r = __pyx_t_2;
11176   __pyx_t_2 = 0;
11177   goto __pyx_L0;
11178 
11179   /* "View.MemoryView":571
11180  *
11181  *     @property
11182  *     def suboffsets(self):             # <<<<<<<<<<<<<<
11183  *         if self.view.suboffsets == NULL:
11184  *             return (-1,) * self.view.ndim
11185  */
11186 
11187   /* function exit code */
11188   __pyx_L1_error:;
11189   __Pyx_XDECREF(__pyx_t_2);
11190   __Pyx_XDECREF(__pyx_t_3);
11191   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11192   __pyx_r = NULL;
11193   __pyx_L0:;
11194   __Pyx_XGIVEREF(__pyx_r);
11195   __Pyx_RefNannyFinishContext();
11196   return __pyx_r;
11197 }
11198 
11199 /* "View.MemoryView":578
11200  *
11201  *     @property
11202  *     def ndim(self):             # <<<<<<<<<<<<<<
11203  *         return self.view.ndim
11204  *
11205  */
11206 
11207 /* Python wrapper */
11208 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)11209 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11210   PyObject *__pyx_r = 0;
11211   __Pyx_RefNannyDeclarations
11212   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11213   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11214 
11215   /* function exit code */
11216   __Pyx_RefNannyFinishContext();
11217   return __pyx_r;
11218 }
11219 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)11220 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11221   PyObject *__pyx_r = NULL;
11222   __Pyx_RefNannyDeclarations
11223   PyObject *__pyx_t_1 = NULL;
11224   __Pyx_RefNannySetupContext("__get__", 0);
11225 
11226   /* "View.MemoryView":579
11227  *     @property
11228  *     def ndim(self):
11229  *         return self.view.ndim             # <<<<<<<<<<<<<<
11230  *
11231  *     @property
11232  */
11233   __Pyx_XDECREF(__pyx_r);
11234   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
11235   __Pyx_GOTREF(__pyx_t_1);
11236   __pyx_r = __pyx_t_1;
11237   __pyx_t_1 = 0;
11238   goto __pyx_L0;
11239 
11240   /* "View.MemoryView":578
11241  *
11242  *     @property
11243  *     def ndim(self):             # <<<<<<<<<<<<<<
11244  *         return self.view.ndim
11245  *
11246  */
11247 
11248   /* function exit code */
11249   __pyx_L1_error:;
11250   __Pyx_XDECREF(__pyx_t_1);
11251   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11252   __pyx_r = NULL;
11253   __pyx_L0:;
11254   __Pyx_XGIVEREF(__pyx_r);
11255   __Pyx_RefNannyFinishContext();
11256   return __pyx_r;
11257 }
11258 
11259 /* "View.MemoryView":582
11260  *
11261  *     @property
11262  *     def itemsize(self):             # <<<<<<<<<<<<<<
11263  *         return self.view.itemsize
11264  *
11265  */
11266 
11267 /* Python wrapper */
11268 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)11269 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11270   PyObject *__pyx_r = 0;
11271   __Pyx_RefNannyDeclarations
11272   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11273   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11274 
11275   /* function exit code */
11276   __Pyx_RefNannyFinishContext();
11277   return __pyx_r;
11278 }
11279 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)11280 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11281   PyObject *__pyx_r = NULL;
11282   __Pyx_RefNannyDeclarations
11283   PyObject *__pyx_t_1 = NULL;
11284   __Pyx_RefNannySetupContext("__get__", 0);
11285 
11286   /* "View.MemoryView":583
11287  *     @property
11288  *     def itemsize(self):
11289  *         return self.view.itemsize             # <<<<<<<<<<<<<<
11290  *
11291  *     @property
11292  */
11293   __Pyx_XDECREF(__pyx_r);
11294   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
11295   __Pyx_GOTREF(__pyx_t_1);
11296   __pyx_r = __pyx_t_1;
11297   __pyx_t_1 = 0;
11298   goto __pyx_L0;
11299 
11300   /* "View.MemoryView":582
11301  *
11302  *     @property
11303  *     def itemsize(self):             # <<<<<<<<<<<<<<
11304  *         return self.view.itemsize
11305  *
11306  */
11307 
11308   /* function exit code */
11309   __pyx_L1_error:;
11310   __Pyx_XDECREF(__pyx_t_1);
11311   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11312   __pyx_r = NULL;
11313   __pyx_L0:;
11314   __Pyx_XGIVEREF(__pyx_r);
11315   __Pyx_RefNannyFinishContext();
11316   return __pyx_r;
11317 }
11318 
11319 /* "View.MemoryView":586
11320  *
11321  *     @property
11322  *     def nbytes(self):             # <<<<<<<<<<<<<<
11323  *         return self.size * self.view.itemsize
11324  *
11325  */
11326 
11327 /* Python wrapper */
11328 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)11329 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11330   PyObject *__pyx_r = 0;
11331   __Pyx_RefNannyDeclarations
11332   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11333   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11334 
11335   /* function exit code */
11336   __Pyx_RefNannyFinishContext();
11337   return __pyx_r;
11338 }
11339 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)11340 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11341   PyObject *__pyx_r = NULL;
11342   __Pyx_RefNannyDeclarations
11343   PyObject *__pyx_t_1 = NULL;
11344   PyObject *__pyx_t_2 = NULL;
11345   PyObject *__pyx_t_3 = NULL;
11346   __Pyx_RefNannySetupContext("__get__", 0);
11347 
11348   /* "View.MemoryView":587
11349  *     @property
11350  *     def nbytes(self):
11351  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
11352  *
11353  *     @property
11354  */
11355   __Pyx_XDECREF(__pyx_r);
11356   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
11357   __Pyx_GOTREF(__pyx_t_1);
11358   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
11359   __Pyx_GOTREF(__pyx_t_2);
11360   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
11361   __Pyx_GOTREF(__pyx_t_3);
11362   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11363   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11364   __pyx_r = __pyx_t_3;
11365   __pyx_t_3 = 0;
11366   goto __pyx_L0;
11367 
11368   /* "View.MemoryView":586
11369  *
11370  *     @property
11371  *     def nbytes(self):             # <<<<<<<<<<<<<<
11372  *         return self.size * self.view.itemsize
11373  *
11374  */
11375 
11376   /* function exit code */
11377   __pyx_L1_error:;
11378   __Pyx_XDECREF(__pyx_t_1);
11379   __Pyx_XDECREF(__pyx_t_2);
11380   __Pyx_XDECREF(__pyx_t_3);
11381   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11382   __pyx_r = NULL;
11383   __pyx_L0:;
11384   __Pyx_XGIVEREF(__pyx_r);
11385   __Pyx_RefNannyFinishContext();
11386   return __pyx_r;
11387 }
11388 
11389 /* "View.MemoryView":590
11390  *
11391  *     @property
11392  *     def size(self):             # <<<<<<<<<<<<<<
11393  *         if self._size is None:
11394  *             result = 1
11395  */
11396 
11397 /* Python wrapper */
11398 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)11399 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11400   PyObject *__pyx_r = 0;
11401   __Pyx_RefNannyDeclarations
11402   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11403   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11404 
11405   /* function exit code */
11406   __Pyx_RefNannyFinishContext();
11407   return __pyx_r;
11408 }
11409 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)11410 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11411   PyObject *__pyx_v_result = NULL;
11412   PyObject *__pyx_v_length = NULL;
11413   PyObject *__pyx_r = NULL;
11414   __Pyx_RefNannyDeclarations
11415   int __pyx_t_1;
11416   int __pyx_t_2;
11417   Py_ssize_t *__pyx_t_3;
11418   Py_ssize_t *__pyx_t_4;
11419   Py_ssize_t *__pyx_t_5;
11420   PyObject *__pyx_t_6 = NULL;
11421   __Pyx_RefNannySetupContext("__get__", 0);
11422 
11423   /* "View.MemoryView":591
11424  *     @property
11425  *     def size(self):
11426  *         if self._size is None:             # <<<<<<<<<<<<<<
11427  *             result = 1
11428  *
11429  */
11430   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11431   __pyx_t_2 = (__pyx_t_1 != 0);
11432   if (__pyx_t_2) {
11433 
11434     /* "View.MemoryView":592
11435  *     def size(self):
11436  *         if self._size is None:
11437  *             result = 1             # <<<<<<<<<<<<<<
11438  *
11439  *             for length in self.view.shape[:self.view.ndim]:
11440  */
11441     __Pyx_INCREF(__pyx_int_1);
11442     __pyx_v_result = __pyx_int_1;
11443 
11444     /* "View.MemoryView":594
11445  *             result = 1
11446  *
11447  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
11448  *                 result *= length
11449  *
11450  */
11451     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11452     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11453       __pyx_t_3 = __pyx_t_5;
11454       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
11455       __Pyx_GOTREF(__pyx_t_6);
11456       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
11457       __pyx_t_6 = 0;
11458 
11459       /* "View.MemoryView":595
11460  *
11461  *             for length in self.view.shape[:self.view.ndim]:
11462  *                 result *= length             # <<<<<<<<<<<<<<
11463  *
11464  *             self._size = result
11465  */
11466       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
11467       __Pyx_GOTREF(__pyx_t_6);
11468       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
11469       __pyx_t_6 = 0;
11470     }
11471 
11472     /* "View.MemoryView":597
11473  *                 result *= length
11474  *
11475  *             self._size = result             # <<<<<<<<<<<<<<
11476  *
11477  *         return self._size
11478  */
11479     __Pyx_INCREF(__pyx_v_result);
11480     __Pyx_GIVEREF(__pyx_v_result);
11481     __Pyx_GOTREF(__pyx_v_self->_size);
11482     __Pyx_DECREF(__pyx_v_self->_size);
11483     __pyx_v_self->_size = __pyx_v_result;
11484 
11485     /* "View.MemoryView":591
11486  *     @property
11487  *     def size(self):
11488  *         if self._size is None:             # <<<<<<<<<<<<<<
11489  *             result = 1
11490  *
11491  */
11492   }
11493 
11494   /* "View.MemoryView":599
11495  *             self._size = result
11496  *
11497  *         return self._size             # <<<<<<<<<<<<<<
11498  *
11499  *     def __len__(self):
11500  */
11501   __Pyx_XDECREF(__pyx_r);
11502   __Pyx_INCREF(__pyx_v_self->_size);
11503   __pyx_r = __pyx_v_self->_size;
11504   goto __pyx_L0;
11505 
11506   /* "View.MemoryView":590
11507  *
11508  *     @property
11509  *     def size(self):             # <<<<<<<<<<<<<<
11510  *         if self._size is None:
11511  *             result = 1
11512  */
11513 
11514   /* function exit code */
11515   __pyx_L1_error:;
11516   __Pyx_XDECREF(__pyx_t_6);
11517   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11518   __pyx_r = NULL;
11519   __pyx_L0:;
11520   __Pyx_XDECREF(__pyx_v_result);
11521   __Pyx_XDECREF(__pyx_v_length);
11522   __Pyx_XGIVEREF(__pyx_r);
11523   __Pyx_RefNannyFinishContext();
11524   return __pyx_r;
11525 }
11526 
11527 /* "View.MemoryView":601
11528  *         return self._size
11529  *
11530  *     def __len__(self):             # <<<<<<<<<<<<<<
11531  *         if self.view.ndim >= 1:
11532  *             return self.view.shape[0]
11533  */
11534 
11535 /* Python wrapper */
11536 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)11537 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11538   Py_ssize_t __pyx_r;
11539   __Pyx_RefNannyDeclarations
11540   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11541   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11542 
11543   /* function exit code */
11544   __Pyx_RefNannyFinishContext();
11545   return __pyx_r;
11546 }
11547 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)11548 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11549   Py_ssize_t __pyx_r;
11550   __Pyx_RefNannyDeclarations
11551   int __pyx_t_1;
11552   __Pyx_RefNannySetupContext("__len__", 0);
11553 
11554   /* "View.MemoryView":602
11555  *
11556  *     def __len__(self):
11557  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
11558  *             return self.view.shape[0]
11559  *
11560  */
11561   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
11562   if (__pyx_t_1) {
11563 
11564     /* "View.MemoryView":603
11565  *     def __len__(self):
11566  *         if self.view.ndim >= 1:
11567  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
11568  *
11569  *         return 0
11570  */
11571     __pyx_r = (__pyx_v_self->view.shape[0]);
11572     goto __pyx_L0;
11573 
11574     /* "View.MemoryView":602
11575  *
11576  *     def __len__(self):
11577  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
11578  *             return self.view.shape[0]
11579  *
11580  */
11581   }
11582 
11583   /* "View.MemoryView":605
11584  *             return self.view.shape[0]
11585  *
11586  *         return 0             # <<<<<<<<<<<<<<
11587  *
11588  *     def __repr__(self):
11589  */
11590   __pyx_r = 0;
11591   goto __pyx_L0;
11592 
11593   /* "View.MemoryView":601
11594  *         return self._size
11595  *
11596  *     def __len__(self):             # <<<<<<<<<<<<<<
11597  *         if self.view.ndim >= 1:
11598  *             return self.view.shape[0]
11599  */
11600 
11601   /* function exit code */
11602   __pyx_L0:;
11603   __Pyx_RefNannyFinishContext();
11604   return __pyx_r;
11605 }
11606 
11607 /* "View.MemoryView":607
11608  *         return 0
11609  *
11610  *     def __repr__(self):             # <<<<<<<<<<<<<<
11611  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11612  *                                                id(self))
11613  */
11614 
11615 /* Python wrapper */
11616 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)11617 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11618   PyObject *__pyx_r = 0;
11619   __Pyx_RefNannyDeclarations
11620   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11621   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11622 
11623   /* function exit code */
11624   __Pyx_RefNannyFinishContext();
11625   return __pyx_r;
11626 }
11627 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)11628 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11629   PyObject *__pyx_r = NULL;
11630   __Pyx_RefNannyDeclarations
11631   PyObject *__pyx_t_1 = NULL;
11632   PyObject *__pyx_t_2 = NULL;
11633   PyObject *__pyx_t_3 = NULL;
11634   __Pyx_RefNannySetupContext("__repr__", 0);
11635 
11636   /* "View.MemoryView":608
11637  *
11638  *     def __repr__(self):
11639  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
11640  *                                                id(self))
11641  *
11642  */
11643   __Pyx_XDECREF(__pyx_r);
11644   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
11645   __Pyx_GOTREF(__pyx_t_1);
11646   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
11647   __Pyx_GOTREF(__pyx_t_2);
11648   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11649   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
11650   __Pyx_GOTREF(__pyx_t_1);
11651   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11652 
11653   /* "View.MemoryView":609
11654  *     def __repr__(self):
11655  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11656  *                                                id(self))             # <<<<<<<<<<<<<<
11657  *
11658  *     def __str__(self):
11659  */
11660   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
11661   __Pyx_GOTREF(__pyx_t_2);
11662 
11663   /* "View.MemoryView":608
11664  *
11665  *     def __repr__(self):
11666  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
11667  *                                                id(self))
11668  *
11669  */
11670   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
11671   __Pyx_GOTREF(__pyx_t_3);
11672   __Pyx_GIVEREF(__pyx_t_1);
11673   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
11674   __Pyx_GIVEREF(__pyx_t_2);
11675   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
11676   __pyx_t_1 = 0;
11677   __pyx_t_2 = 0;
11678   __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(1, 608, __pyx_L1_error)
11679   __Pyx_GOTREF(__pyx_t_2);
11680   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11681   __pyx_r = __pyx_t_2;
11682   __pyx_t_2 = 0;
11683   goto __pyx_L0;
11684 
11685   /* "View.MemoryView":607
11686  *         return 0
11687  *
11688  *     def __repr__(self):             # <<<<<<<<<<<<<<
11689  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11690  *                                                id(self))
11691  */
11692 
11693   /* function exit code */
11694   __pyx_L1_error:;
11695   __Pyx_XDECREF(__pyx_t_1);
11696   __Pyx_XDECREF(__pyx_t_2);
11697   __Pyx_XDECREF(__pyx_t_3);
11698   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11699   __pyx_r = NULL;
11700   __pyx_L0:;
11701   __Pyx_XGIVEREF(__pyx_r);
11702   __Pyx_RefNannyFinishContext();
11703   return __pyx_r;
11704 }
11705 
11706 /* "View.MemoryView":611
11707  *                                                id(self))
11708  *
11709  *     def __str__(self):             # <<<<<<<<<<<<<<
11710  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11711  *
11712  */
11713 
11714 /* Python wrapper */
11715 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)11716 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11717   PyObject *__pyx_r = 0;
11718   __Pyx_RefNannyDeclarations
11719   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11720   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11721 
11722   /* function exit code */
11723   __Pyx_RefNannyFinishContext();
11724   return __pyx_r;
11725 }
11726 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)11727 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11728   PyObject *__pyx_r = NULL;
11729   __Pyx_RefNannyDeclarations
11730   PyObject *__pyx_t_1 = NULL;
11731   PyObject *__pyx_t_2 = NULL;
11732   __Pyx_RefNannySetupContext("__str__", 0);
11733 
11734   /* "View.MemoryView":612
11735  *
11736  *     def __str__(self):
11737  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
11738  *
11739  *
11740  */
11741   __Pyx_XDECREF(__pyx_r);
11742   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
11743   __Pyx_GOTREF(__pyx_t_1);
11744   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
11745   __Pyx_GOTREF(__pyx_t_2);
11746   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11747   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
11748   __Pyx_GOTREF(__pyx_t_1);
11749   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11750   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
11751   __Pyx_GOTREF(__pyx_t_2);
11752   __Pyx_GIVEREF(__pyx_t_1);
11753   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
11754   __pyx_t_1 = 0;
11755   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
11756   __Pyx_GOTREF(__pyx_t_1);
11757   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11758   __pyx_r = __pyx_t_1;
11759   __pyx_t_1 = 0;
11760   goto __pyx_L0;
11761 
11762   /* "View.MemoryView":611
11763  *                                                id(self))
11764  *
11765  *     def __str__(self):             # <<<<<<<<<<<<<<
11766  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11767  *
11768  */
11769 
11770   /* function exit code */
11771   __pyx_L1_error:;
11772   __Pyx_XDECREF(__pyx_t_1);
11773   __Pyx_XDECREF(__pyx_t_2);
11774   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11775   __pyx_r = NULL;
11776   __pyx_L0:;
11777   __Pyx_XGIVEREF(__pyx_r);
11778   __Pyx_RefNannyFinishContext();
11779   return __pyx_r;
11780 }
11781 
11782 /* "View.MemoryView":615
11783  *
11784  *
11785  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
11786  *         cdef __Pyx_memviewslice *mslice
11787  *         cdef __Pyx_memviewslice tmp
11788  */
11789 
11790 /* Python wrapper */
11791 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)11792 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11793   PyObject *__pyx_r = 0;
11794   __Pyx_RefNannyDeclarations
11795   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11796   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11797 
11798   /* function exit code */
11799   __Pyx_RefNannyFinishContext();
11800   return __pyx_r;
11801 }
11802 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)11803 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11804   __Pyx_memviewslice *__pyx_v_mslice;
11805   __Pyx_memviewslice __pyx_v_tmp;
11806   PyObject *__pyx_r = NULL;
11807   __Pyx_RefNannyDeclarations
11808   PyObject *__pyx_t_1 = NULL;
11809   __Pyx_RefNannySetupContext("is_c_contig", 0);
11810 
11811   /* "View.MemoryView":618
11812  *         cdef __Pyx_memviewslice *mslice
11813  *         cdef __Pyx_memviewslice tmp
11814  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
11815  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
11816  *
11817  */
11818   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
11819 
11820   /* "View.MemoryView":619
11821  *         cdef __Pyx_memviewslice tmp
11822  *         mslice = get_slice_from_memview(self, &tmp)
11823  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
11824  *
11825  *     def is_f_contig(self):
11826  */
11827   __Pyx_XDECREF(__pyx_r);
11828   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
11829   __Pyx_GOTREF(__pyx_t_1);
11830   __pyx_r = __pyx_t_1;
11831   __pyx_t_1 = 0;
11832   goto __pyx_L0;
11833 
11834   /* "View.MemoryView":615
11835  *
11836  *
11837  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
11838  *         cdef __Pyx_memviewslice *mslice
11839  *         cdef __Pyx_memviewslice tmp
11840  */
11841 
11842   /* function exit code */
11843   __pyx_L1_error:;
11844   __Pyx_XDECREF(__pyx_t_1);
11845   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11846   __pyx_r = NULL;
11847   __pyx_L0:;
11848   __Pyx_XGIVEREF(__pyx_r);
11849   __Pyx_RefNannyFinishContext();
11850   return __pyx_r;
11851 }
11852 
11853 /* "View.MemoryView":621
11854  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
11855  *
11856  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
11857  *         cdef __Pyx_memviewslice *mslice
11858  *         cdef __Pyx_memviewslice tmp
11859  */
11860 
11861 /* Python wrapper */
11862 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)11863 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11864   PyObject *__pyx_r = 0;
11865   __Pyx_RefNannyDeclarations
11866   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11867   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11868 
11869   /* function exit code */
11870   __Pyx_RefNannyFinishContext();
11871   return __pyx_r;
11872 }
11873 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)11874 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11875   __Pyx_memviewslice *__pyx_v_mslice;
11876   __Pyx_memviewslice __pyx_v_tmp;
11877   PyObject *__pyx_r = NULL;
11878   __Pyx_RefNannyDeclarations
11879   PyObject *__pyx_t_1 = NULL;
11880   __Pyx_RefNannySetupContext("is_f_contig", 0);
11881 
11882   /* "View.MemoryView":624
11883  *         cdef __Pyx_memviewslice *mslice
11884  *         cdef __Pyx_memviewslice tmp
11885  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
11886  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
11887  *
11888  */
11889   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
11890 
11891   /* "View.MemoryView":625
11892  *         cdef __Pyx_memviewslice tmp
11893  *         mslice = get_slice_from_memview(self, &tmp)
11894  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
11895  *
11896  *     def copy(self):
11897  */
11898   __Pyx_XDECREF(__pyx_r);
11899   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
11900   __Pyx_GOTREF(__pyx_t_1);
11901   __pyx_r = __pyx_t_1;
11902   __pyx_t_1 = 0;
11903   goto __pyx_L0;
11904 
11905   /* "View.MemoryView":621
11906  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
11907  *
11908  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
11909  *         cdef __Pyx_memviewslice *mslice
11910  *         cdef __Pyx_memviewslice tmp
11911  */
11912 
11913   /* function exit code */
11914   __pyx_L1_error:;
11915   __Pyx_XDECREF(__pyx_t_1);
11916   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11917   __pyx_r = NULL;
11918   __pyx_L0:;
11919   __Pyx_XGIVEREF(__pyx_r);
11920   __Pyx_RefNannyFinishContext();
11921   return __pyx_r;
11922 }
11923 
11924 /* "View.MemoryView":627
11925  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
11926  *
11927  *     def copy(self):             # <<<<<<<<<<<<<<
11928  *         cdef __Pyx_memviewslice mslice
11929  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11930  */
11931 
11932 /* Python wrapper */
11933 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)11934 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11935   PyObject *__pyx_r = 0;
11936   __Pyx_RefNannyDeclarations
11937   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11938   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11939 
11940   /* function exit code */
11941   __Pyx_RefNannyFinishContext();
11942   return __pyx_r;
11943 }
11944 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)11945 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11946   __Pyx_memviewslice __pyx_v_mslice;
11947   int __pyx_v_flags;
11948   PyObject *__pyx_r = NULL;
11949   __Pyx_RefNannyDeclarations
11950   __Pyx_memviewslice __pyx_t_1;
11951   PyObject *__pyx_t_2 = NULL;
11952   __Pyx_RefNannySetupContext("copy", 0);
11953 
11954   /* "View.MemoryView":629
11955  *     def copy(self):
11956  *         cdef __Pyx_memviewslice mslice
11957  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
11958  *
11959  *         slice_copy(self, &mslice)
11960  */
11961   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11962 
11963   /* "View.MemoryView":631
11964  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11965  *
11966  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
11967  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11968  *                                    self.view.itemsize,
11969  */
11970   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11971 
11972   /* "View.MemoryView":632
11973  *
11974  *         slice_copy(self, &mslice)
11975  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
11976  *                                    self.view.itemsize,
11977  *                                    flags|PyBUF_C_CONTIGUOUS,
11978  */
11979   __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(1, 632, __pyx_L1_error)
11980   __pyx_v_mslice = __pyx_t_1;
11981 
11982   /* "View.MemoryView":637
11983  *                                    self.dtype_is_object)
11984  *
11985  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
11986  *
11987  *     def copy_fortran(self):
11988  */
11989   __Pyx_XDECREF(__pyx_r);
11990   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
11991   __Pyx_GOTREF(__pyx_t_2);
11992   __pyx_r = __pyx_t_2;
11993   __pyx_t_2 = 0;
11994   goto __pyx_L0;
11995 
11996   /* "View.MemoryView":627
11997  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
11998  *
11999  *     def copy(self):             # <<<<<<<<<<<<<<
12000  *         cdef __Pyx_memviewslice mslice
12001  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12002  */
12003 
12004   /* function exit code */
12005   __pyx_L1_error:;
12006   __Pyx_XDECREF(__pyx_t_2);
12007   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12008   __pyx_r = NULL;
12009   __pyx_L0:;
12010   __Pyx_XGIVEREF(__pyx_r);
12011   __Pyx_RefNannyFinishContext();
12012   return __pyx_r;
12013 }
12014 
12015 /* "View.MemoryView":639
12016  *         return memoryview_copy_from_slice(self, &mslice)
12017  *
12018  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
12019  *         cdef __Pyx_memviewslice src, dst
12020  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12021  */
12022 
12023 /* Python wrapper */
12024 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)12025 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12026   PyObject *__pyx_r = 0;
12027   __Pyx_RefNannyDeclarations
12028   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12029   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12030 
12031   /* function exit code */
12032   __Pyx_RefNannyFinishContext();
12033   return __pyx_r;
12034 }
12035 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)12036 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12037   __Pyx_memviewslice __pyx_v_src;
12038   __Pyx_memviewslice __pyx_v_dst;
12039   int __pyx_v_flags;
12040   PyObject *__pyx_r = NULL;
12041   __Pyx_RefNannyDeclarations
12042   __Pyx_memviewslice __pyx_t_1;
12043   PyObject *__pyx_t_2 = NULL;
12044   __Pyx_RefNannySetupContext("copy_fortran", 0);
12045 
12046   /* "View.MemoryView":641
12047  *     def copy_fortran(self):
12048  *         cdef __Pyx_memviewslice src, dst
12049  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
12050  *
12051  *         slice_copy(self, &src)
12052  */
12053   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12054 
12055   /* "View.MemoryView":643
12056  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12057  *
12058  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
12059  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12060  *                                 self.view.itemsize,
12061  */
12062   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12063 
12064   /* "View.MemoryView":644
12065  *
12066  *         slice_copy(self, &src)
12067  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
12068  *                                 self.view.itemsize,
12069  *                                 flags|PyBUF_F_CONTIGUOUS,
12070  */
12071   __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(1, 644, __pyx_L1_error)
12072   __pyx_v_dst = __pyx_t_1;
12073 
12074   /* "View.MemoryView":649
12075  *                                 self.dtype_is_object)
12076  *
12077  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
12078  *
12079  *
12080  */
12081   __Pyx_XDECREF(__pyx_r);
12082   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
12083   __Pyx_GOTREF(__pyx_t_2);
12084   __pyx_r = __pyx_t_2;
12085   __pyx_t_2 = 0;
12086   goto __pyx_L0;
12087 
12088   /* "View.MemoryView":639
12089  *         return memoryview_copy_from_slice(self, &mslice)
12090  *
12091  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
12092  *         cdef __Pyx_memviewslice src, dst
12093  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12094  */
12095 
12096   /* function exit code */
12097   __pyx_L1_error:;
12098   __Pyx_XDECREF(__pyx_t_2);
12099   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __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 /* "(tree fragment)":1
12108  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12109  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12110  * def __setstate_cython__(self, __pyx_state):
12111  */
12112 
12113 /* Python wrapper */
12114 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)12115 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12116   PyObject *__pyx_r = 0;
12117   __Pyx_RefNannyDeclarations
12118   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12119   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12120 
12121   /* function exit code */
12122   __Pyx_RefNannyFinishContext();
12123   return __pyx_r;
12124 }
12125 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)12126 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12127   PyObject *__pyx_r = NULL;
12128   __Pyx_RefNannyDeclarations
12129   PyObject *__pyx_t_1 = NULL;
12130   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12131 
12132   /* "(tree fragment)":2
12133  * def __reduce_cython__(self):
12134  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
12135  * def __setstate_cython__(self, __pyx_state):
12136  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12137  */
12138   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
12139   __Pyx_GOTREF(__pyx_t_1);
12140   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12141   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12142   __PYX_ERR(1, 2, __pyx_L1_error)
12143 
12144   /* "(tree fragment)":1
12145  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12146  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12147  * def __setstate_cython__(self, __pyx_state):
12148  */
12149 
12150   /* function exit code */
12151   __pyx_L1_error:;
12152   __Pyx_XDECREF(__pyx_t_1);
12153   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12154   __pyx_r = NULL;
12155   __Pyx_XGIVEREF(__pyx_r);
12156   __Pyx_RefNannyFinishContext();
12157   return __pyx_r;
12158 }
12159 
12160 /* "(tree fragment)":3
12161  * def __reduce_cython__(self):
12162  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12163  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12164  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12165  */
12166 
12167 /* Python wrapper */
12168 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)12169 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12170   PyObject *__pyx_r = 0;
12171   __Pyx_RefNannyDeclarations
12172   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12173   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12174 
12175   /* function exit code */
12176   __Pyx_RefNannyFinishContext();
12177   return __pyx_r;
12178 }
12179 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12180 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) {
12181   PyObject *__pyx_r = NULL;
12182   __Pyx_RefNannyDeclarations
12183   PyObject *__pyx_t_1 = NULL;
12184   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12185 
12186   /* "(tree fragment)":4
12187  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12188  * def __setstate_cython__(self, __pyx_state):
12189  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
12190  */
12191   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
12192   __Pyx_GOTREF(__pyx_t_1);
12193   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12194   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12195   __PYX_ERR(1, 4, __pyx_L1_error)
12196 
12197   /* "(tree fragment)":3
12198  * def __reduce_cython__(self):
12199  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12200  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12201  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12202  */
12203 
12204   /* function exit code */
12205   __pyx_L1_error:;
12206   __Pyx_XDECREF(__pyx_t_1);
12207   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12208   __pyx_r = NULL;
12209   __Pyx_XGIVEREF(__pyx_r);
12210   __Pyx_RefNannyFinishContext();
12211   return __pyx_r;
12212 }
12213 
12214 /* "View.MemoryView":653
12215  *
12216  * @cname('__pyx_memoryview_new')
12217  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
12218  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12219  *     result.typeinfo = typeinfo
12220  */
12221 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)12222 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12223   struct __pyx_memoryview_obj *__pyx_v_result = 0;
12224   PyObject *__pyx_r = NULL;
12225   __Pyx_RefNannyDeclarations
12226   PyObject *__pyx_t_1 = NULL;
12227   PyObject *__pyx_t_2 = NULL;
12228   PyObject *__pyx_t_3 = NULL;
12229   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12230 
12231   /* "View.MemoryView":654
12232  * @cname('__pyx_memoryview_new')
12233  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12234  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
12235  *     result.typeinfo = typeinfo
12236  *     return result
12237  */
12238   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
12239   __Pyx_GOTREF(__pyx_t_1);
12240   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
12241   __Pyx_GOTREF(__pyx_t_2);
12242   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
12243   __Pyx_GOTREF(__pyx_t_3);
12244   __Pyx_INCREF(__pyx_v_o);
12245   __Pyx_GIVEREF(__pyx_v_o);
12246   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
12247   __Pyx_GIVEREF(__pyx_t_1);
12248   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12249   __Pyx_GIVEREF(__pyx_t_2);
12250   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12251   __pyx_t_1 = 0;
12252   __pyx_t_2 = 0;
12253   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
12254   __Pyx_GOTREF(__pyx_t_2);
12255   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12256   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12257   __pyx_t_2 = 0;
12258 
12259   /* "View.MemoryView":655
12260  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12261  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12262  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
12263  *     return result
12264  *
12265  */
12266   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12267 
12268   /* "View.MemoryView":656
12269  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12270  *     result.typeinfo = typeinfo
12271  *     return result             # <<<<<<<<<<<<<<
12272  *
12273  * @cname('__pyx_memoryview_check')
12274  */
12275   __Pyx_XDECREF(__pyx_r);
12276   __Pyx_INCREF(((PyObject *)__pyx_v_result));
12277   __pyx_r = ((PyObject *)__pyx_v_result);
12278   goto __pyx_L0;
12279 
12280   /* "View.MemoryView":653
12281  *
12282  * @cname('__pyx_memoryview_new')
12283  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
12284  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
12285  *     result.typeinfo = typeinfo
12286  */
12287 
12288   /* function exit code */
12289   __pyx_L1_error:;
12290   __Pyx_XDECREF(__pyx_t_1);
12291   __Pyx_XDECREF(__pyx_t_2);
12292   __Pyx_XDECREF(__pyx_t_3);
12293   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12294   __pyx_r = 0;
12295   __pyx_L0:;
12296   __Pyx_XDECREF((PyObject *)__pyx_v_result);
12297   __Pyx_XGIVEREF(__pyx_r);
12298   __Pyx_RefNannyFinishContext();
12299   return __pyx_r;
12300 }
12301 
12302 /* "View.MemoryView":659
12303  *
12304  * @cname('__pyx_memoryview_check')
12305  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
12306  *     return isinstance(o, memoryview)
12307  *
12308  */
12309 
__pyx_memoryview_check(PyObject * __pyx_v_o)12310 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12311   int __pyx_r;
12312   __Pyx_RefNannyDeclarations
12313   int __pyx_t_1;
12314   __Pyx_RefNannySetupContext("memoryview_check", 0);
12315 
12316   /* "View.MemoryView":660
12317  * @cname('__pyx_memoryview_check')
12318  * cdef inline bint memoryview_check(object o):
12319  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
12320  *
12321  * cdef tuple _unellipsify(object index, int ndim):
12322  */
12323   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12324   __pyx_r = __pyx_t_1;
12325   goto __pyx_L0;
12326 
12327   /* "View.MemoryView":659
12328  *
12329  * @cname('__pyx_memoryview_check')
12330  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
12331  *     return isinstance(o, memoryview)
12332  *
12333  */
12334 
12335   /* function exit code */
12336   __pyx_L0:;
12337   __Pyx_RefNannyFinishContext();
12338   return __pyx_r;
12339 }
12340 
12341 /* "View.MemoryView":662
12342  *     return isinstance(o, memoryview)
12343  *
12344  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
12345  *     """
12346  *     Replace all ellipses with full slices and fill incomplete indices with
12347  */
12348 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)12349 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12350   PyObject *__pyx_v_tup = NULL;
12351   PyObject *__pyx_v_result = NULL;
12352   int __pyx_v_have_slices;
12353   int __pyx_v_seen_ellipsis;
12354   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
12355   PyObject *__pyx_v_item = NULL;
12356   Py_ssize_t __pyx_v_nslices;
12357   PyObject *__pyx_r = NULL;
12358   __Pyx_RefNannyDeclarations
12359   int __pyx_t_1;
12360   int __pyx_t_2;
12361   PyObject *__pyx_t_3 = NULL;
12362   PyObject *__pyx_t_4 = NULL;
12363   Py_ssize_t __pyx_t_5;
12364   PyObject *(*__pyx_t_6)(PyObject *);
12365   PyObject *__pyx_t_7 = NULL;
12366   Py_ssize_t __pyx_t_8;
12367   int __pyx_t_9;
12368   int __pyx_t_10;
12369   PyObject *__pyx_t_11 = NULL;
12370   __Pyx_RefNannySetupContext("_unellipsify", 0);
12371 
12372   /* "View.MemoryView":667
12373  *     full slices.
12374  *     """
12375  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
12376  *         tup = (index,)
12377  *     else:
12378  */
12379   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12380   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12381   if (__pyx_t_2) {
12382 
12383     /* "View.MemoryView":668
12384  *     """
12385  *     if not isinstance(index, tuple):
12386  *         tup = (index,)             # <<<<<<<<<<<<<<
12387  *     else:
12388  *         tup = index
12389  */
12390     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
12391     __Pyx_GOTREF(__pyx_t_3);
12392     __Pyx_INCREF(__pyx_v_index);
12393     __Pyx_GIVEREF(__pyx_v_index);
12394     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
12395     __pyx_v_tup = __pyx_t_3;
12396     __pyx_t_3 = 0;
12397 
12398     /* "View.MemoryView":667
12399  *     full slices.
12400  *     """
12401  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
12402  *         tup = (index,)
12403  *     else:
12404  */
12405     goto __pyx_L3;
12406   }
12407 
12408   /* "View.MemoryView":670
12409  *         tup = (index,)
12410  *     else:
12411  *         tup = index             # <<<<<<<<<<<<<<
12412  *
12413  *     result = []
12414  */
12415   /*else*/ {
12416     __Pyx_INCREF(__pyx_v_index);
12417     __pyx_v_tup = __pyx_v_index;
12418   }
12419   __pyx_L3:;
12420 
12421   /* "View.MemoryView":672
12422  *         tup = index
12423  *
12424  *     result = []             # <<<<<<<<<<<<<<
12425  *     have_slices = False
12426  *     seen_ellipsis = False
12427  */
12428   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
12429   __Pyx_GOTREF(__pyx_t_3);
12430   __pyx_v_result = ((PyObject*)__pyx_t_3);
12431   __pyx_t_3 = 0;
12432 
12433   /* "View.MemoryView":673
12434  *
12435  *     result = []
12436  *     have_slices = False             # <<<<<<<<<<<<<<
12437  *     seen_ellipsis = False
12438  *     for idx, item in enumerate(tup):
12439  */
12440   __pyx_v_have_slices = 0;
12441 
12442   /* "View.MemoryView":674
12443  *     result = []
12444  *     have_slices = False
12445  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
12446  *     for idx, item in enumerate(tup):
12447  *         if item is Ellipsis:
12448  */
12449   __pyx_v_seen_ellipsis = 0;
12450 
12451   /* "View.MemoryView":675
12452  *     have_slices = False
12453  *     seen_ellipsis = False
12454  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
12455  *         if item is Ellipsis:
12456  *             if not seen_ellipsis:
12457  */
12458   __Pyx_INCREF(__pyx_int_0);
12459   __pyx_t_3 = __pyx_int_0;
12460   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
12461     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
12462     __pyx_t_6 = NULL;
12463   } else {
12464     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
12465     __Pyx_GOTREF(__pyx_t_4);
12466     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
12467   }
12468   for (;;) {
12469     if (likely(!__pyx_t_6)) {
12470       if (likely(PyList_CheckExact(__pyx_t_4))) {
12471         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
12472         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12473         __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(1, 675, __pyx_L1_error)
12474         #else
12475         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
12476         __Pyx_GOTREF(__pyx_t_7);
12477         #endif
12478       } else {
12479         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
12480         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12481         __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(1, 675, __pyx_L1_error)
12482         #else
12483         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
12484         __Pyx_GOTREF(__pyx_t_7);
12485         #endif
12486       }
12487     } else {
12488       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
12489       if (unlikely(!__pyx_t_7)) {
12490         PyObject* exc_type = PyErr_Occurred();
12491         if (exc_type) {
12492           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12493           else __PYX_ERR(1, 675, __pyx_L1_error)
12494         }
12495         break;
12496       }
12497       __Pyx_GOTREF(__pyx_t_7);
12498     }
12499     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
12500     __pyx_t_7 = 0;
12501     __Pyx_INCREF(__pyx_t_3);
12502     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
12503     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
12504     __Pyx_GOTREF(__pyx_t_7);
12505     __Pyx_DECREF(__pyx_t_3);
12506     __pyx_t_3 = __pyx_t_7;
12507     __pyx_t_7 = 0;
12508 
12509     /* "View.MemoryView":676
12510  *     seen_ellipsis = False
12511  *     for idx, item in enumerate(tup):
12512  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
12513  *             if not seen_ellipsis:
12514  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12515  */
12516     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12517     __pyx_t_1 = (__pyx_t_2 != 0);
12518     if (__pyx_t_1) {
12519 
12520       /* "View.MemoryView":677
12521  *     for idx, item in enumerate(tup):
12522  *         if item is Ellipsis:
12523  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
12524  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12525  *                 seen_ellipsis = True
12526  */
12527       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
12528       if (__pyx_t_1) {
12529 
12530         /* "View.MemoryView":678
12531  *         if item is Ellipsis:
12532  *             if not seen_ellipsis:
12533  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
12534  *                 seen_ellipsis = True
12535  *             else:
12536  */
12537         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
12538         __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(1, 678, __pyx_L1_error)
12539         __Pyx_GOTREF(__pyx_t_7);
12540         { Py_ssize_t __pyx_temp;
12541           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
12542             __Pyx_INCREF(__pyx_slice__24);
12543             __Pyx_GIVEREF(__pyx_slice__24);
12544             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24);
12545           }
12546         }
12547         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
12548         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12549 
12550         /* "View.MemoryView":679
12551  *             if not seen_ellipsis:
12552  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12553  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
12554  *             else:
12555  *                 result.append(slice(None))
12556  */
12557         __pyx_v_seen_ellipsis = 1;
12558 
12559         /* "View.MemoryView":677
12560  *     for idx, item in enumerate(tup):
12561  *         if item is Ellipsis:
12562  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
12563  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12564  *                 seen_ellipsis = True
12565  */
12566         goto __pyx_L7;
12567       }
12568 
12569       /* "View.MemoryView":681
12570  *                 seen_ellipsis = True
12571  *             else:
12572  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
12573  *             have_slices = True
12574  *         else:
12575  */
12576       /*else*/ {
12577         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
12578       }
12579       __pyx_L7:;
12580 
12581       /* "View.MemoryView":682
12582  *             else:
12583  *                 result.append(slice(None))
12584  *             have_slices = True             # <<<<<<<<<<<<<<
12585  *         else:
12586  *             if not isinstance(item, slice) and not PyIndex_Check(item):
12587  */
12588       __pyx_v_have_slices = 1;
12589 
12590       /* "View.MemoryView":676
12591  *     seen_ellipsis = False
12592  *     for idx, item in enumerate(tup):
12593  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
12594  *             if not seen_ellipsis:
12595  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
12596  */
12597       goto __pyx_L6;
12598     }
12599 
12600     /* "View.MemoryView":684
12601  *             have_slices = True
12602  *         else:
12603  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
12604  *                 raise TypeError("Cannot index with type '%s'" % type(item))
12605  *
12606  */
12607     /*else*/ {
12608       __pyx_t_2 = PySlice_Check(__pyx_v_item);
12609       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
12610       if (__pyx_t_10) {
12611       } else {
12612         __pyx_t_1 = __pyx_t_10;
12613         goto __pyx_L9_bool_binop_done;
12614       }
12615       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
12616       __pyx_t_1 = __pyx_t_10;
12617       __pyx_L9_bool_binop_done:;
12618       if (unlikely(__pyx_t_1)) {
12619 
12620         /* "View.MemoryView":685
12621  *         else:
12622  *             if not isinstance(item, slice) and not PyIndex_Check(item):
12623  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
12624  *
12625  *             have_slices = have_slices or isinstance(item, slice)
12626  */
12627         __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(1, 685, __pyx_L1_error)
12628         __Pyx_GOTREF(__pyx_t_7);
12629         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
12630         __Pyx_GOTREF(__pyx_t_11);
12631         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12632         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
12633         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12634         __PYX_ERR(1, 685, __pyx_L1_error)
12635 
12636         /* "View.MemoryView":684
12637  *             have_slices = True
12638  *         else:
12639  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
12640  *                 raise TypeError("Cannot index with type '%s'" % type(item))
12641  *
12642  */
12643       }
12644 
12645       /* "View.MemoryView":687
12646  *                 raise TypeError("Cannot index with type '%s'" % type(item))
12647  *
12648  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
12649  *             result.append(item)
12650  *
12651  */
12652       __pyx_t_10 = (__pyx_v_have_slices != 0);
12653       if (!__pyx_t_10) {
12654       } else {
12655         __pyx_t_1 = __pyx_t_10;
12656         goto __pyx_L11_bool_binop_done;
12657       }
12658       __pyx_t_10 = PySlice_Check(__pyx_v_item);
12659       __pyx_t_2 = (__pyx_t_10 != 0);
12660       __pyx_t_1 = __pyx_t_2;
12661       __pyx_L11_bool_binop_done:;
12662       __pyx_v_have_slices = __pyx_t_1;
12663 
12664       /* "View.MemoryView":688
12665  *
12666  *             have_slices = have_slices or isinstance(item, slice)
12667  *             result.append(item)             # <<<<<<<<<<<<<<
12668  *
12669  *     nslices = ndim - len(result)
12670  */
12671       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
12672     }
12673     __pyx_L6:;
12674 
12675     /* "View.MemoryView":675
12676  *     have_slices = False
12677  *     seen_ellipsis = False
12678  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
12679  *         if item is Ellipsis:
12680  *             if not seen_ellipsis:
12681  */
12682   }
12683   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12684   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12685 
12686   /* "View.MemoryView":690
12687  *             result.append(item)
12688  *
12689  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
12690  *     if nslices:
12691  *         result.extend([slice(None)] * nslices)
12692  */
12693   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
12694   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
12695 
12696   /* "View.MemoryView":691
12697  *
12698  *     nslices = ndim - len(result)
12699  *     if nslices:             # <<<<<<<<<<<<<<
12700  *         result.extend([slice(None)] * nslices)
12701  *
12702  */
12703   __pyx_t_1 = (__pyx_v_nslices != 0);
12704   if (__pyx_t_1) {
12705 
12706     /* "View.MemoryView":692
12707  *     nslices = ndim - len(result)
12708  *     if nslices:
12709  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
12710  *
12711  *     return have_slices or nslices, tuple(result)
12712  */
12713     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
12714     __Pyx_GOTREF(__pyx_t_3);
12715     { Py_ssize_t __pyx_temp;
12716       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
12717         __Pyx_INCREF(__pyx_slice__24);
12718         __Pyx_GIVEREF(__pyx_slice__24);
12719         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24);
12720       }
12721     }
12722     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
12723     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12724 
12725     /* "View.MemoryView":691
12726  *
12727  *     nslices = ndim - len(result)
12728  *     if nslices:             # <<<<<<<<<<<<<<
12729  *         result.extend([slice(None)] * nslices)
12730  *
12731  */
12732   }
12733 
12734   /* "View.MemoryView":694
12735  *         result.extend([slice(None)] * nslices)
12736  *
12737  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
12738  *
12739  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12740  */
12741   __Pyx_XDECREF(__pyx_r);
12742   if (!__pyx_v_have_slices) {
12743   } else {
12744     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
12745     __Pyx_GOTREF(__pyx_t_4);
12746     __pyx_t_3 = __pyx_t_4;
12747     __pyx_t_4 = 0;
12748     goto __pyx_L14_bool_binop_done;
12749   }
12750   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
12751   __Pyx_GOTREF(__pyx_t_4);
12752   __pyx_t_3 = __pyx_t_4;
12753   __pyx_t_4 = 0;
12754   __pyx_L14_bool_binop_done:;
12755   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
12756   __Pyx_GOTREF(__pyx_t_4);
12757   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
12758   __Pyx_GOTREF(__pyx_t_11);
12759   __Pyx_GIVEREF(__pyx_t_3);
12760   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
12761   __Pyx_GIVEREF(__pyx_t_4);
12762   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
12763   __pyx_t_3 = 0;
12764   __pyx_t_4 = 0;
12765   __pyx_r = ((PyObject*)__pyx_t_11);
12766   __pyx_t_11 = 0;
12767   goto __pyx_L0;
12768 
12769   /* "View.MemoryView":662
12770  *     return isinstance(o, memoryview)
12771  *
12772  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
12773  *     """
12774  *     Replace all ellipses with full slices and fill incomplete indices with
12775  */
12776 
12777   /* function exit code */
12778   __pyx_L1_error:;
12779   __Pyx_XDECREF(__pyx_t_3);
12780   __Pyx_XDECREF(__pyx_t_4);
12781   __Pyx_XDECREF(__pyx_t_7);
12782   __Pyx_XDECREF(__pyx_t_11);
12783   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12784   __pyx_r = 0;
12785   __pyx_L0:;
12786   __Pyx_XDECREF(__pyx_v_tup);
12787   __Pyx_XDECREF(__pyx_v_result);
12788   __Pyx_XDECREF(__pyx_v_idx);
12789   __Pyx_XDECREF(__pyx_v_item);
12790   __Pyx_XGIVEREF(__pyx_r);
12791   __Pyx_RefNannyFinishContext();
12792   return __pyx_r;
12793 }
12794 
12795 /* "View.MemoryView":696
12796  *     return have_slices or nslices, tuple(result)
12797  *
12798  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
12799  *     for suboffset in suboffsets[:ndim]:
12800  *         if suboffset >= 0:
12801  */
12802 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)12803 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12804   Py_ssize_t __pyx_v_suboffset;
12805   PyObject *__pyx_r = NULL;
12806   __Pyx_RefNannyDeclarations
12807   Py_ssize_t *__pyx_t_1;
12808   Py_ssize_t *__pyx_t_2;
12809   Py_ssize_t *__pyx_t_3;
12810   int __pyx_t_4;
12811   PyObject *__pyx_t_5 = NULL;
12812   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
12813 
12814   /* "View.MemoryView":697
12815  *
12816  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12817  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
12818  *         if suboffset >= 0:
12819  *             raise ValueError("Indirect dimensions not supported")
12820  */
12821   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12822   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12823     __pyx_t_1 = __pyx_t_3;
12824     __pyx_v_suboffset = (__pyx_t_1[0]);
12825 
12826     /* "View.MemoryView":698
12827  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12828  *     for suboffset in suboffsets[:ndim]:
12829  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
12830  *             raise ValueError("Indirect dimensions not supported")
12831  *
12832  */
12833     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
12834     if (unlikely(__pyx_t_4)) {
12835 
12836       /* "View.MemoryView":699
12837  *     for suboffset in suboffsets[:ndim]:
12838  *         if suboffset >= 0:
12839  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
12840  *
12841  *
12842  */
12843       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
12844       __Pyx_GOTREF(__pyx_t_5);
12845       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
12846       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12847       __PYX_ERR(1, 699, __pyx_L1_error)
12848 
12849       /* "View.MemoryView":698
12850  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12851  *     for suboffset in suboffsets[:ndim]:
12852  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
12853  *             raise ValueError("Indirect dimensions not supported")
12854  *
12855  */
12856     }
12857   }
12858 
12859   /* "View.MemoryView":696
12860  *     return have_slices or nslices, tuple(result)
12861  *
12862  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
12863  *     for suboffset in suboffsets[:ndim]:
12864  *         if suboffset >= 0:
12865  */
12866 
12867   /* function exit code */
12868   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12869   goto __pyx_L0;
12870   __pyx_L1_error:;
12871   __Pyx_XDECREF(__pyx_t_5);
12872   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12873   __pyx_r = 0;
12874   __pyx_L0:;
12875   __Pyx_XGIVEREF(__pyx_r);
12876   __Pyx_RefNannyFinishContext();
12877   return __pyx_r;
12878 }
12879 
12880 /* "View.MemoryView":706
12881  *
12882  * @cname('__pyx_memview_slice')
12883  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
12884  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
12885  *     cdef bint negative_step
12886  */
12887 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)12888 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12889   int __pyx_v_new_ndim;
12890   int __pyx_v_suboffset_dim;
12891   int __pyx_v_dim;
12892   __Pyx_memviewslice __pyx_v_src;
12893   __Pyx_memviewslice __pyx_v_dst;
12894   __Pyx_memviewslice *__pyx_v_p_src;
12895   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12896   __Pyx_memviewslice *__pyx_v_p_dst;
12897   int *__pyx_v_p_suboffset_dim;
12898   Py_ssize_t __pyx_v_start;
12899   Py_ssize_t __pyx_v_stop;
12900   Py_ssize_t __pyx_v_step;
12901   int __pyx_v_have_start;
12902   int __pyx_v_have_stop;
12903   int __pyx_v_have_step;
12904   PyObject *__pyx_v_index = NULL;
12905   struct __pyx_memoryview_obj *__pyx_r = NULL;
12906   __Pyx_RefNannyDeclarations
12907   int __pyx_t_1;
12908   int __pyx_t_2;
12909   PyObject *__pyx_t_3 = NULL;
12910   struct __pyx_memoryview_obj *__pyx_t_4;
12911   char *__pyx_t_5;
12912   int __pyx_t_6;
12913   Py_ssize_t __pyx_t_7;
12914   PyObject *(*__pyx_t_8)(PyObject *);
12915   PyObject *__pyx_t_9 = NULL;
12916   Py_ssize_t __pyx_t_10;
12917   int __pyx_t_11;
12918   Py_ssize_t __pyx_t_12;
12919   __Pyx_RefNannySetupContext("memview_slice", 0);
12920 
12921   /* "View.MemoryView":707
12922  * @cname('__pyx_memview_slice')
12923  * cdef memoryview memview_slice(memoryview memview, object indices):
12924  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
12925  *     cdef bint negative_step
12926  *     cdef __Pyx_memviewslice src, dst
12927  */
12928   __pyx_v_new_ndim = 0;
12929   __pyx_v_suboffset_dim = -1;
12930 
12931   /* "View.MemoryView":714
12932  *
12933  *
12934  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
12935  *
12936  *     cdef _memoryviewslice memviewsliceobj
12937  */
12938   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12939 
12940   /* "View.MemoryView":718
12941  *     cdef _memoryviewslice memviewsliceobj
12942  *
12943  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
12944  *
12945  *     if isinstance(memview, _memoryviewslice):
12946  */
12947   #ifndef CYTHON_WITHOUT_ASSERTIONS
12948   if (unlikely(!Py_OptimizeFlag)) {
12949     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
12950       PyErr_SetNone(PyExc_AssertionError);
12951       __PYX_ERR(1, 718, __pyx_L1_error)
12952     }
12953   }
12954   #endif
12955 
12956   /* "View.MemoryView":720
12957  *     assert memview.view.ndim > 0
12958  *
12959  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
12960  *         memviewsliceobj = memview
12961  *         p_src = &memviewsliceobj.from_slice
12962  */
12963   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12964   __pyx_t_2 = (__pyx_t_1 != 0);
12965   if (__pyx_t_2) {
12966 
12967     /* "View.MemoryView":721
12968  *
12969  *     if isinstance(memview, _memoryviewslice):
12970  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
12971  *         p_src = &memviewsliceobj.from_slice
12972  *     else:
12973  */
12974     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
12975     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
12976     __Pyx_INCREF(__pyx_t_3);
12977     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
12978     __pyx_t_3 = 0;
12979 
12980     /* "View.MemoryView":722
12981  *     if isinstance(memview, _memoryviewslice):
12982  *         memviewsliceobj = memview
12983  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
12984  *     else:
12985  *         slice_copy(memview, &src)
12986  */
12987     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12988 
12989     /* "View.MemoryView":720
12990  *     assert memview.view.ndim > 0
12991  *
12992  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
12993  *         memviewsliceobj = memview
12994  *         p_src = &memviewsliceobj.from_slice
12995  */
12996     goto __pyx_L3;
12997   }
12998 
12999   /* "View.MemoryView":724
13000  *         p_src = &memviewsliceobj.from_slice
13001  *     else:
13002  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
13003  *         p_src = &src
13004  *
13005  */
13006   /*else*/ {
13007     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13008 
13009     /* "View.MemoryView":725
13010  *     else:
13011  *         slice_copy(memview, &src)
13012  *         p_src = &src             # <<<<<<<<<<<<<<
13013  *
13014  *
13015  */
13016     __pyx_v_p_src = (&__pyx_v_src);
13017   }
13018   __pyx_L3:;
13019 
13020   /* "View.MemoryView":731
13021  *
13022  *
13023  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
13024  *     dst.data = p_src.data
13025  *
13026  */
13027   __pyx_t_4 = __pyx_v_p_src->memview;
13028   __pyx_v_dst.memview = __pyx_t_4;
13029 
13030   /* "View.MemoryView":732
13031  *
13032  *     dst.memview = p_src.memview
13033  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
13034  *
13035  *
13036  */
13037   __pyx_t_5 = __pyx_v_p_src->data;
13038   __pyx_v_dst.data = __pyx_t_5;
13039 
13040   /* "View.MemoryView":737
13041  *
13042  *
13043  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
13044  *     cdef int *p_suboffset_dim = &suboffset_dim
13045  *     cdef Py_ssize_t start, stop, step
13046  */
13047   __pyx_v_p_dst = (&__pyx_v_dst);
13048 
13049   /* "View.MemoryView":738
13050  *
13051  *     cdef __Pyx_memviewslice *p_dst = &dst
13052  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
13053  *     cdef Py_ssize_t start, stop, step
13054  *     cdef bint have_start, have_stop, have_step
13055  */
13056   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13057 
13058   /* "View.MemoryView":742
13059  *     cdef bint have_start, have_stop, have_step
13060  *
13061  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
13062  *         if PyIndex_Check(index):
13063  *             slice_memviewslice(
13064  */
13065   __pyx_t_6 = 0;
13066   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13067     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
13068     __pyx_t_8 = NULL;
13069   } else {
13070     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
13071     __Pyx_GOTREF(__pyx_t_3);
13072     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
13073   }
13074   for (;;) {
13075     if (likely(!__pyx_t_8)) {
13076       if (likely(PyList_CheckExact(__pyx_t_3))) {
13077         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
13078         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13079         __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(1, 742, __pyx_L1_error)
13080         #else
13081         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
13082         __Pyx_GOTREF(__pyx_t_9);
13083         #endif
13084       } else {
13085         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13086         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13087         __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(1, 742, __pyx_L1_error)
13088         #else
13089         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
13090         __Pyx_GOTREF(__pyx_t_9);
13091         #endif
13092       }
13093     } else {
13094       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
13095       if (unlikely(!__pyx_t_9)) {
13096         PyObject* exc_type = PyErr_Occurred();
13097         if (exc_type) {
13098           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13099           else __PYX_ERR(1, 742, __pyx_L1_error)
13100         }
13101         break;
13102       }
13103       __Pyx_GOTREF(__pyx_t_9);
13104     }
13105     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
13106     __pyx_t_9 = 0;
13107     __pyx_v_dim = __pyx_t_6;
13108     __pyx_t_6 = (__pyx_t_6 + 1);
13109 
13110     /* "View.MemoryView":743
13111  *
13112  *     for dim, index in enumerate(indices):
13113  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
13114  *             slice_memviewslice(
13115  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13116  */
13117     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
13118     if (__pyx_t_2) {
13119 
13120       /* "View.MemoryView":747
13121  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13122  *                 dim, new_ndim, p_suboffset_dim,
13123  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
13124  *                 0, 0, 0, # have_{start,stop,step}
13125  *                 False)
13126  */
13127       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
13128 
13129       /* "View.MemoryView":744
13130  *     for dim, index in enumerate(indices):
13131  *         if PyIndex_Check(index):
13132  *             slice_memviewslice(             # <<<<<<<<<<<<<<
13133  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13134  *                 dim, new_ndim, p_suboffset_dim,
13135  */
13136       __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(1, 744, __pyx_L1_error)
13137 
13138       /* "View.MemoryView":743
13139  *
13140  *     for dim, index in enumerate(indices):
13141  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
13142  *             slice_memviewslice(
13143  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13144  */
13145       goto __pyx_L6;
13146     }
13147 
13148     /* "View.MemoryView":750
13149  *                 0, 0, 0, # have_{start,stop,step}
13150  *                 False)
13151  *         elif index is None:             # <<<<<<<<<<<<<<
13152  *             p_dst.shape[new_ndim] = 1
13153  *             p_dst.strides[new_ndim] = 0
13154  */
13155     __pyx_t_2 = (__pyx_v_index == Py_None);
13156     __pyx_t_1 = (__pyx_t_2 != 0);
13157     if (__pyx_t_1) {
13158 
13159       /* "View.MemoryView":751
13160  *                 False)
13161  *         elif index is None:
13162  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
13163  *             p_dst.strides[new_ndim] = 0
13164  *             p_dst.suboffsets[new_ndim] = -1
13165  */
13166       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13167 
13168       /* "View.MemoryView":752
13169  *         elif index is None:
13170  *             p_dst.shape[new_ndim] = 1
13171  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
13172  *             p_dst.suboffsets[new_ndim] = -1
13173  *             new_ndim += 1
13174  */
13175       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13176 
13177       /* "View.MemoryView":753
13178  *             p_dst.shape[new_ndim] = 1
13179  *             p_dst.strides[new_ndim] = 0
13180  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
13181  *             new_ndim += 1
13182  *         else:
13183  */
13184       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13185 
13186       /* "View.MemoryView":754
13187  *             p_dst.strides[new_ndim] = 0
13188  *             p_dst.suboffsets[new_ndim] = -1
13189  *             new_ndim += 1             # <<<<<<<<<<<<<<
13190  *         else:
13191  *             start = index.start or 0
13192  */
13193       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13194 
13195       /* "View.MemoryView":750
13196  *                 0, 0, 0, # have_{start,stop,step}
13197  *                 False)
13198  *         elif index is None:             # <<<<<<<<<<<<<<
13199  *             p_dst.shape[new_ndim] = 1
13200  *             p_dst.strides[new_ndim] = 0
13201  */
13202       goto __pyx_L6;
13203     }
13204 
13205     /* "View.MemoryView":756
13206  *             new_ndim += 1
13207  *         else:
13208  *             start = index.start or 0             # <<<<<<<<<<<<<<
13209  *             stop = index.stop or 0
13210  *             step = index.step or 0
13211  */
13212     /*else*/ {
13213       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
13214       __Pyx_GOTREF(__pyx_t_9);
13215       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
13216       if (!__pyx_t_1) {
13217         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13218       } else {
13219         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
13220         __pyx_t_10 = __pyx_t_12;
13221         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13222         goto __pyx_L7_bool_binop_done;
13223       }
13224       __pyx_t_10 = 0;
13225       __pyx_L7_bool_binop_done:;
13226       __pyx_v_start = __pyx_t_10;
13227 
13228       /* "View.MemoryView":757
13229  *         else:
13230  *             start = index.start or 0
13231  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
13232  *             step = index.step or 0
13233  *
13234  */
13235       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
13236       __Pyx_GOTREF(__pyx_t_9);
13237       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
13238       if (!__pyx_t_1) {
13239         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13240       } else {
13241         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
13242         __pyx_t_10 = __pyx_t_12;
13243         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13244         goto __pyx_L9_bool_binop_done;
13245       }
13246       __pyx_t_10 = 0;
13247       __pyx_L9_bool_binop_done:;
13248       __pyx_v_stop = __pyx_t_10;
13249 
13250       /* "View.MemoryView":758
13251  *             start = index.start or 0
13252  *             stop = index.stop or 0
13253  *             step = index.step or 0             # <<<<<<<<<<<<<<
13254  *
13255  *             have_start = index.start is not None
13256  */
13257       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
13258       __Pyx_GOTREF(__pyx_t_9);
13259       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
13260       if (!__pyx_t_1) {
13261         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13262       } else {
13263         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
13264         __pyx_t_10 = __pyx_t_12;
13265         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13266         goto __pyx_L11_bool_binop_done;
13267       }
13268       __pyx_t_10 = 0;
13269       __pyx_L11_bool_binop_done:;
13270       __pyx_v_step = __pyx_t_10;
13271 
13272       /* "View.MemoryView":760
13273  *             step = index.step or 0
13274  *
13275  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
13276  *             have_stop = index.stop is not None
13277  *             have_step = index.step is not None
13278  */
13279       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
13280       __Pyx_GOTREF(__pyx_t_9);
13281       __pyx_t_1 = (__pyx_t_9 != Py_None);
13282       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13283       __pyx_v_have_start = __pyx_t_1;
13284 
13285       /* "View.MemoryView":761
13286  *
13287  *             have_start = index.start is not None
13288  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
13289  *             have_step = index.step is not None
13290  *
13291  */
13292       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
13293       __Pyx_GOTREF(__pyx_t_9);
13294       __pyx_t_1 = (__pyx_t_9 != Py_None);
13295       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13296       __pyx_v_have_stop = __pyx_t_1;
13297 
13298       /* "View.MemoryView":762
13299  *             have_start = index.start is not None
13300  *             have_stop = index.stop is not None
13301  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
13302  *
13303  *             slice_memviewslice(
13304  */
13305       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
13306       __Pyx_GOTREF(__pyx_t_9);
13307       __pyx_t_1 = (__pyx_t_9 != Py_None);
13308       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13309       __pyx_v_have_step = __pyx_t_1;
13310 
13311       /* "View.MemoryView":764
13312  *             have_step = index.step is not None
13313  *
13314  *             slice_memviewslice(             # <<<<<<<<<<<<<<
13315  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13316  *                 dim, new_ndim, p_suboffset_dim,
13317  */
13318       __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(1, 764, __pyx_L1_error)
13319 
13320       /* "View.MemoryView":770
13321  *                 have_start, have_stop, have_step,
13322  *                 True)
13323  *             new_ndim += 1             # <<<<<<<<<<<<<<
13324  *
13325  *     if isinstance(memview, _memoryviewslice):
13326  */
13327       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13328     }
13329     __pyx_L6:;
13330 
13331     /* "View.MemoryView":742
13332  *     cdef bint have_start, have_stop, have_step
13333  *
13334  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
13335  *         if PyIndex_Check(index):
13336  *             slice_memviewslice(
13337  */
13338   }
13339   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13340 
13341   /* "View.MemoryView":772
13342  *             new_ndim += 1
13343  *
13344  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13345  *         return memoryview_fromslice(dst, new_ndim,
13346  *                                     memviewsliceobj.to_object_func,
13347  */
13348   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13349   __pyx_t_2 = (__pyx_t_1 != 0);
13350   if (__pyx_t_2) {
13351 
13352     /* "View.MemoryView":773
13353  *
13354  *     if isinstance(memview, _memoryviewslice):
13355  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
13356  *                                     memviewsliceobj.to_object_func,
13357  *                                     memviewsliceobj.to_dtype_func,
13358  */
13359     __Pyx_XDECREF(((PyObject *)__pyx_r));
13360 
13361     /* "View.MemoryView":774
13362  *     if isinstance(memview, _memoryviewslice):
13363  *         return memoryview_fromslice(dst, new_ndim,
13364  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
13365  *                                     memviewsliceobj.to_dtype_func,
13366  *                                     memview.dtype_is_object)
13367  */
13368     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
13369 
13370     /* "View.MemoryView":775
13371  *         return memoryview_fromslice(dst, new_ndim,
13372  *                                     memviewsliceobj.to_object_func,
13373  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
13374  *                                     memview.dtype_is_object)
13375  *     else:
13376  */
13377     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
13378 
13379     /* "View.MemoryView":773
13380  *
13381  *     if isinstance(memview, _memoryviewslice):
13382  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
13383  *                                     memviewsliceobj.to_object_func,
13384  *                                     memviewsliceobj.to_dtype_func,
13385  */
13386     __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(1, 773, __pyx_L1_error)
13387     __Pyx_GOTREF(__pyx_t_3);
13388     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
13389     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
13390     __pyx_t_3 = 0;
13391     goto __pyx_L0;
13392 
13393     /* "View.MemoryView":772
13394  *             new_ndim += 1
13395  *
13396  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
13397  *         return memoryview_fromslice(dst, new_ndim,
13398  *                                     memviewsliceobj.to_object_func,
13399  */
13400   }
13401 
13402   /* "View.MemoryView":778
13403  *                                     memview.dtype_is_object)
13404  *     else:
13405  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
13406  *                                     memview.dtype_is_object)
13407  *
13408  */
13409   /*else*/ {
13410     __Pyx_XDECREF(((PyObject *)__pyx_r));
13411 
13412     /* "View.MemoryView":779
13413  *     else:
13414  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13415  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
13416  *
13417  *
13418  */
13419     __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(1, 778, __pyx_L1_error)
13420     __Pyx_GOTREF(__pyx_t_3);
13421 
13422     /* "View.MemoryView":778
13423  *                                     memview.dtype_is_object)
13424  *     else:
13425  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
13426  *                                     memview.dtype_is_object)
13427  *
13428  */
13429     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
13430     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
13431     __pyx_t_3 = 0;
13432     goto __pyx_L0;
13433   }
13434 
13435   /* "View.MemoryView":706
13436  *
13437  * @cname('__pyx_memview_slice')
13438  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
13439  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
13440  *     cdef bint negative_step
13441  */
13442 
13443   /* function exit code */
13444   __pyx_L1_error:;
13445   __Pyx_XDECREF(__pyx_t_3);
13446   __Pyx_XDECREF(__pyx_t_9);
13447   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13448   __pyx_r = 0;
13449   __pyx_L0:;
13450   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13451   __Pyx_XDECREF(__pyx_v_index);
13452   __Pyx_XGIVEREF((PyObject *)__pyx_r);
13453   __Pyx_RefNannyFinishContext();
13454   return __pyx_r;
13455 }
13456 
13457 /* "View.MemoryView":803
13458  *
13459  * @cname('__pyx_memoryview_slice_memviewslice')
13460  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
13461  *         __Pyx_memviewslice *dst,
13462  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13463  */
13464 
__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)13465 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) {
13466   Py_ssize_t __pyx_v_new_shape;
13467   int __pyx_v_negative_step;
13468   int __pyx_r;
13469   int __pyx_t_1;
13470   int __pyx_t_2;
13471   int __pyx_t_3;
13472 
13473   /* "View.MemoryView":823
13474  *     cdef bint negative_step
13475  *
13476  *     if not is_slice:             # <<<<<<<<<<<<<<
13477  *
13478  *         if start < 0:
13479  */
13480   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
13481   if (__pyx_t_1) {
13482 
13483     /* "View.MemoryView":825
13484  *     if not is_slice:
13485  *
13486  *         if start < 0:             # <<<<<<<<<<<<<<
13487  *             start += shape
13488  *         if not 0 <= start < shape:
13489  */
13490     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
13491     if (__pyx_t_1) {
13492 
13493       /* "View.MemoryView":826
13494  *
13495  *         if start < 0:
13496  *             start += shape             # <<<<<<<<<<<<<<
13497  *         if not 0 <= start < shape:
13498  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13499  */
13500       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13501 
13502       /* "View.MemoryView":825
13503  *     if not is_slice:
13504  *
13505  *         if start < 0:             # <<<<<<<<<<<<<<
13506  *             start += shape
13507  *         if not 0 <= start < shape:
13508  */
13509     }
13510 
13511     /* "View.MemoryView":827
13512  *         if start < 0:
13513  *             start += shape
13514  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
13515  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13516  *     else:
13517  */
13518     __pyx_t_1 = (0 <= __pyx_v_start);
13519     if (__pyx_t_1) {
13520       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13521     }
13522     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13523     if (__pyx_t_2) {
13524 
13525       /* "View.MemoryView":828
13526  *             start += shape
13527  *         if not 0 <= start < shape:
13528  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
13529  *     else:
13530  *
13531  */
13532       __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(1, 828, __pyx_L1_error)
13533 
13534       /* "View.MemoryView":827
13535  *         if start < 0:
13536  *             start += shape
13537  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
13538  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
13539  *     else:
13540  */
13541     }
13542 
13543     /* "View.MemoryView":823
13544  *     cdef bint negative_step
13545  *
13546  *     if not is_slice:             # <<<<<<<<<<<<<<
13547  *
13548  *         if start < 0:
13549  */
13550     goto __pyx_L3;
13551   }
13552 
13553   /* "View.MemoryView":831
13554  *     else:
13555  *
13556  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
13557  *
13558  *         if have_step and step == 0:
13559  */
13560   /*else*/ {
13561     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
13562     if (__pyx_t_1) {
13563     } else {
13564       __pyx_t_2 = __pyx_t_1;
13565       goto __pyx_L6_bool_binop_done;
13566     }
13567     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
13568     __pyx_t_2 = __pyx_t_1;
13569     __pyx_L6_bool_binop_done:;
13570     __pyx_v_negative_step = __pyx_t_2;
13571 
13572     /* "View.MemoryView":833
13573  *         negative_step = have_step != 0 and step < 0
13574  *
13575  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
13576  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
13577  *
13578  */
13579     __pyx_t_1 = (__pyx_v_have_step != 0);
13580     if (__pyx_t_1) {
13581     } else {
13582       __pyx_t_2 = __pyx_t_1;
13583       goto __pyx_L9_bool_binop_done;
13584     }
13585     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
13586     __pyx_t_2 = __pyx_t_1;
13587     __pyx_L9_bool_binop_done:;
13588     if (__pyx_t_2) {
13589 
13590       /* "View.MemoryView":834
13591  *
13592  *         if have_step and step == 0:
13593  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
13594  *
13595  *
13596  */
13597       __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(1, 834, __pyx_L1_error)
13598 
13599       /* "View.MemoryView":833
13600  *         negative_step = have_step != 0 and step < 0
13601  *
13602  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
13603  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
13604  *
13605  */
13606     }
13607 
13608     /* "View.MemoryView":837
13609  *
13610  *
13611  *         if have_start:             # <<<<<<<<<<<<<<
13612  *             if start < 0:
13613  *                 start += shape
13614  */
13615     __pyx_t_2 = (__pyx_v_have_start != 0);
13616     if (__pyx_t_2) {
13617 
13618       /* "View.MemoryView":838
13619  *
13620  *         if have_start:
13621  *             if start < 0:             # <<<<<<<<<<<<<<
13622  *                 start += shape
13623  *                 if start < 0:
13624  */
13625       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
13626       if (__pyx_t_2) {
13627 
13628         /* "View.MemoryView":839
13629  *         if have_start:
13630  *             if start < 0:
13631  *                 start += shape             # <<<<<<<<<<<<<<
13632  *                 if start < 0:
13633  *                     start = 0
13634  */
13635         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13636 
13637         /* "View.MemoryView":840
13638  *             if start < 0:
13639  *                 start += shape
13640  *                 if start < 0:             # <<<<<<<<<<<<<<
13641  *                     start = 0
13642  *             elif start >= shape:
13643  */
13644         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
13645         if (__pyx_t_2) {
13646 
13647           /* "View.MemoryView":841
13648  *                 start += shape
13649  *                 if start < 0:
13650  *                     start = 0             # <<<<<<<<<<<<<<
13651  *             elif start >= shape:
13652  *                 if negative_step:
13653  */
13654           __pyx_v_start = 0;
13655 
13656           /* "View.MemoryView":840
13657  *             if start < 0:
13658  *                 start += shape
13659  *                 if start < 0:             # <<<<<<<<<<<<<<
13660  *                     start = 0
13661  *             elif start >= shape:
13662  */
13663         }
13664 
13665         /* "View.MemoryView":838
13666  *
13667  *         if have_start:
13668  *             if start < 0:             # <<<<<<<<<<<<<<
13669  *                 start += shape
13670  *                 if start < 0:
13671  */
13672         goto __pyx_L12;
13673       }
13674 
13675       /* "View.MemoryView":842
13676  *                 if start < 0:
13677  *                     start = 0
13678  *             elif start >= shape:             # <<<<<<<<<<<<<<
13679  *                 if negative_step:
13680  *                     start = shape - 1
13681  */
13682       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
13683       if (__pyx_t_2) {
13684 
13685         /* "View.MemoryView":843
13686  *                     start = 0
13687  *             elif start >= shape:
13688  *                 if negative_step:             # <<<<<<<<<<<<<<
13689  *                     start = shape - 1
13690  *                 else:
13691  */
13692         __pyx_t_2 = (__pyx_v_negative_step != 0);
13693         if (__pyx_t_2) {
13694 
13695           /* "View.MemoryView":844
13696  *             elif start >= shape:
13697  *                 if negative_step:
13698  *                     start = shape - 1             # <<<<<<<<<<<<<<
13699  *                 else:
13700  *                     start = shape
13701  */
13702           __pyx_v_start = (__pyx_v_shape - 1);
13703 
13704           /* "View.MemoryView":843
13705  *                     start = 0
13706  *             elif start >= shape:
13707  *                 if negative_step:             # <<<<<<<<<<<<<<
13708  *                     start = shape - 1
13709  *                 else:
13710  */
13711           goto __pyx_L14;
13712         }
13713 
13714         /* "View.MemoryView":846
13715  *                     start = shape - 1
13716  *                 else:
13717  *                     start = shape             # <<<<<<<<<<<<<<
13718  *         else:
13719  *             if negative_step:
13720  */
13721         /*else*/ {
13722           __pyx_v_start = __pyx_v_shape;
13723         }
13724         __pyx_L14:;
13725 
13726         /* "View.MemoryView":842
13727  *                 if start < 0:
13728  *                     start = 0
13729  *             elif start >= shape:             # <<<<<<<<<<<<<<
13730  *                 if negative_step:
13731  *                     start = shape - 1
13732  */
13733       }
13734       __pyx_L12:;
13735 
13736       /* "View.MemoryView":837
13737  *
13738  *
13739  *         if have_start:             # <<<<<<<<<<<<<<
13740  *             if start < 0:
13741  *                 start += shape
13742  */
13743       goto __pyx_L11;
13744     }
13745 
13746     /* "View.MemoryView":848
13747  *                     start = shape
13748  *         else:
13749  *             if negative_step:             # <<<<<<<<<<<<<<
13750  *                 start = shape - 1
13751  *             else:
13752  */
13753     /*else*/ {
13754       __pyx_t_2 = (__pyx_v_negative_step != 0);
13755       if (__pyx_t_2) {
13756 
13757         /* "View.MemoryView":849
13758  *         else:
13759  *             if negative_step:
13760  *                 start = shape - 1             # <<<<<<<<<<<<<<
13761  *             else:
13762  *                 start = 0
13763  */
13764         __pyx_v_start = (__pyx_v_shape - 1);
13765 
13766         /* "View.MemoryView":848
13767  *                     start = shape
13768  *         else:
13769  *             if negative_step:             # <<<<<<<<<<<<<<
13770  *                 start = shape - 1
13771  *             else:
13772  */
13773         goto __pyx_L15;
13774       }
13775 
13776       /* "View.MemoryView":851
13777  *                 start = shape - 1
13778  *             else:
13779  *                 start = 0             # <<<<<<<<<<<<<<
13780  *
13781  *         if have_stop:
13782  */
13783       /*else*/ {
13784         __pyx_v_start = 0;
13785       }
13786       __pyx_L15:;
13787     }
13788     __pyx_L11:;
13789 
13790     /* "View.MemoryView":853
13791  *                 start = 0
13792  *
13793  *         if have_stop:             # <<<<<<<<<<<<<<
13794  *             if stop < 0:
13795  *                 stop += shape
13796  */
13797     __pyx_t_2 = (__pyx_v_have_stop != 0);
13798     if (__pyx_t_2) {
13799 
13800       /* "View.MemoryView":854
13801  *
13802  *         if have_stop:
13803  *             if stop < 0:             # <<<<<<<<<<<<<<
13804  *                 stop += shape
13805  *                 if stop < 0:
13806  */
13807       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13808       if (__pyx_t_2) {
13809 
13810         /* "View.MemoryView":855
13811  *         if have_stop:
13812  *             if stop < 0:
13813  *                 stop += shape             # <<<<<<<<<<<<<<
13814  *                 if stop < 0:
13815  *                     stop = 0
13816  */
13817         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13818 
13819         /* "View.MemoryView":856
13820  *             if stop < 0:
13821  *                 stop += shape
13822  *                 if stop < 0:             # <<<<<<<<<<<<<<
13823  *                     stop = 0
13824  *             elif stop > shape:
13825  */
13826         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13827         if (__pyx_t_2) {
13828 
13829           /* "View.MemoryView":857
13830  *                 stop += shape
13831  *                 if stop < 0:
13832  *                     stop = 0             # <<<<<<<<<<<<<<
13833  *             elif stop > shape:
13834  *                 stop = shape
13835  */
13836           __pyx_v_stop = 0;
13837 
13838           /* "View.MemoryView":856
13839  *             if stop < 0:
13840  *                 stop += shape
13841  *                 if stop < 0:             # <<<<<<<<<<<<<<
13842  *                     stop = 0
13843  *             elif stop > shape:
13844  */
13845         }
13846 
13847         /* "View.MemoryView":854
13848  *
13849  *         if have_stop:
13850  *             if stop < 0:             # <<<<<<<<<<<<<<
13851  *                 stop += shape
13852  *                 if stop < 0:
13853  */
13854         goto __pyx_L17;
13855       }
13856 
13857       /* "View.MemoryView":858
13858  *                 if stop < 0:
13859  *                     stop = 0
13860  *             elif stop > shape:             # <<<<<<<<<<<<<<
13861  *                 stop = shape
13862  *         else:
13863  */
13864       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
13865       if (__pyx_t_2) {
13866 
13867         /* "View.MemoryView":859
13868  *                     stop = 0
13869  *             elif stop > shape:
13870  *                 stop = shape             # <<<<<<<<<<<<<<
13871  *         else:
13872  *             if negative_step:
13873  */
13874         __pyx_v_stop = __pyx_v_shape;
13875 
13876         /* "View.MemoryView":858
13877  *                 if stop < 0:
13878  *                     stop = 0
13879  *             elif stop > shape:             # <<<<<<<<<<<<<<
13880  *                 stop = shape
13881  *         else:
13882  */
13883       }
13884       __pyx_L17:;
13885 
13886       /* "View.MemoryView":853
13887  *                 start = 0
13888  *
13889  *         if have_stop:             # <<<<<<<<<<<<<<
13890  *             if stop < 0:
13891  *                 stop += shape
13892  */
13893       goto __pyx_L16;
13894     }
13895 
13896     /* "View.MemoryView":861
13897  *                 stop = shape
13898  *         else:
13899  *             if negative_step:             # <<<<<<<<<<<<<<
13900  *                 stop = -1
13901  *             else:
13902  */
13903     /*else*/ {
13904       __pyx_t_2 = (__pyx_v_negative_step != 0);
13905       if (__pyx_t_2) {
13906 
13907         /* "View.MemoryView":862
13908  *         else:
13909  *             if negative_step:
13910  *                 stop = -1             # <<<<<<<<<<<<<<
13911  *             else:
13912  *                 stop = shape
13913  */
13914         __pyx_v_stop = -1L;
13915 
13916         /* "View.MemoryView":861
13917  *                 stop = shape
13918  *         else:
13919  *             if negative_step:             # <<<<<<<<<<<<<<
13920  *                 stop = -1
13921  *             else:
13922  */
13923         goto __pyx_L19;
13924       }
13925 
13926       /* "View.MemoryView":864
13927  *                 stop = -1
13928  *             else:
13929  *                 stop = shape             # <<<<<<<<<<<<<<
13930  *
13931  *         if not have_step:
13932  */
13933       /*else*/ {
13934         __pyx_v_stop = __pyx_v_shape;
13935       }
13936       __pyx_L19:;
13937     }
13938     __pyx_L16:;
13939 
13940     /* "View.MemoryView":866
13941  *                 stop = shape
13942  *
13943  *         if not have_step:             # <<<<<<<<<<<<<<
13944  *             step = 1
13945  *
13946  */
13947     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
13948     if (__pyx_t_2) {
13949 
13950       /* "View.MemoryView":867
13951  *
13952  *         if not have_step:
13953  *             step = 1             # <<<<<<<<<<<<<<
13954  *
13955  *
13956  */
13957       __pyx_v_step = 1;
13958 
13959       /* "View.MemoryView":866
13960  *                 stop = shape
13961  *
13962  *         if not have_step:             # <<<<<<<<<<<<<<
13963  *             step = 1
13964  *
13965  */
13966     }
13967 
13968     /* "View.MemoryView":871
13969  *
13970  *         with cython.cdivision(True):
13971  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
13972  *
13973  *             if (stop - start) - step * new_shape:
13974  */
13975     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13976 
13977     /* "View.MemoryView":873
13978  *             new_shape = (stop - start) // step
13979  *
13980  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
13981  *                 new_shape += 1
13982  *
13983  */
13984     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13985     if (__pyx_t_2) {
13986 
13987       /* "View.MemoryView":874
13988  *
13989  *             if (stop - start) - step * new_shape:
13990  *                 new_shape += 1             # <<<<<<<<<<<<<<
13991  *
13992  *         if new_shape < 0:
13993  */
13994       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13995 
13996       /* "View.MemoryView":873
13997  *             new_shape = (stop - start) // step
13998  *
13999  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
14000  *                 new_shape += 1
14001  *
14002  */
14003     }
14004 
14005     /* "View.MemoryView":876
14006  *                 new_shape += 1
14007  *
14008  *         if new_shape < 0:             # <<<<<<<<<<<<<<
14009  *             new_shape = 0
14010  *
14011  */
14012     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
14013     if (__pyx_t_2) {
14014 
14015       /* "View.MemoryView":877
14016  *
14017  *         if new_shape < 0:
14018  *             new_shape = 0             # <<<<<<<<<<<<<<
14019  *
14020  *
14021  */
14022       __pyx_v_new_shape = 0;
14023 
14024       /* "View.MemoryView":876
14025  *                 new_shape += 1
14026  *
14027  *         if new_shape < 0:             # <<<<<<<<<<<<<<
14028  *             new_shape = 0
14029  *
14030  */
14031     }
14032 
14033     /* "View.MemoryView":880
14034  *
14035  *
14036  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
14037  *         dst.shape[new_ndim] = new_shape
14038  *         dst.suboffsets[new_ndim] = suboffset
14039  */
14040     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14041 
14042     /* "View.MemoryView":881
14043  *
14044  *         dst.strides[new_ndim] = stride * step
14045  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
14046  *         dst.suboffsets[new_ndim] = suboffset
14047  *
14048  */
14049     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14050 
14051     /* "View.MemoryView":882
14052  *         dst.strides[new_ndim] = stride * step
14053  *         dst.shape[new_ndim] = new_shape
14054  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
14055  *
14056  *
14057  */
14058     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14059   }
14060   __pyx_L3:;
14061 
14062   /* "View.MemoryView":885
14063  *
14064  *
14065  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
14066  *         dst.data += start * stride
14067  *     else:
14068  */
14069   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
14070   if (__pyx_t_2) {
14071 
14072     /* "View.MemoryView":886
14073  *
14074  *     if suboffset_dim[0] < 0:
14075  *         dst.data += start * stride             # <<<<<<<<<<<<<<
14076  *     else:
14077  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14078  */
14079     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14080 
14081     /* "View.MemoryView":885
14082  *
14083  *
14084  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
14085  *         dst.data += start * stride
14086  *     else:
14087  */
14088     goto __pyx_L23;
14089   }
14090 
14091   /* "View.MemoryView":888
14092  *         dst.data += start * stride
14093  *     else:
14094  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
14095  *
14096  *     if suboffset >= 0:
14097  */
14098   /*else*/ {
14099     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14100     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14101   }
14102   __pyx_L23:;
14103 
14104   /* "View.MemoryView":890
14105  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14106  *
14107  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14108  *         if not is_slice:
14109  *             if new_ndim == 0:
14110  */
14111   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14112   if (__pyx_t_2) {
14113 
14114     /* "View.MemoryView":891
14115  *
14116  *     if suboffset >= 0:
14117  *         if not is_slice:             # <<<<<<<<<<<<<<
14118  *             if new_ndim == 0:
14119  *                 dst.data = (<char **> dst.data)[0] + suboffset
14120  */
14121     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
14122     if (__pyx_t_2) {
14123 
14124       /* "View.MemoryView":892
14125  *     if suboffset >= 0:
14126  *         if not is_slice:
14127  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
14128  *                 dst.data = (<char **> dst.data)[0] + suboffset
14129  *             else:
14130  */
14131       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
14132       if (__pyx_t_2) {
14133 
14134         /* "View.MemoryView":893
14135  *         if not is_slice:
14136  *             if new_ndim == 0:
14137  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
14138  *             else:
14139  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
14140  */
14141         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14142 
14143         /* "View.MemoryView":892
14144  *     if suboffset >= 0:
14145  *         if not is_slice:
14146  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
14147  *                 dst.data = (<char **> dst.data)[0] + suboffset
14148  *             else:
14149  */
14150         goto __pyx_L26;
14151       }
14152 
14153       /* "View.MemoryView":895
14154  *                 dst.data = (<char **> dst.data)[0] + suboffset
14155  *             else:
14156  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
14157  *                                      "must be indexed and not sliced", dim)
14158  *         else:
14159  */
14160       /*else*/ {
14161 
14162         /* "View.MemoryView":896
14163  *             else:
14164  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
14165  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
14166  *         else:
14167  *             suboffset_dim[0] = new_ndim
14168  */
14169         __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(1, 895, __pyx_L1_error)
14170       }
14171       __pyx_L26:;
14172 
14173       /* "View.MemoryView":891
14174  *
14175  *     if suboffset >= 0:
14176  *         if not is_slice:             # <<<<<<<<<<<<<<
14177  *             if new_ndim == 0:
14178  *                 dst.data = (<char **> dst.data)[0] + suboffset
14179  */
14180       goto __pyx_L25;
14181     }
14182 
14183     /* "View.MemoryView":898
14184  *                                      "must be indexed and not sliced", dim)
14185  *         else:
14186  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
14187  *
14188  *     return 0
14189  */
14190     /*else*/ {
14191       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14192     }
14193     __pyx_L25:;
14194 
14195     /* "View.MemoryView":890
14196  *         dst.suboffsets[suboffset_dim[0]] += start * stride
14197  *
14198  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14199  *         if not is_slice:
14200  *             if new_ndim == 0:
14201  */
14202   }
14203 
14204   /* "View.MemoryView":900
14205  *             suboffset_dim[0] = new_ndim
14206  *
14207  *     return 0             # <<<<<<<<<<<<<<
14208  *
14209  *
14210  */
14211   __pyx_r = 0;
14212   goto __pyx_L0;
14213 
14214   /* "View.MemoryView":803
14215  *
14216  * @cname('__pyx_memoryview_slice_memviewslice')
14217  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
14218  *         __Pyx_memviewslice *dst,
14219  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14220  */
14221 
14222   /* function exit code */
14223   __pyx_L1_error:;
14224   {
14225     #ifdef WITH_THREAD
14226     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14227     #endif
14228     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14229     #ifdef WITH_THREAD
14230     __Pyx_PyGILState_Release(__pyx_gilstate_save);
14231     #endif
14232   }
14233   __pyx_r = -1;
14234   __pyx_L0:;
14235   return __pyx_r;
14236 }
14237 
14238 /* "View.MemoryView":906
14239  *
14240  * @cname('__pyx_pybuffer_index')
14241  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
14242  *                           Py_ssize_t dim) except NULL:
14243  *     cdef Py_ssize_t shape, stride, suboffset = -1
14244  */
14245 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)14246 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) {
14247   Py_ssize_t __pyx_v_shape;
14248   Py_ssize_t __pyx_v_stride;
14249   Py_ssize_t __pyx_v_suboffset;
14250   Py_ssize_t __pyx_v_itemsize;
14251   char *__pyx_v_resultp;
14252   char *__pyx_r;
14253   __Pyx_RefNannyDeclarations
14254   Py_ssize_t __pyx_t_1;
14255   int __pyx_t_2;
14256   PyObject *__pyx_t_3 = NULL;
14257   PyObject *__pyx_t_4 = NULL;
14258   __Pyx_RefNannySetupContext("pybuffer_index", 0);
14259 
14260   /* "View.MemoryView":908
14261  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14262  *                           Py_ssize_t dim) except NULL:
14263  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
14264  *     cdef Py_ssize_t itemsize = view.itemsize
14265  *     cdef char *resultp
14266  */
14267   __pyx_v_suboffset = -1L;
14268 
14269   /* "View.MemoryView":909
14270  *                           Py_ssize_t dim) except NULL:
14271  *     cdef Py_ssize_t shape, stride, suboffset = -1
14272  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
14273  *     cdef char *resultp
14274  *
14275  */
14276   __pyx_t_1 = __pyx_v_view->itemsize;
14277   __pyx_v_itemsize = __pyx_t_1;
14278 
14279   /* "View.MemoryView":912
14280  *     cdef char *resultp
14281  *
14282  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
14283  *         shape = view.len / itemsize
14284  *         stride = itemsize
14285  */
14286   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
14287   if (__pyx_t_2) {
14288 
14289     /* "View.MemoryView":913
14290  *
14291  *     if view.ndim == 0:
14292  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
14293  *         stride = itemsize
14294  *     else:
14295  */
14296     if (unlikely(__pyx_v_itemsize == 0)) {
14297       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14298       __PYX_ERR(1, 913, __pyx_L1_error)
14299     }
14300     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))) {
14301       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14302       __PYX_ERR(1, 913, __pyx_L1_error)
14303     }
14304     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14305 
14306     /* "View.MemoryView":914
14307  *     if view.ndim == 0:
14308  *         shape = view.len / itemsize
14309  *         stride = itemsize             # <<<<<<<<<<<<<<
14310  *     else:
14311  *         shape = view.shape[dim]
14312  */
14313     __pyx_v_stride = __pyx_v_itemsize;
14314 
14315     /* "View.MemoryView":912
14316  *     cdef char *resultp
14317  *
14318  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
14319  *         shape = view.len / itemsize
14320  *         stride = itemsize
14321  */
14322     goto __pyx_L3;
14323   }
14324 
14325   /* "View.MemoryView":916
14326  *         stride = itemsize
14327  *     else:
14328  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
14329  *         stride = view.strides[dim]
14330  *         if view.suboffsets != NULL:
14331  */
14332   /*else*/ {
14333     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14334 
14335     /* "View.MemoryView":917
14336  *     else:
14337  *         shape = view.shape[dim]
14338  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
14339  *         if view.suboffsets != NULL:
14340  *             suboffset = view.suboffsets[dim]
14341  */
14342     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14343 
14344     /* "View.MemoryView":918
14345  *         shape = view.shape[dim]
14346  *         stride = view.strides[dim]
14347  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
14348  *             suboffset = view.suboffsets[dim]
14349  *
14350  */
14351     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
14352     if (__pyx_t_2) {
14353 
14354       /* "View.MemoryView":919
14355  *         stride = view.strides[dim]
14356  *         if view.suboffsets != NULL:
14357  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
14358  *
14359  *     if index < 0:
14360  */
14361       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14362 
14363       /* "View.MemoryView":918
14364  *         shape = view.shape[dim]
14365  *         stride = view.strides[dim]
14366  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
14367  *             suboffset = view.suboffsets[dim]
14368  *
14369  */
14370     }
14371   }
14372   __pyx_L3:;
14373 
14374   /* "View.MemoryView":921
14375  *             suboffset = view.suboffsets[dim]
14376  *
14377  *     if index < 0:             # <<<<<<<<<<<<<<
14378  *         index += view.shape[dim]
14379  *         if index < 0:
14380  */
14381   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14382   if (__pyx_t_2) {
14383 
14384     /* "View.MemoryView":922
14385  *
14386  *     if index < 0:
14387  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
14388  *         if index < 0:
14389  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14390  */
14391     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14392 
14393     /* "View.MemoryView":923
14394  *     if index < 0:
14395  *         index += view.shape[dim]
14396  *         if index < 0:             # <<<<<<<<<<<<<<
14397  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14398  *
14399  */
14400     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14401     if (unlikely(__pyx_t_2)) {
14402 
14403       /* "View.MemoryView":924
14404  *         index += view.shape[dim]
14405  *         if index < 0:
14406  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
14407  *
14408  *     if index >= shape:
14409  */
14410       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
14411       __Pyx_GOTREF(__pyx_t_3);
14412       __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(1, 924, __pyx_L1_error)
14413       __Pyx_GOTREF(__pyx_t_4);
14414       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14415       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
14416       __Pyx_GOTREF(__pyx_t_3);
14417       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14418       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14419       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14420       __PYX_ERR(1, 924, __pyx_L1_error)
14421 
14422       /* "View.MemoryView":923
14423  *     if index < 0:
14424  *         index += view.shape[dim]
14425  *         if index < 0:             # <<<<<<<<<<<<<<
14426  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14427  *
14428  */
14429     }
14430 
14431     /* "View.MemoryView":921
14432  *             suboffset = view.suboffsets[dim]
14433  *
14434  *     if index < 0:             # <<<<<<<<<<<<<<
14435  *         index += view.shape[dim]
14436  *         if index < 0:
14437  */
14438   }
14439 
14440   /* "View.MemoryView":926
14441  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14442  *
14443  *     if index >= shape:             # <<<<<<<<<<<<<<
14444  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14445  *
14446  */
14447   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
14448   if (unlikely(__pyx_t_2)) {
14449 
14450     /* "View.MemoryView":927
14451  *
14452  *     if index >= shape:
14453  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
14454  *
14455  *     resultp = bufp + index * stride
14456  */
14457     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
14458     __Pyx_GOTREF(__pyx_t_3);
14459     __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(1, 927, __pyx_L1_error)
14460     __Pyx_GOTREF(__pyx_t_4);
14461     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14462     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
14463     __Pyx_GOTREF(__pyx_t_3);
14464     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14465     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14466     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14467     __PYX_ERR(1, 927, __pyx_L1_error)
14468 
14469     /* "View.MemoryView":926
14470  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14471  *
14472  *     if index >= shape:             # <<<<<<<<<<<<<<
14473  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14474  *
14475  */
14476   }
14477 
14478   /* "View.MemoryView":929
14479  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
14480  *
14481  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
14482  *     if suboffset >= 0:
14483  *         resultp = (<char **> resultp)[0] + suboffset
14484  */
14485   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14486 
14487   /* "View.MemoryView":930
14488  *
14489  *     resultp = bufp + index * stride
14490  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14491  *         resultp = (<char **> resultp)[0] + suboffset
14492  *
14493  */
14494   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14495   if (__pyx_t_2) {
14496 
14497     /* "View.MemoryView":931
14498  *     resultp = bufp + index * stride
14499  *     if suboffset >= 0:
14500  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
14501  *
14502  *     return resultp
14503  */
14504     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14505 
14506     /* "View.MemoryView":930
14507  *
14508  *     resultp = bufp + index * stride
14509  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
14510  *         resultp = (<char **> resultp)[0] + suboffset
14511  *
14512  */
14513   }
14514 
14515   /* "View.MemoryView":933
14516  *         resultp = (<char **> resultp)[0] + suboffset
14517  *
14518  *     return resultp             # <<<<<<<<<<<<<<
14519  *
14520  *
14521  */
14522   __pyx_r = __pyx_v_resultp;
14523   goto __pyx_L0;
14524 
14525   /* "View.MemoryView":906
14526  *
14527  * @cname('__pyx_pybuffer_index')
14528  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
14529  *                           Py_ssize_t dim) except NULL:
14530  *     cdef Py_ssize_t shape, stride, suboffset = -1
14531  */
14532 
14533   /* function exit code */
14534   __pyx_L1_error:;
14535   __Pyx_XDECREF(__pyx_t_3);
14536   __Pyx_XDECREF(__pyx_t_4);
14537   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14538   __pyx_r = NULL;
14539   __pyx_L0:;
14540   __Pyx_RefNannyFinishContext();
14541   return __pyx_r;
14542 }
14543 
14544 /* "View.MemoryView":939
14545  *
14546  * @cname('__pyx_memslice_transpose')
14547  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
14548  *     cdef int ndim = memslice.memview.view.ndim
14549  *
14550  */
14551 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)14552 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14553   int __pyx_v_ndim;
14554   Py_ssize_t *__pyx_v_shape;
14555   Py_ssize_t *__pyx_v_strides;
14556   int __pyx_v_i;
14557   int __pyx_v_j;
14558   int __pyx_r;
14559   int __pyx_t_1;
14560   Py_ssize_t *__pyx_t_2;
14561   long __pyx_t_3;
14562   long __pyx_t_4;
14563   Py_ssize_t __pyx_t_5;
14564   Py_ssize_t __pyx_t_6;
14565   int __pyx_t_7;
14566   int __pyx_t_8;
14567   int __pyx_t_9;
14568 
14569   /* "View.MemoryView":940
14570  * @cname('__pyx_memslice_transpose')
14571  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
14572  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
14573  *
14574  *     cdef Py_ssize_t *shape = memslice.shape
14575  */
14576   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14577   __pyx_v_ndim = __pyx_t_1;
14578 
14579   /* "View.MemoryView":942
14580  *     cdef int ndim = memslice.memview.view.ndim
14581  *
14582  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
14583  *     cdef Py_ssize_t *strides = memslice.strides
14584  *
14585  */
14586   __pyx_t_2 = __pyx_v_memslice->shape;
14587   __pyx_v_shape = __pyx_t_2;
14588 
14589   /* "View.MemoryView":943
14590  *
14591  *     cdef Py_ssize_t *shape = memslice.shape
14592  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
14593  *
14594  *
14595  */
14596   __pyx_t_2 = __pyx_v_memslice->strides;
14597   __pyx_v_strides = __pyx_t_2;
14598 
14599   /* "View.MemoryView":947
14600  *
14601  *     cdef int i, j
14602  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
14603  *         j = ndim - 1 - i
14604  *         strides[i], strides[j] = strides[j], strides[i]
14605  */
14606   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14607   __pyx_t_4 = __pyx_t_3;
14608   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14609     __pyx_v_i = __pyx_t_1;
14610 
14611     /* "View.MemoryView":948
14612  *     cdef int i, j
14613  *     for i in range(ndim / 2):
14614  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
14615  *         strides[i], strides[j] = strides[j], strides[i]
14616  *         shape[i], shape[j] = shape[j], shape[i]
14617  */
14618     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14619 
14620     /* "View.MemoryView":949
14621  *     for i in range(ndim / 2):
14622  *         j = ndim - 1 - i
14623  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
14624  *         shape[i], shape[j] = shape[j], shape[i]
14625  *
14626  */
14627     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14628     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14629     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14630     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14631 
14632     /* "View.MemoryView":950
14633  *         j = ndim - 1 - i
14634  *         strides[i], strides[j] = strides[j], strides[i]
14635  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
14636  *
14637  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14638  */
14639     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14640     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14641     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14642     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14643 
14644     /* "View.MemoryView":952
14645  *         shape[i], shape[j] = shape[j], shape[i]
14646  *
14647  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
14648  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
14649  *
14650  */
14651     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
14652     if (!__pyx_t_8) {
14653     } else {
14654       __pyx_t_7 = __pyx_t_8;
14655       goto __pyx_L6_bool_binop_done;
14656     }
14657     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
14658     __pyx_t_7 = __pyx_t_8;
14659     __pyx_L6_bool_binop_done:;
14660     if (__pyx_t_7) {
14661 
14662       /* "View.MemoryView":953
14663  *
14664  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14665  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
14666  *
14667  *     return 1
14668  */
14669       __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(1, 953, __pyx_L1_error)
14670 
14671       /* "View.MemoryView":952
14672  *         shape[i], shape[j] = shape[j], shape[i]
14673  *
14674  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
14675  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
14676  *
14677  */
14678     }
14679   }
14680 
14681   /* "View.MemoryView":955
14682  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
14683  *
14684  *     return 1             # <<<<<<<<<<<<<<
14685  *
14686  *
14687  */
14688   __pyx_r = 1;
14689   goto __pyx_L0;
14690 
14691   /* "View.MemoryView":939
14692  *
14693  * @cname('__pyx_memslice_transpose')
14694  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
14695  *     cdef int ndim = memslice.memview.view.ndim
14696  *
14697  */
14698 
14699   /* function exit code */
14700   __pyx_L1_error:;
14701   {
14702     #ifdef WITH_THREAD
14703     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14704     #endif
14705     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14706     #ifdef WITH_THREAD
14707     __Pyx_PyGILState_Release(__pyx_gilstate_save);
14708     #endif
14709   }
14710   __pyx_r = 0;
14711   __pyx_L0:;
14712   return __pyx_r;
14713 }
14714 
14715 /* "View.MemoryView":972
14716  *     cdef int (*to_dtype_func)(char *, object) except 0
14717  *
14718  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
14719  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14720  *
14721  */
14722 
14723 /* Python wrapper */
14724 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)14725 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14726   __Pyx_RefNannyDeclarations
14727   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14728   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14729 
14730   /* function exit code */
14731   __Pyx_RefNannyFinishContext();
14732 }
14733 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)14734 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14735   __Pyx_RefNannyDeclarations
14736   __Pyx_RefNannySetupContext("__dealloc__", 0);
14737 
14738   /* "View.MemoryView":973
14739  *
14740  *     def __dealloc__(self):
14741  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
14742  *
14743  *     cdef convert_item_to_object(self, char *itemp):
14744  */
14745   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
14746 
14747   /* "View.MemoryView":972
14748  *     cdef int (*to_dtype_func)(char *, object) except 0
14749  *
14750  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
14751  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14752  *
14753  */
14754 
14755   /* function exit code */
14756   __Pyx_RefNannyFinishContext();
14757 }
14758 
14759 /* "View.MemoryView":975
14760  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14761  *
14762  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
14763  *         if self.to_object_func != NULL:
14764  *             return self.to_object_func(itemp)
14765  */
14766 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)14767 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14768   PyObject *__pyx_r = NULL;
14769   __Pyx_RefNannyDeclarations
14770   int __pyx_t_1;
14771   PyObject *__pyx_t_2 = NULL;
14772   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14773 
14774   /* "View.MemoryView":976
14775  *
14776  *     cdef convert_item_to_object(self, char *itemp):
14777  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
14778  *             return self.to_object_func(itemp)
14779  *         else:
14780  */
14781   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
14782   if (__pyx_t_1) {
14783 
14784     /* "View.MemoryView":977
14785  *     cdef convert_item_to_object(self, char *itemp):
14786  *         if self.to_object_func != NULL:
14787  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
14788  *         else:
14789  *             return memoryview.convert_item_to_object(self, itemp)
14790  */
14791     __Pyx_XDECREF(__pyx_r);
14792     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
14793     __Pyx_GOTREF(__pyx_t_2);
14794     __pyx_r = __pyx_t_2;
14795     __pyx_t_2 = 0;
14796     goto __pyx_L0;
14797 
14798     /* "View.MemoryView":976
14799  *
14800  *     cdef convert_item_to_object(self, char *itemp):
14801  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
14802  *             return self.to_object_func(itemp)
14803  *         else:
14804  */
14805   }
14806 
14807   /* "View.MemoryView":979
14808  *             return self.to_object_func(itemp)
14809  *         else:
14810  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
14811  *
14812  *     cdef assign_item_from_object(self, char *itemp, object value):
14813  */
14814   /*else*/ {
14815     __Pyx_XDECREF(__pyx_r);
14816     __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(1, 979, __pyx_L1_error)
14817     __Pyx_GOTREF(__pyx_t_2);
14818     __pyx_r = __pyx_t_2;
14819     __pyx_t_2 = 0;
14820     goto __pyx_L0;
14821   }
14822 
14823   /* "View.MemoryView":975
14824  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14825  *
14826  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
14827  *         if self.to_object_func != NULL:
14828  *             return self.to_object_func(itemp)
14829  */
14830 
14831   /* function exit code */
14832   __pyx_L1_error:;
14833   __Pyx_XDECREF(__pyx_t_2);
14834   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14835   __pyx_r = 0;
14836   __pyx_L0:;
14837   __Pyx_XGIVEREF(__pyx_r);
14838   __Pyx_RefNannyFinishContext();
14839   return __pyx_r;
14840 }
14841 
14842 /* "View.MemoryView":981
14843  *             return memoryview.convert_item_to_object(self, itemp)
14844  *
14845  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
14846  *         if self.to_dtype_func != NULL:
14847  *             self.to_dtype_func(itemp, value)
14848  */
14849 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)14850 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14851   PyObject *__pyx_r = NULL;
14852   __Pyx_RefNannyDeclarations
14853   int __pyx_t_1;
14854   int __pyx_t_2;
14855   PyObject *__pyx_t_3 = NULL;
14856   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14857 
14858   /* "View.MemoryView":982
14859  *
14860  *     cdef assign_item_from_object(self, char *itemp, object value):
14861  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
14862  *             self.to_dtype_func(itemp, value)
14863  *         else:
14864  */
14865   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
14866   if (__pyx_t_1) {
14867 
14868     /* "View.MemoryView":983
14869  *     cdef assign_item_from_object(self, char *itemp, object value):
14870  *         if self.to_dtype_func != NULL:
14871  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
14872  *         else:
14873  *             memoryview.assign_item_from_object(self, itemp, value)
14874  */
14875     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 983, __pyx_L1_error)
14876 
14877     /* "View.MemoryView":982
14878  *
14879  *     cdef assign_item_from_object(self, char *itemp, object value):
14880  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
14881  *             self.to_dtype_func(itemp, value)
14882  *         else:
14883  */
14884     goto __pyx_L3;
14885   }
14886 
14887   /* "View.MemoryView":985
14888  *             self.to_dtype_func(itemp, value)
14889  *         else:
14890  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
14891  *
14892  *     @property
14893  */
14894   /*else*/ {
14895     __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(1, 985, __pyx_L1_error)
14896     __Pyx_GOTREF(__pyx_t_3);
14897     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14898   }
14899   __pyx_L3:;
14900 
14901   /* "View.MemoryView":981
14902  *             return memoryview.convert_item_to_object(self, itemp)
14903  *
14904  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
14905  *         if self.to_dtype_func != NULL:
14906  *             self.to_dtype_func(itemp, value)
14907  */
14908 
14909   /* function exit code */
14910   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14911   goto __pyx_L0;
14912   __pyx_L1_error:;
14913   __Pyx_XDECREF(__pyx_t_3);
14914   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14915   __pyx_r = 0;
14916   __pyx_L0:;
14917   __Pyx_XGIVEREF(__pyx_r);
14918   __Pyx_RefNannyFinishContext();
14919   return __pyx_r;
14920 }
14921 
14922 /* "View.MemoryView":988
14923  *
14924  *     @property
14925  *     def base(self):             # <<<<<<<<<<<<<<
14926  *         return self.from_object
14927  *
14928  */
14929 
14930 /* Python wrapper */
14931 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)14932 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
14933   PyObject *__pyx_r = 0;
14934   __Pyx_RefNannyDeclarations
14935   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14936   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14937 
14938   /* function exit code */
14939   __Pyx_RefNannyFinishContext();
14940   return __pyx_r;
14941 }
14942 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)14943 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14944   PyObject *__pyx_r = NULL;
14945   __Pyx_RefNannyDeclarations
14946   __Pyx_RefNannySetupContext("__get__", 0);
14947 
14948   /* "View.MemoryView":989
14949  *     @property
14950  *     def base(self):
14951  *         return self.from_object             # <<<<<<<<<<<<<<
14952  *
14953  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
14954  */
14955   __Pyx_XDECREF(__pyx_r);
14956   __Pyx_INCREF(__pyx_v_self->from_object);
14957   __pyx_r = __pyx_v_self->from_object;
14958   goto __pyx_L0;
14959 
14960   /* "View.MemoryView":988
14961  *
14962  *     @property
14963  *     def base(self):             # <<<<<<<<<<<<<<
14964  *         return self.from_object
14965  *
14966  */
14967 
14968   /* function exit code */
14969   __pyx_L0:;
14970   __Pyx_XGIVEREF(__pyx_r);
14971   __Pyx_RefNannyFinishContext();
14972   return __pyx_r;
14973 }
14974 
14975 /* "(tree fragment)":1
14976  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14977  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14978  * def __setstate_cython__(self, __pyx_state):
14979  */
14980 
14981 /* Python wrapper */
14982 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)14983 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14984   PyObject *__pyx_r = 0;
14985   __Pyx_RefNannyDeclarations
14986   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14987   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14988 
14989   /* function exit code */
14990   __Pyx_RefNannyFinishContext();
14991   return __pyx_r;
14992 }
14993 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)14994 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14995   PyObject *__pyx_r = NULL;
14996   __Pyx_RefNannyDeclarations
14997   PyObject *__pyx_t_1 = NULL;
14998   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14999 
15000   /* "(tree fragment)":2
15001  * def __reduce_cython__(self):
15002  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15003  * def __setstate_cython__(self, __pyx_state):
15004  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15005  */
15006   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15007   __Pyx_GOTREF(__pyx_t_1);
15008   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15009   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15010   __PYX_ERR(1, 2, __pyx_L1_error)
15011 
15012   /* "(tree fragment)":1
15013  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15014  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15015  * def __setstate_cython__(self, __pyx_state):
15016  */
15017 
15018   /* function exit code */
15019   __pyx_L1_error:;
15020   __Pyx_XDECREF(__pyx_t_1);
15021   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15022   __pyx_r = NULL;
15023   __Pyx_XGIVEREF(__pyx_r);
15024   __Pyx_RefNannyFinishContext();
15025   return __pyx_r;
15026 }
15027 
15028 /* "(tree fragment)":3
15029  * def __reduce_cython__(self):
15030  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15031  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15032  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15033  */
15034 
15035 /* Python wrapper */
15036 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)15037 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15038   PyObject *__pyx_r = 0;
15039   __Pyx_RefNannyDeclarations
15040   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15041   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15042 
15043   /* function exit code */
15044   __Pyx_RefNannyFinishContext();
15045   return __pyx_r;
15046 }
15047 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)15048 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) {
15049   PyObject *__pyx_r = NULL;
15050   __Pyx_RefNannyDeclarations
15051   PyObject *__pyx_t_1 = NULL;
15052   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15053 
15054   /* "(tree fragment)":4
15055  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15056  * def __setstate_cython__(self, __pyx_state):
15057  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
15058  */
15059   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15060   __Pyx_GOTREF(__pyx_t_1);
15061   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15062   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15063   __PYX_ERR(1, 4, __pyx_L1_error)
15064 
15065   /* "(tree fragment)":3
15066  * def __reduce_cython__(self):
15067  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15068  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15069  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15070  */
15071 
15072   /* function exit code */
15073   __pyx_L1_error:;
15074   __Pyx_XDECREF(__pyx_t_1);
15075   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15076   __pyx_r = NULL;
15077   __Pyx_XGIVEREF(__pyx_r);
15078   __Pyx_RefNannyFinishContext();
15079   return __pyx_r;
15080 }
15081 
15082 /* "View.MemoryView":995
15083  *
15084  * @cname('__pyx_memoryview_fromslice')
15085  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
15086  *                           int ndim,
15087  *                           object (*to_object_func)(char *),
15088  */
15089 
__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)15090 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) {
15091   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15092   Py_ssize_t __pyx_v_suboffset;
15093   PyObject *__pyx_v_length = NULL;
15094   PyObject *__pyx_r = NULL;
15095   __Pyx_RefNannyDeclarations
15096   int __pyx_t_1;
15097   PyObject *__pyx_t_2 = NULL;
15098   PyObject *__pyx_t_3 = NULL;
15099   __Pyx_TypeInfo *__pyx_t_4;
15100   Py_buffer __pyx_t_5;
15101   Py_ssize_t *__pyx_t_6;
15102   Py_ssize_t *__pyx_t_7;
15103   Py_ssize_t *__pyx_t_8;
15104   Py_ssize_t __pyx_t_9;
15105   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15106 
15107   /* "View.MemoryView":1003
15108  *     cdef _memoryviewslice result
15109  *
15110  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
15111  *         return None
15112  *
15113  */
15114   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
15115   if (__pyx_t_1) {
15116 
15117     /* "View.MemoryView":1004
15118  *
15119  *     if <PyObject *> memviewslice.memview == Py_None:
15120  *         return None             # <<<<<<<<<<<<<<
15121  *
15122  *
15123  */
15124     __Pyx_XDECREF(__pyx_r);
15125     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15126     goto __pyx_L0;
15127 
15128     /* "View.MemoryView":1003
15129  *     cdef _memoryviewslice result
15130  *
15131  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
15132  *         return None
15133  *
15134  */
15135   }
15136 
15137   /* "View.MemoryView":1009
15138  *
15139  *
15140  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
15141  *
15142  *     result.from_slice = memviewslice
15143  */
15144   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
15145   __Pyx_GOTREF(__pyx_t_2);
15146   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
15147   __Pyx_GOTREF(__pyx_t_3);
15148   __Pyx_INCREF(Py_None);
15149   __Pyx_GIVEREF(Py_None);
15150   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
15151   __Pyx_INCREF(__pyx_int_0);
15152   __Pyx_GIVEREF(__pyx_int_0);
15153   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
15154   __Pyx_GIVEREF(__pyx_t_2);
15155   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15156   __pyx_t_2 = 0;
15157   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
15158   __Pyx_GOTREF(__pyx_t_2);
15159   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15160   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15161   __pyx_t_2 = 0;
15162 
15163   /* "View.MemoryView":1011
15164  *     result = _memoryviewslice(None, 0, dtype_is_object)
15165  *
15166  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
15167  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
15168  *
15169  */
15170   __pyx_v_result->from_slice = __pyx_v_memviewslice;
15171 
15172   /* "View.MemoryView":1012
15173  *
15174  *     result.from_slice = memviewslice
15175  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
15176  *
15177  *     result.from_object = (<memoryview> memviewslice.memview).base
15178  */
15179   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15180 
15181   /* "View.MemoryView":1014
15182  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
15183  *
15184  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
15185  *     result.typeinfo = memviewslice.memview.typeinfo
15186  *
15187  */
15188   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
15189   __Pyx_GOTREF(__pyx_t_2);
15190   __Pyx_GIVEREF(__pyx_t_2);
15191   __Pyx_GOTREF(__pyx_v_result->from_object);
15192   __Pyx_DECREF(__pyx_v_result->from_object);
15193   __pyx_v_result->from_object = __pyx_t_2;
15194   __pyx_t_2 = 0;
15195 
15196   /* "View.MemoryView":1015
15197  *
15198  *     result.from_object = (<memoryview> memviewslice.memview).base
15199  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
15200  *
15201  *     result.view = memviewslice.memview.view
15202  */
15203   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15204   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15205 
15206   /* "View.MemoryView":1017
15207  *     result.typeinfo = memviewslice.memview.typeinfo
15208  *
15209  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
15210  *     result.view.buf = <void *> memviewslice.data
15211  *     result.view.ndim = ndim
15212  */
15213   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15214   __pyx_v_result->__pyx_base.view = __pyx_t_5;
15215 
15216   /* "View.MemoryView":1018
15217  *
15218  *     result.view = memviewslice.memview.view
15219  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
15220  *     result.view.ndim = ndim
15221  *     (<__pyx_buffer *> &result.view).obj = Py_None
15222  */
15223   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15224 
15225   /* "View.MemoryView":1019
15226  *     result.view = memviewslice.memview.view
15227  *     result.view.buf = <void *> memviewslice.data
15228  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
15229  *     (<__pyx_buffer *> &result.view).obj = Py_None
15230  *     Py_INCREF(Py_None)
15231  */
15232   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15233 
15234   /* "View.MemoryView":1020
15235  *     result.view.buf = <void *> memviewslice.data
15236  *     result.view.ndim = ndim
15237  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
15238  *     Py_INCREF(Py_None)
15239  *
15240  */
15241   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15242 
15243   /* "View.MemoryView":1021
15244  *     result.view.ndim = ndim
15245  *     (<__pyx_buffer *> &result.view).obj = Py_None
15246  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
15247  *
15248  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15249  */
15250   Py_INCREF(Py_None);
15251 
15252   /* "View.MemoryView":1023
15253  *     Py_INCREF(Py_None)
15254  *
15255  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
15256  *         result.flags = PyBUF_RECORDS
15257  *     else:
15258  */
15259   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15260   if (__pyx_t_1) {
15261 
15262     /* "View.MemoryView":1024
15263  *
15264  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15265  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
15266  *     else:
15267  *         result.flags = PyBUF_RECORDS_RO
15268  */
15269     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15270 
15271     /* "View.MemoryView":1023
15272  *     Py_INCREF(Py_None)
15273  *
15274  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
15275  *         result.flags = PyBUF_RECORDS
15276  *     else:
15277  */
15278     goto __pyx_L4;
15279   }
15280 
15281   /* "View.MemoryView":1026
15282  *         result.flags = PyBUF_RECORDS
15283  *     else:
15284  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
15285  *
15286  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
15287  */
15288   /*else*/ {
15289     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15290   }
15291   __pyx_L4:;
15292 
15293   /* "View.MemoryView":1028
15294  *         result.flags = PyBUF_RECORDS_RO
15295  *
15296  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
15297  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
15298  *
15299  */
15300   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15301 
15302   /* "View.MemoryView":1029
15303  *
15304  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
15305  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
15306  *
15307  *
15308  */
15309   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15310 
15311   /* "View.MemoryView":1032
15312  *
15313  *
15314  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
15315  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15316  *         if suboffset >= 0:
15317  */
15318   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15319 
15320   /* "View.MemoryView":1033
15321  *
15322  *     result.view.suboffsets = NULL
15323  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
15324  *         if suboffset >= 0:
15325  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15326  */
15327   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15328   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15329     __pyx_t_6 = __pyx_t_8;
15330     __pyx_v_suboffset = (__pyx_t_6[0]);
15331 
15332     /* "View.MemoryView":1034
15333  *     result.view.suboffsets = NULL
15334  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15335  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
15336  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15337  *             break
15338  */
15339     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
15340     if (__pyx_t_1) {
15341 
15342       /* "View.MemoryView":1035
15343  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15344  *         if suboffset >= 0:
15345  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
15346  *             break
15347  *
15348  */
15349       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15350 
15351       /* "View.MemoryView":1036
15352  *         if suboffset >= 0:
15353  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15354  *             break             # <<<<<<<<<<<<<<
15355  *
15356  *     result.view.len = result.view.itemsize
15357  */
15358       goto __pyx_L6_break;
15359 
15360       /* "View.MemoryView":1034
15361  *     result.view.suboffsets = NULL
15362  *     for suboffset in result.from_slice.suboffsets[:ndim]:
15363  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
15364  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15365  *             break
15366  */
15367     }
15368   }
15369   __pyx_L6_break:;
15370 
15371   /* "View.MemoryView":1038
15372  *             break
15373  *
15374  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
15375  *     for length in result.view.shape[:ndim]:
15376  *         result.view.len *= length
15377  */
15378   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15379   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15380 
15381   /* "View.MemoryView":1039
15382  *
15383  *     result.view.len = result.view.itemsize
15384  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
15385  *         result.view.len *= length
15386  *
15387  */
15388   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15389   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15390     __pyx_t_6 = __pyx_t_8;
15391     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
15392     __Pyx_GOTREF(__pyx_t_2);
15393     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15394     __pyx_t_2 = 0;
15395 
15396     /* "View.MemoryView":1040
15397  *     result.view.len = result.view.itemsize
15398  *     for length in result.view.shape[:ndim]:
15399  *         result.view.len *= length             # <<<<<<<<<<<<<<
15400  *
15401  *     result.to_object_func = to_object_func
15402  */
15403     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
15404     __Pyx_GOTREF(__pyx_t_2);
15405     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
15406     __Pyx_GOTREF(__pyx_t_3);
15407     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15408     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
15409     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15410     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15411   }
15412 
15413   /* "View.MemoryView":1042
15414  *         result.view.len *= length
15415  *
15416  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
15417  *     result.to_dtype_func = to_dtype_func
15418  *
15419  */
15420   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15421 
15422   /* "View.MemoryView":1043
15423  *
15424  *     result.to_object_func = to_object_func
15425  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
15426  *
15427  *     return result
15428  */
15429   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15430 
15431   /* "View.MemoryView":1045
15432  *     result.to_dtype_func = to_dtype_func
15433  *
15434  *     return result             # <<<<<<<<<<<<<<
15435  *
15436  * @cname('__pyx_memoryview_get_slice_from_memoryview')
15437  */
15438   __Pyx_XDECREF(__pyx_r);
15439   __Pyx_INCREF(((PyObject *)__pyx_v_result));
15440   __pyx_r = ((PyObject *)__pyx_v_result);
15441   goto __pyx_L0;
15442 
15443   /* "View.MemoryView":995
15444  *
15445  * @cname('__pyx_memoryview_fromslice')
15446  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
15447  *                           int ndim,
15448  *                           object (*to_object_func)(char *),
15449  */
15450 
15451   /* function exit code */
15452   __pyx_L1_error:;
15453   __Pyx_XDECREF(__pyx_t_2);
15454   __Pyx_XDECREF(__pyx_t_3);
15455   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15456   __pyx_r = 0;
15457   __pyx_L0:;
15458   __Pyx_XDECREF((PyObject *)__pyx_v_result);
15459   __Pyx_XDECREF(__pyx_v_length);
15460   __Pyx_XGIVEREF(__pyx_r);
15461   __Pyx_RefNannyFinishContext();
15462   return __pyx_r;
15463 }
15464 
15465 /* "View.MemoryView":1048
15466  *
15467  * @cname('__pyx_memoryview_get_slice_from_memoryview')
15468  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
15469  *                                                    __Pyx_memviewslice *mslice):
15470  *     cdef _memoryviewslice obj
15471  */
15472 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)15473 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15474   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15475   __Pyx_memviewslice *__pyx_r;
15476   __Pyx_RefNannyDeclarations
15477   int __pyx_t_1;
15478   int __pyx_t_2;
15479   PyObject *__pyx_t_3 = NULL;
15480   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15481 
15482   /* "View.MemoryView":1051
15483  *                                                    __Pyx_memviewslice *mslice):
15484  *     cdef _memoryviewslice obj
15485  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15486  *         obj = memview
15487  *         return &obj.from_slice
15488  */
15489   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15490   __pyx_t_2 = (__pyx_t_1 != 0);
15491   if (__pyx_t_2) {
15492 
15493     /* "View.MemoryView":1052
15494  *     cdef _memoryviewslice obj
15495  *     if isinstance(memview, _memoryviewslice):
15496  *         obj = memview             # <<<<<<<<<<<<<<
15497  *         return &obj.from_slice
15498  *     else:
15499  */
15500     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
15501     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15502     __Pyx_INCREF(__pyx_t_3);
15503     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15504     __pyx_t_3 = 0;
15505 
15506     /* "View.MemoryView":1053
15507  *     if isinstance(memview, _memoryviewslice):
15508  *         obj = memview
15509  *         return &obj.from_slice             # <<<<<<<<<<<<<<
15510  *     else:
15511  *         slice_copy(memview, mslice)
15512  */
15513     __pyx_r = (&__pyx_v_obj->from_slice);
15514     goto __pyx_L0;
15515 
15516     /* "View.MemoryView":1051
15517  *                                                    __Pyx_memviewslice *mslice):
15518  *     cdef _memoryviewslice obj
15519  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15520  *         obj = memview
15521  *         return &obj.from_slice
15522  */
15523   }
15524 
15525   /* "View.MemoryView":1055
15526  *         return &obj.from_slice
15527  *     else:
15528  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
15529  *         return mslice
15530  *
15531  */
15532   /*else*/ {
15533     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15534 
15535     /* "View.MemoryView":1056
15536  *     else:
15537  *         slice_copy(memview, mslice)
15538  *         return mslice             # <<<<<<<<<<<<<<
15539  *
15540  * @cname('__pyx_memoryview_slice_copy')
15541  */
15542     __pyx_r = __pyx_v_mslice;
15543     goto __pyx_L0;
15544   }
15545 
15546   /* "View.MemoryView":1048
15547  *
15548  * @cname('__pyx_memoryview_get_slice_from_memoryview')
15549  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
15550  *                                                    __Pyx_memviewslice *mslice):
15551  *     cdef _memoryviewslice obj
15552  */
15553 
15554   /* function exit code */
15555   __pyx_L1_error:;
15556   __Pyx_XDECREF(__pyx_t_3);
15557   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15558   __pyx_r = 0;
15559   __pyx_L0:;
15560   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15561   __Pyx_RefNannyFinishContext();
15562   return __pyx_r;
15563 }
15564 
15565 /* "View.MemoryView":1059
15566  *
15567  * @cname('__pyx_memoryview_slice_copy')
15568  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
15569  *     cdef int dim
15570  *     cdef (Py_ssize_t*) shape, strides, suboffsets
15571  */
15572 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)15573 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15574   int __pyx_v_dim;
15575   Py_ssize_t *__pyx_v_shape;
15576   Py_ssize_t *__pyx_v_strides;
15577   Py_ssize_t *__pyx_v_suboffsets;
15578   __Pyx_RefNannyDeclarations
15579   Py_ssize_t *__pyx_t_1;
15580   int __pyx_t_2;
15581   int __pyx_t_3;
15582   int __pyx_t_4;
15583   Py_ssize_t __pyx_t_5;
15584   __Pyx_RefNannySetupContext("slice_copy", 0);
15585 
15586   /* "View.MemoryView":1063
15587  *     cdef (Py_ssize_t*) shape, strides, suboffsets
15588  *
15589  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
15590  *     strides = memview.view.strides
15591  *     suboffsets = memview.view.suboffsets
15592  */
15593   __pyx_t_1 = __pyx_v_memview->view.shape;
15594   __pyx_v_shape = __pyx_t_1;
15595 
15596   /* "View.MemoryView":1064
15597  *
15598  *     shape = memview.view.shape
15599  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
15600  *     suboffsets = memview.view.suboffsets
15601  *
15602  */
15603   __pyx_t_1 = __pyx_v_memview->view.strides;
15604   __pyx_v_strides = __pyx_t_1;
15605 
15606   /* "View.MemoryView":1065
15607  *     shape = memview.view.shape
15608  *     strides = memview.view.strides
15609  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
15610  *
15611  *     dst.memview = <__pyx_memoryview *> memview
15612  */
15613   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15614   __pyx_v_suboffsets = __pyx_t_1;
15615 
15616   /* "View.MemoryView":1067
15617  *     suboffsets = memview.view.suboffsets
15618  *
15619  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
15620  *     dst.data = <char *> memview.view.buf
15621  *
15622  */
15623   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15624 
15625   /* "View.MemoryView":1068
15626  *
15627  *     dst.memview = <__pyx_memoryview *> memview
15628  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
15629  *
15630  *     for dim in range(memview.view.ndim):
15631  */
15632   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15633 
15634   /* "View.MemoryView":1070
15635  *     dst.data = <char *> memview.view.buf
15636  *
15637  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
15638  *         dst.shape[dim] = shape[dim]
15639  *         dst.strides[dim] = strides[dim]
15640  */
15641   __pyx_t_2 = __pyx_v_memview->view.ndim;
15642   __pyx_t_3 = __pyx_t_2;
15643   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15644     __pyx_v_dim = __pyx_t_4;
15645 
15646     /* "View.MemoryView":1071
15647  *
15648  *     for dim in range(memview.view.ndim):
15649  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
15650  *         dst.strides[dim] = strides[dim]
15651  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15652  */
15653     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15654 
15655     /* "View.MemoryView":1072
15656  *     for dim in range(memview.view.ndim):
15657  *         dst.shape[dim] = shape[dim]
15658  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
15659  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15660  *
15661  */
15662     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15663 
15664     /* "View.MemoryView":1073
15665  *         dst.shape[dim] = shape[dim]
15666  *         dst.strides[dim] = strides[dim]
15667  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
15668  *
15669  * @cname('__pyx_memoryview_copy_object')
15670  */
15671     if ((__pyx_v_suboffsets != 0)) {
15672       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15673     } else {
15674       __pyx_t_5 = -1L;
15675     }
15676     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15677   }
15678 
15679   /* "View.MemoryView":1059
15680  *
15681  * @cname('__pyx_memoryview_slice_copy')
15682  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
15683  *     cdef int dim
15684  *     cdef (Py_ssize_t*) shape, strides, suboffsets
15685  */
15686 
15687   /* function exit code */
15688   __Pyx_RefNannyFinishContext();
15689 }
15690 
15691 /* "View.MemoryView":1076
15692  *
15693  * @cname('__pyx_memoryview_copy_object')
15694  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
15695  *     "Create a new memoryview object"
15696  *     cdef __Pyx_memviewslice memviewslice
15697  */
15698 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)15699 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15700   __Pyx_memviewslice __pyx_v_memviewslice;
15701   PyObject *__pyx_r = NULL;
15702   __Pyx_RefNannyDeclarations
15703   PyObject *__pyx_t_1 = NULL;
15704   __Pyx_RefNannySetupContext("memoryview_copy", 0);
15705 
15706   /* "View.MemoryView":1079
15707  *     "Create a new memoryview object"
15708  *     cdef __Pyx_memviewslice memviewslice
15709  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
15710  *     return memoryview_copy_from_slice(memview, &memviewslice)
15711  *
15712  */
15713   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15714 
15715   /* "View.MemoryView":1080
15716  *     cdef __Pyx_memviewslice memviewslice
15717  *     slice_copy(memview, &memviewslice)
15718  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
15719  *
15720  * @cname('__pyx_memoryview_copy_object_from_slice')
15721  */
15722   __Pyx_XDECREF(__pyx_r);
15723   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
15724   __Pyx_GOTREF(__pyx_t_1);
15725   __pyx_r = __pyx_t_1;
15726   __pyx_t_1 = 0;
15727   goto __pyx_L0;
15728 
15729   /* "View.MemoryView":1076
15730  *
15731  * @cname('__pyx_memoryview_copy_object')
15732  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
15733  *     "Create a new memoryview object"
15734  *     cdef __Pyx_memviewslice memviewslice
15735  */
15736 
15737   /* function exit code */
15738   __pyx_L1_error:;
15739   __Pyx_XDECREF(__pyx_t_1);
15740   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15741   __pyx_r = 0;
15742   __pyx_L0:;
15743   __Pyx_XGIVEREF(__pyx_r);
15744   __Pyx_RefNannyFinishContext();
15745   return __pyx_r;
15746 }
15747 
15748 /* "View.MemoryView":1083
15749  *
15750  * @cname('__pyx_memoryview_copy_object_from_slice')
15751  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
15752  *     """
15753  *     Create a new memoryview object from a given memoryview object and slice.
15754  */
15755 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)15756 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15757   PyObject *(*__pyx_v_to_object_func)(char *);
15758   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15759   PyObject *__pyx_r = NULL;
15760   __Pyx_RefNannyDeclarations
15761   int __pyx_t_1;
15762   int __pyx_t_2;
15763   PyObject *(*__pyx_t_3)(char *);
15764   int (*__pyx_t_4)(char *, PyObject *);
15765   PyObject *__pyx_t_5 = NULL;
15766   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15767 
15768   /* "View.MemoryView":1090
15769  *     cdef int (*to_dtype_func)(char *, object) except 0
15770  *
15771  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15772  *         to_object_func = (<_memoryviewslice> memview).to_object_func
15773  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15774  */
15775   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15776   __pyx_t_2 = (__pyx_t_1 != 0);
15777   if (__pyx_t_2) {
15778 
15779     /* "View.MemoryView":1091
15780  *
15781  *     if isinstance(memview, _memoryviewslice):
15782  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
15783  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15784  *     else:
15785  */
15786     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15787     __pyx_v_to_object_func = __pyx_t_3;
15788 
15789     /* "View.MemoryView":1092
15790  *     if isinstance(memview, _memoryviewslice):
15791  *         to_object_func = (<_memoryviewslice> memview).to_object_func
15792  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
15793  *     else:
15794  *         to_object_func = NULL
15795  */
15796     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15797     __pyx_v_to_dtype_func = __pyx_t_4;
15798 
15799     /* "View.MemoryView":1090
15800  *     cdef int (*to_dtype_func)(char *, object) except 0
15801  *
15802  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15803  *         to_object_func = (<_memoryviewslice> memview).to_object_func
15804  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15805  */
15806     goto __pyx_L3;
15807   }
15808 
15809   /* "View.MemoryView":1094
15810  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15811  *     else:
15812  *         to_object_func = NULL             # <<<<<<<<<<<<<<
15813  *         to_dtype_func = NULL
15814  *
15815  */
15816   /*else*/ {
15817     __pyx_v_to_object_func = NULL;
15818 
15819     /* "View.MemoryView":1095
15820  *     else:
15821  *         to_object_func = NULL
15822  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
15823  *
15824  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15825  */
15826     __pyx_v_to_dtype_func = NULL;
15827   }
15828   __pyx_L3:;
15829 
15830   /* "View.MemoryView":1097
15831  *         to_dtype_func = NULL
15832  *
15833  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
15834  *                                 to_object_func, to_dtype_func,
15835  *                                 memview.dtype_is_object)
15836  */
15837   __Pyx_XDECREF(__pyx_r);
15838 
15839   /* "View.MemoryView":1099
15840  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15841  *                                 to_object_func, to_dtype_func,
15842  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
15843  *
15844  *
15845  */
15846   __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(1, 1097, __pyx_L1_error)
15847   __Pyx_GOTREF(__pyx_t_5);
15848   __pyx_r = __pyx_t_5;
15849   __pyx_t_5 = 0;
15850   goto __pyx_L0;
15851 
15852   /* "View.MemoryView":1083
15853  *
15854  * @cname('__pyx_memoryview_copy_object_from_slice')
15855  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
15856  *     """
15857  *     Create a new memoryview object from a given memoryview object and slice.
15858  */
15859 
15860   /* function exit code */
15861   __pyx_L1_error:;
15862   __Pyx_XDECREF(__pyx_t_5);
15863   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15864   __pyx_r = 0;
15865   __pyx_L0:;
15866   __Pyx_XGIVEREF(__pyx_r);
15867   __Pyx_RefNannyFinishContext();
15868   return __pyx_r;
15869 }
15870 
15871 /* "View.MemoryView":1105
15872  *
15873  *
15874  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
15875  *     if arg < 0:
15876  *         return -arg
15877  */
15878 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)15879 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15880   Py_ssize_t __pyx_r;
15881   int __pyx_t_1;
15882 
15883   /* "View.MemoryView":1106
15884  *
15885  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15886  *     if arg < 0:             # <<<<<<<<<<<<<<
15887  *         return -arg
15888  *     else:
15889  */
15890   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
15891   if (__pyx_t_1) {
15892 
15893     /* "View.MemoryView":1107
15894  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15895  *     if arg < 0:
15896  *         return -arg             # <<<<<<<<<<<<<<
15897  *     else:
15898  *         return arg
15899  */
15900     __pyx_r = (-__pyx_v_arg);
15901     goto __pyx_L0;
15902 
15903     /* "View.MemoryView":1106
15904  *
15905  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15906  *     if arg < 0:             # <<<<<<<<<<<<<<
15907  *         return -arg
15908  *     else:
15909  */
15910   }
15911 
15912   /* "View.MemoryView":1109
15913  *         return -arg
15914  *     else:
15915  *         return arg             # <<<<<<<<<<<<<<
15916  *
15917  * @cname('__pyx_get_best_slice_order')
15918  */
15919   /*else*/ {
15920     __pyx_r = __pyx_v_arg;
15921     goto __pyx_L0;
15922   }
15923 
15924   /* "View.MemoryView":1105
15925  *
15926  *
15927  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
15928  *     if arg < 0:
15929  *         return -arg
15930  */
15931 
15932   /* function exit code */
15933   __pyx_L0:;
15934   return __pyx_r;
15935 }
15936 
15937 /* "View.MemoryView":1112
15938  *
15939  * @cname('__pyx_get_best_slice_order')
15940  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
15941  *     """
15942  *     Figure out the best memory access order for a given slice.
15943  */
15944 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)15945 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15946   int __pyx_v_i;
15947   Py_ssize_t __pyx_v_c_stride;
15948   Py_ssize_t __pyx_v_f_stride;
15949   char __pyx_r;
15950   int __pyx_t_1;
15951   int __pyx_t_2;
15952   int __pyx_t_3;
15953   int __pyx_t_4;
15954 
15955   /* "View.MemoryView":1117
15956  *     """
15957  *     cdef int i
15958  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
15959  *     cdef Py_ssize_t f_stride = 0
15960  *
15961  */
15962   __pyx_v_c_stride = 0;
15963 
15964   /* "View.MemoryView":1118
15965  *     cdef int i
15966  *     cdef Py_ssize_t c_stride = 0
15967  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
15968  *
15969  *     for i in range(ndim - 1, -1, -1):
15970  */
15971   __pyx_v_f_stride = 0;
15972 
15973   /* "View.MemoryView":1120
15974  *     cdef Py_ssize_t f_stride = 0
15975  *
15976  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
15977  *         if mslice.shape[i] > 1:
15978  *             c_stride = mslice.strides[i]
15979  */
15980   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15981     __pyx_v_i = __pyx_t_1;
15982 
15983     /* "View.MemoryView":1121
15984  *
15985  *     for i in range(ndim - 1, -1, -1):
15986  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
15987  *             c_stride = mslice.strides[i]
15988  *             break
15989  */
15990     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
15991     if (__pyx_t_2) {
15992 
15993       /* "View.MemoryView":1122
15994  *     for i in range(ndim - 1, -1, -1):
15995  *         if mslice.shape[i] > 1:
15996  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
15997  *             break
15998  *
15999  */
16000       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16001 
16002       /* "View.MemoryView":1123
16003  *         if mslice.shape[i] > 1:
16004  *             c_stride = mslice.strides[i]
16005  *             break             # <<<<<<<<<<<<<<
16006  *
16007  *     for i in range(ndim):
16008  */
16009       goto __pyx_L4_break;
16010 
16011       /* "View.MemoryView":1121
16012  *
16013  *     for i in range(ndim - 1, -1, -1):
16014  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16015  *             c_stride = mslice.strides[i]
16016  *             break
16017  */
16018     }
16019   }
16020   __pyx_L4_break:;
16021 
16022   /* "View.MemoryView":1125
16023  *             break
16024  *
16025  *     for i in range(ndim):             # <<<<<<<<<<<<<<
16026  *         if mslice.shape[i] > 1:
16027  *             f_stride = mslice.strides[i]
16028  */
16029   __pyx_t_1 = __pyx_v_ndim;
16030   __pyx_t_3 = __pyx_t_1;
16031   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16032     __pyx_v_i = __pyx_t_4;
16033 
16034     /* "View.MemoryView":1126
16035  *
16036  *     for i in range(ndim):
16037  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16038  *             f_stride = mslice.strides[i]
16039  *             break
16040  */
16041     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16042     if (__pyx_t_2) {
16043 
16044       /* "View.MemoryView":1127
16045  *     for i in range(ndim):
16046  *         if mslice.shape[i] > 1:
16047  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
16048  *             break
16049  *
16050  */
16051       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16052 
16053       /* "View.MemoryView":1128
16054  *         if mslice.shape[i] > 1:
16055  *             f_stride = mslice.strides[i]
16056  *             break             # <<<<<<<<<<<<<<
16057  *
16058  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16059  */
16060       goto __pyx_L7_break;
16061 
16062       /* "View.MemoryView":1126
16063  *
16064  *     for i in range(ndim):
16065  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
16066  *             f_stride = mslice.strides[i]
16067  *             break
16068  */
16069     }
16070   }
16071   __pyx_L7_break:;
16072 
16073   /* "View.MemoryView":1130
16074  *             break
16075  *
16076  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
16077  *         return 'C'
16078  *     else:
16079  */
16080   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
16081   if (__pyx_t_2) {
16082 
16083     /* "View.MemoryView":1131
16084  *
16085  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16086  *         return 'C'             # <<<<<<<<<<<<<<
16087  *     else:
16088  *         return 'F'
16089  */
16090     __pyx_r = 'C';
16091     goto __pyx_L0;
16092 
16093     /* "View.MemoryView":1130
16094  *             break
16095  *
16096  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
16097  *         return 'C'
16098  *     else:
16099  */
16100   }
16101 
16102   /* "View.MemoryView":1133
16103  *         return 'C'
16104  *     else:
16105  *         return 'F'             # <<<<<<<<<<<<<<
16106  *
16107  * @cython.cdivision(True)
16108  */
16109   /*else*/ {
16110     __pyx_r = 'F';
16111     goto __pyx_L0;
16112   }
16113 
16114   /* "View.MemoryView":1112
16115  *
16116  * @cname('__pyx_get_best_slice_order')
16117  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
16118  *     """
16119  *     Figure out the best memory access order for a given slice.
16120  */
16121 
16122   /* function exit code */
16123   __pyx_L0:;
16124   return __pyx_r;
16125 }
16126 
16127 /* "View.MemoryView":1136
16128  *
16129  * @cython.cdivision(True)
16130  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
16131  *                                    char *dst_data, Py_ssize_t *dst_strides,
16132  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16133  */
16134 
_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)16135 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) {
16136   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16137   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16138   Py_ssize_t __pyx_v_dst_extent;
16139   Py_ssize_t __pyx_v_src_stride;
16140   Py_ssize_t __pyx_v_dst_stride;
16141   int __pyx_t_1;
16142   int __pyx_t_2;
16143   int __pyx_t_3;
16144   Py_ssize_t __pyx_t_4;
16145   Py_ssize_t __pyx_t_5;
16146   Py_ssize_t __pyx_t_6;
16147 
16148   /* "View.MemoryView":1143
16149  *
16150  *     cdef Py_ssize_t i
16151  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
16152  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16153  *     cdef Py_ssize_t src_stride = src_strides[0]
16154  */
16155   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16156 
16157   /* "View.MemoryView":1144
16158  *     cdef Py_ssize_t i
16159  *     cdef Py_ssize_t src_extent = src_shape[0]
16160  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
16161  *     cdef Py_ssize_t src_stride = src_strides[0]
16162  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16163  */
16164   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16165 
16166   /* "View.MemoryView":1145
16167  *     cdef Py_ssize_t src_extent = src_shape[0]
16168  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16169  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
16170  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16171  *
16172  */
16173   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16174 
16175   /* "View.MemoryView":1146
16176  *     cdef Py_ssize_t dst_extent = dst_shape[0]
16177  *     cdef Py_ssize_t src_stride = src_strides[0]
16178  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
16179  *
16180  *     if ndim == 1:
16181  */
16182   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16183 
16184   /* "View.MemoryView":1148
16185  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16186  *
16187  *     if ndim == 1:             # <<<<<<<<<<<<<<
16188  *        if (src_stride > 0 and dst_stride > 0 and
16189  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16190  */
16191   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
16192   if (__pyx_t_1) {
16193 
16194     /* "View.MemoryView":1149
16195  *
16196  *     if ndim == 1:
16197  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16198  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16199  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16200  */
16201     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
16202     if (__pyx_t_2) {
16203     } else {
16204       __pyx_t_1 = __pyx_t_2;
16205       goto __pyx_L5_bool_binop_done;
16206     }
16207     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
16208     if (__pyx_t_2) {
16209     } else {
16210       __pyx_t_1 = __pyx_t_2;
16211       goto __pyx_L5_bool_binop_done;
16212     }
16213 
16214     /* "View.MemoryView":1150
16215  *     if ndim == 1:
16216  *        if (src_stride > 0 and dst_stride > 0 and
16217  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
16218  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16219  *        else:
16220  */
16221     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16222     if (__pyx_t_2) {
16223       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16224     }
16225     __pyx_t_3 = (__pyx_t_2 != 0);
16226     __pyx_t_1 = __pyx_t_3;
16227     __pyx_L5_bool_binop_done:;
16228 
16229     /* "View.MemoryView":1149
16230  *
16231  *     if ndim == 1:
16232  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16233  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16234  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16235  */
16236     if (__pyx_t_1) {
16237 
16238       /* "View.MemoryView":1151
16239  *        if (src_stride > 0 and dst_stride > 0 and
16240  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16241  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
16242  *        else:
16243  *            for i in range(dst_extent):
16244  */
16245       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16246 
16247       /* "View.MemoryView":1149
16248  *
16249  *     if ndim == 1:
16250  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
16251  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16252  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16253  */
16254       goto __pyx_L4;
16255     }
16256 
16257     /* "View.MemoryView":1153
16258  *            memcpy(dst_data, src_data, itemsize * dst_extent)
16259  *        else:
16260  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
16261  *                memcpy(dst_data, src_data, itemsize)
16262  *                src_data += src_stride
16263  */
16264     /*else*/ {
16265       __pyx_t_4 = __pyx_v_dst_extent;
16266       __pyx_t_5 = __pyx_t_4;
16267       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16268         __pyx_v_i = __pyx_t_6;
16269 
16270         /* "View.MemoryView":1154
16271  *        else:
16272  *            for i in range(dst_extent):
16273  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
16274  *                src_data += src_stride
16275  *                dst_data += dst_stride
16276  */
16277         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16278 
16279         /* "View.MemoryView":1155
16280  *            for i in range(dst_extent):
16281  *                memcpy(dst_data, src_data, itemsize)
16282  *                src_data += src_stride             # <<<<<<<<<<<<<<
16283  *                dst_data += dst_stride
16284  *     else:
16285  */
16286         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16287 
16288         /* "View.MemoryView":1156
16289  *                memcpy(dst_data, src_data, itemsize)
16290  *                src_data += src_stride
16291  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
16292  *     else:
16293  *         for i in range(dst_extent):
16294  */
16295         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16296       }
16297     }
16298     __pyx_L4:;
16299 
16300     /* "View.MemoryView":1148
16301  *     cdef Py_ssize_t dst_stride = dst_strides[0]
16302  *
16303  *     if ndim == 1:             # <<<<<<<<<<<<<<
16304  *        if (src_stride > 0 and dst_stride > 0 and
16305  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
16306  */
16307     goto __pyx_L3;
16308   }
16309 
16310   /* "View.MemoryView":1158
16311  *                dst_data += dst_stride
16312  *     else:
16313  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
16314  *             _copy_strided_to_strided(src_data, src_strides + 1,
16315  *                                      dst_data, dst_strides + 1,
16316  */
16317   /*else*/ {
16318     __pyx_t_4 = __pyx_v_dst_extent;
16319     __pyx_t_5 = __pyx_t_4;
16320     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16321       __pyx_v_i = __pyx_t_6;
16322 
16323       /* "View.MemoryView":1159
16324  *     else:
16325  *         for i in range(dst_extent):
16326  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
16327  *                                      dst_data, dst_strides + 1,
16328  *                                      src_shape + 1, dst_shape + 1,
16329  */
16330       _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);
16331 
16332       /* "View.MemoryView":1163
16333  *                                      src_shape + 1, dst_shape + 1,
16334  *                                      ndim - 1, itemsize)
16335  *             src_data += src_stride             # <<<<<<<<<<<<<<
16336  *             dst_data += dst_stride
16337  *
16338  */
16339       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16340 
16341       /* "View.MemoryView":1164
16342  *                                      ndim - 1, itemsize)
16343  *             src_data += src_stride
16344  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
16345  *
16346  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16347  */
16348       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16349     }
16350   }
16351   __pyx_L3:;
16352 
16353   /* "View.MemoryView":1136
16354  *
16355  * @cython.cdivision(True)
16356  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
16357  *                                    char *dst_data, Py_ssize_t *dst_strides,
16358  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16359  */
16360 
16361   /* function exit code */
16362 }
16363 
16364 /* "View.MemoryView":1166
16365  *             dst_data += dst_stride
16366  *
16367  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16368  *                                   __Pyx_memviewslice *dst,
16369  *                                   int ndim, size_t itemsize) nogil:
16370  */
16371 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)16372 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) {
16373 
16374   /* "View.MemoryView":1169
16375  *                                   __Pyx_memviewslice *dst,
16376  *                                   int ndim, size_t itemsize) nogil:
16377  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
16378  *                              src.shape, dst.shape, ndim, itemsize)
16379  *
16380  */
16381   _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);
16382 
16383   /* "View.MemoryView":1166
16384  *             dst_data += dst_stride
16385  *
16386  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16387  *                                   __Pyx_memviewslice *dst,
16388  *                                   int ndim, size_t itemsize) nogil:
16389  */
16390 
16391   /* function exit code */
16392 }
16393 
16394 /* "View.MemoryView":1173
16395  *
16396  * @cname('__pyx_memoryview_slice_get_size')
16397  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
16398  *     "Return the size of the memory occupied by the slice in number of bytes"
16399  *     cdef int i
16400  */
16401 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)16402 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16403   int __pyx_v_i;
16404   Py_ssize_t __pyx_v_size;
16405   Py_ssize_t __pyx_r;
16406   Py_ssize_t __pyx_t_1;
16407   int __pyx_t_2;
16408   int __pyx_t_3;
16409   int __pyx_t_4;
16410 
16411   /* "View.MemoryView":1176
16412  *     "Return the size of the memory occupied by the slice in number of bytes"
16413  *     cdef int i
16414  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
16415  *
16416  *     for i in range(ndim):
16417  */
16418   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16419   __pyx_v_size = __pyx_t_1;
16420 
16421   /* "View.MemoryView":1178
16422  *     cdef Py_ssize_t size = src.memview.view.itemsize
16423  *
16424  *     for i in range(ndim):             # <<<<<<<<<<<<<<
16425  *         size *= src.shape[i]
16426  *
16427  */
16428   __pyx_t_2 = __pyx_v_ndim;
16429   __pyx_t_3 = __pyx_t_2;
16430   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16431     __pyx_v_i = __pyx_t_4;
16432 
16433     /* "View.MemoryView":1179
16434  *
16435  *     for i in range(ndim):
16436  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
16437  *
16438  *     return size
16439  */
16440     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
16441   }
16442 
16443   /* "View.MemoryView":1181
16444  *         size *= src.shape[i]
16445  *
16446  *     return size             # <<<<<<<<<<<<<<
16447  *
16448  * @cname('__pyx_fill_contig_strides_array')
16449  */
16450   __pyx_r = __pyx_v_size;
16451   goto __pyx_L0;
16452 
16453   /* "View.MemoryView":1173
16454  *
16455  * @cname('__pyx_memoryview_slice_get_size')
16456  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
16457  *     "Return the size of the memory occupied by the slice in number of bytes"
16458  *     cdef int i
16459  */
16460 
16461   /* function exit code */
16462   __pyx_L0:;
16463   return __pyx_r;
16464 }
16465 
16466 /* "View.MemoryView":1184
16467  *
16468  * @cname('__pyx_fill_contig_strides_array')
16469  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
16470  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16471  *                 int ndim, char order) nogil:
16472  */
16473 
__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)16474 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) {
16475   int __pyx_v_idx;
16476   Py_ssize_t __pyx_r;
16477   int __pyx_t_1;
16478   int __pyx_t_2;
16479   int __pyx_t_3;
16480   int __pyx_t_4;
16481 
16482   /* "View.MemoryView":1193
16483  *     cdef int idx
16484  *
16485  *     if order == 'F':             # <<<<<<<<<<<<<<
16486  *         for idx in range(ndim):
16487  *             strides[idx] = stride
16488  */
16489   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
16490   if (__pyx_t_1) {
16491 
16492     /* "View.MemoryView":1194
16493  *
16494  *     if order == 'F':
16495  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
16496  *             strides[idx] = stride
16497  *             stride = stride * shape[idx]
16498  */
16499     __pyx_t_2 = __pyx_v_ndim;
16500     __pyx_t_3 = __pyx_t_2;
16501     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16502       __pyx_v_idx = __pyx_t_4;
16503 
16504       /* "View.MemoryView":1195
16505  *     if order == 'F':
16506  *         for idx in range(ndim):
16507  *             strides[idx] = stride             # <<<<<<<<<<<<<<
16508  *             stride = stride * shape[idx]
16509  *     else:
16510  */
16511       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16512 
16513       /* "View.MemoryView":1196
16514  *         for idx in range(ndim):
16515  *             strides[idx] = stride
16516  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
16517  *     else:
16518  *         for idx in range(ndim - 1, -1, -1):
16519  */
16520       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16521     }
16522 
16523     /* "View.MemoryView":1193
16524  *     cdef int idx
16525  *
16526  *     if order == 'F':             # <<<<<<<<<<<<<<
16527  *         for idx in range(ndim):
16528  *             strides[idx] = stride
16529  */
16530     goto __pyx_L3;
16531   }
16532 
16533   /* "View.MemoryView":1198
16534  *             stride = stride * shape[idx]
16535  *     else:
16536  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
16537  *             strides[idx] = stride
16538  *             stride = stride * shape[idx]
16539  */
16540   /*else*/ {
16541     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16542       __pyx_v_idx = __pyx_t_2;
16543 
16544       /* "View.MemoryView":1199
16545  *     else:
16546  *         for idx in range(ndim - 1, -1, -1):
16547  *             strides[idx] = stride             # <<<<<<<<<<<<<<
16548  *             stride = stride * shape[idx]
16549  *
16550  */
16551       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16552 
16553       /* "View.MemoryView":1200
16554  *         for idx in range(ndim - 1, -1, -1):
16555  *             strides[idx] = stride
16556  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
16557  *
16558  *     return stride
16559  */
16560       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16561     }
16562   }
16563   __pyx_L3:;
16564 
16565   /* "View.MemoryView":1202
16566  *             stride = stride * shape[idx]
16567  *
16568  *     return stride             # <<<<<<<<<<<<<<
16569  *
16570  * @cname('__pyx_memoryview_copy_data_to_temp')
16571  */
16572   __pyx_r = __pyx_v_stride;
16573   goto __pyx_L0;
16574 
16575   /* "View.MemoryView":1184
16576  *
16577  * @cname('__pyx_fill_contig_strides_array')
16578  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
16579  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16580  *                 int ndim, char order) nogil:
16581  */
16582 
16583   /* function exit code */
16584   __pyx_L0:;
16585   return __pyx_r;
16586 }
16587 
16588 /* "View.MemoryView":1205
16589  *
16590  * @cname('__pyx_memoryview_copy_data_to_temp')
16591  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16592  *                              __Pyx_memviewslice *tmpslice,
16593  *                              char order,
16594  */
16595 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)16596 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) {
16597   int __pyx_v_i;
16598   void *__pyx_v_result;
16599   size_t __pyx_v_itemsize;
16600   size_t __pyx_v_size;
16601   void *__pyx_r;
16602   Py_ssize_t __pyx_t_1;
16603   int __pyx_t_2;
16604   int __pyx_t_3;
16605   struct __pyx_memoryview_obj *__pyx_t_4;
16606   int __pyx_t_5;
16607   int __pyx_t_6;
16608 
16609   /* "View.MemoryView":1216
16610  *     cdef void *result
16611  *
16612  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
16613  *     cdef size_t size = slice_get_size(src, ndim)
16614  *
16615  */
16616   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16617   __pyx_v_itemsize = __pyx_t_1;
16618 
16619   /* "View.MemoryView":1217
16620  *
16621  *     cdef size_t itemsize = src.memview.view.itemsize
16622  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
16623  *
16624  *     result = malloc(size)
16625  */
16626   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16627 
16628   /* "View.MemoryView":1219
16629  *     cdef size_t size = slice_get_size(src, ndim)
16630  *
16631  *     result = malloc(size)             # <<<<<<<<<<<<<<
16632  *     if not result:
16633  *         _err(MemoryError, NULL)
16634  */
16635   __pyx_v_result = malloc(__pyx_v_size);
16636 
16637   /* "View.MemoryView":1220
16638  *
16639  *     result = malloc(size)
16640  *     if not result:             # <<<<<<<<<<<<<<
16641  *         _err(MemoryError, NULL)
16642  *
16643  */
16644   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
16645   if (__pyx_t_2) {
16646 
16647     /* "View.MemoryView":1221
16648  *     result = malloc(size)
16649  *     if not result:
16650  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
16651  *
16652  *
16653  */
16654     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
16655 
16656     /* "View.MemoryView":1220
16657  *
16658  *     result = malloc(size)
16659  *     if not result:             # <<<<<<<<<<<<<<
16660  *         _err(MemoryError, NULL)
16661  *
16662  */
16663   }
16664 
16665   /* "View.MemoryView":1224
16666  *
16667  *
16668  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
16669  *     tmpslice.memview = src.memview
16670  *     for i in range(ndim):
16671  */
16672   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16673 
16674   /* "View.MemoryView":1225
16675  *
16676  *     tmpslice.data = <char *> result
16677  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
16678  *     for i in range(ndim):
16679  *         tmpslice.shape[i] = src.shape[i]
16680  */
16681   __pyx_t_4 = __pyx_v_src->memview;
16682   __pyx_v_tmpslice->memview = __pyx_t_4;
16683 
16684   /* "View.MemoryView":1226
16685  *     tmpslice.data = <char *> result
16686  *     tmpslice.memview = src.memview
16687  *     for i in range(ndim):             # <<<<<<<<<<<<<<
16688  *         tmpslice.shape[i] = src.shape[i]
16689  *         tmpslice.suboffsets[i] = -1
16690  */
16691   __pyx_t_3 = __pyx_v_ndim;
16692   __pyx_t_5 = __pyx_t_3;
16693   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16694     __pyx_v_i = __pyx_t_6;
16695 
16696     /* "View.MemoryView":1227
16697  *     tmpslice.memview = src.memview
16698  *     for i in range(ndim):
16699  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
16700  *         tmpslice.suboffsets[i] = -1
16701  *
16702  */
16703     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16704 
16705     /* "View.MemoryView":1228
16706  *     for i in range(ndim):
16707  *         tmpslice.shape[i] = src.shape[i]
16708  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
16709  *
16710  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
16711  */
16712     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16713   }
16714 
16715   /* "View.MemoryView":1230
16716  *         tmpslice.suboffsets[i] = -1
16717  *
16718  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
16719  *                               ndim, order)
16720  *
16721  */
16722   (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));
16723 
16724   /* "View.MemoryView":1234
16725  *
16726  *
16727  *     for i in range(ndim):             # <<<<<<<<<<<<<<
16728  *         if tmpslice.shape[i] == 1:
16729  *             tmpslice.strides[i] = 0
16730  */
16731   __pyx_t_3 = __pyx_v_ndim;
16732   __pyx_t_5 = __pyx_t_3;
16733   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16734     __pyx_v_i = __pyx_t_6;
16735 
16736     /* "View.MemoryView":1235
16737  *
16738  *     for i in range(ndim):
16739  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
16740  *             tmpslice.strides[i] = 0
16741  *
16742  */
16743     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
16744     if (__pyx_t_2) {
16745 
16746       /* "View.MemoryView":1236
16747  *     for i in range(ndim):
16748  *         if tmpslice.shape[i] == 1:
16749  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
16750  *
16751  *     if slice_is_contig(src[0], order, ndim):
16752  */
16753       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16754 
16755       /* "View.MemoryView":1235
16756  *
16757  *     for i in range(ndim):
16758  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
16759  *             tmpslice.strides[i] = 0
16760  *
16761  */
16762     }
16763   }
16764 
16765   /* "View.MemoryView":1238
16766  *             tmpslice.strides[i] = 0
16767  *
16768  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
16769  *         memcpy(result, src.data, size)
16770  *     else:
16771  */
16772   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
16773   if (__pyx_t_2) {
16774 
16775     /* "View.MemoryView":1239
16776  *
16777  *     if slice_is_contig(src[0], order, ndim):
16778  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
16779  *     else:
16780  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16781  */
16782     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16783 
16784     /* "View.MemoryView":1238
16785  *             tmpslice.strides[i] = 0
16786  *
16787  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
16788  *         memcpy(result, src.data, size)
16789  *     else:
16790  */
16791     goto __pyx_L9;
16792   }
16793 
16794   /* "View.MemoryView":1241
16795  *         memcpy(result, src.data, size)
16796  *     else:
16797  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
16798  *
16799  *     return result
16800  */
16801   /*else*/ {
16802     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16803   }
16804   __pyx_L9:;
16805 
16806   /* "View.MemoryView":1243
16807  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16808  *
16809  *     return result             # <<<<<<<<<<<<<<
16810  *
16811  *
16812  */
16813   __pyx_r = __pyx_v_result;
16814   goto __pyx_L0;
16815 
16816   /* "View.MemoryView":1205
16817  *
16818  * @cname('__pyx_memoryview_copy_data_to_temp')
16819  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
16820  *                              __Pyx_memviewslice *tmpslice,
16821  *                              char order,
16822  */
16823 
16824   /* function exit code */
16825   __pyx_L1_error:;
16826   {
16827     #ifdef WITH_THREAD
16828     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16829     #endif
16830     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16831     #ifdef WITH_THREAD
16832     __Pyx_PyGILState_Release(__pyx_gilstate_save);
16833     #endif
16834   }
16835   __pyx_r = NULL;
16836   __pyx_L0:;
16837   return __pyx_r;
16838 }
16839 
16840 /* "View.MemoryView":1248
16841  *
16842  * @cname('__pyx_memoryview_err_extents')
16843  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
16844  *                              Py_ssize_t extent2) except -1 with gil:
16845  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16846  */
16847 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)16848 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16849   int __pyx_r;
16850   __Pyx_RefNannyDeclarations
16851   PyObject *__pyx_t_1 = NULL;
16852   PyObject *__pyx_t_2 = NULL;
16853   PyObject *__pyx_t_3 = NULL;
16854   PyObject *__pyx_t_4 = NULL;
16855   #ifdef WITH_THREAD
16856   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16857   #endif
16858   __Pyx_RefNannySetupContext("_err_extents", 0);
16859 
16860   /* "View.MemoryView":1251
16861  *                              Py_ssize_t extent2) except -1 with gil:
16862  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16863  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
16864  *
16865  * @cname('__pyx_memoryview_err_dim')
16866  */
16867   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
16868   __Pyx_GOTREF(__pyx_t_1);
16869   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
16870   __Pyx_GOTREF(__pyx_t_2);
16871   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
16872   __Pyx_GOTREF(__pyx_t_3);
16873   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
16874   __Pyx_GOTREF(__pyx_t_4);
16875   __Pyx_GIVEREF(__pyx_t_1);
16876   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
16877   __Pyx_GIVEREF(__pyx_t_2);
16878   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
16879   __Pyx_GIVEREF(__pyx_t_3);
16880   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
16881   __pyx_t_1 = 0;
16882   __pyx_t_2 = 0;
16883   __pyx_t_3 = 0;
16884 
16885   /* "View.MemoryView":1250
16886  * cdef int _err_extents(int i, Py_ssize_t extent1,
16887  *                              Py_ssize_t extent2) except -1 with gil:
16888  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
16889  *                                                         (i, extent1, extent2))
16890  *
16891  */
16892   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
16893   __Pyx_GOTREF(__pyx_t_3);
16894   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16895   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
16896   __Pyx_GOTREF(__pyx_t_4);
16897   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16898   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
16899   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16900   __PYX_ERR(1, 1250, __pyx_L1_error)
16901 
16902   /* "View.MemoryView":1248
16903  *
16904  * @cname('__pyx_memoryview_err_extents')
16905  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
16906  *                              Py_ssize_t extent2) except -1 with gil:
16907  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16908  */
16909 
16910   /* function exit code */
16911   __pyx_L1_error:;
16912   __Pyx_XDECREF(__pyx_t_1);
16913   __Pyx_XDECREF(__pyx_t_2);
16914   __Pyx_XDECREF(__pyx_t_3);
16915   __Pyx_XDECREF(__pyx_t_4);
16916   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16917   __pyx_r = -1;
16918   __Pyx_RefNannyFinishContext();
16919   #ifdef WITH_THREAD
16920   __Pyx_PyGILState_Release(__pyx_gilstate_save);
16921   #endif
16922   return __pyx_r;
16923 }
16924 
16925 /* "View.MemoryView":1254
16926  *
16927  * @cname('__pyx_memoryview_err_dim')
16928  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
16929  *     raise error(msg.decode('ascii') % dim)
16930  *
16931  */
16932 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)16933 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
16934   int __pyx_r;
16935   __Pyx_RefNannyDeclarations
16936   PyObject *__pyx_t_1 = NULL;
16937   PyObject *__pyx_t_2 = NULL;
16938   PyObject *__pyx_t_3 = NULL;
16939   PyObject *__pyx_t_4 = NULL;
16940   #ifdef WITH_THREAD
16941   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16942   #endif
16943   __Pyx_RefNannySetupContext("_err_dim", 0);
16944   __Pyx_INCREF(__pyx_v_error);
16945 
16946   /* "View.MemoryView":1255
16947  * @cname('__pyx_memoryview_err_dim')
16948  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
16949  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
16950  *
16951  * @cname('__pyx_memoryview_err')
16952  */
16953   __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(1, 1255, __pyx_L1_error)
16954   __Pyx_GOTREF(__pyx_t_2);
16955   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
16956   __Pyx_GOTREF(__pyx_t_3);
16957   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
16958   __Pyx_GOTREF(__pyx_t_4);
16959   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16960   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16961   __Pyx_INCREF(__pyx_v_error);
16962   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
16963   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16964     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
16965     if (likely(__pyx_t_2)) {
16966       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
16967       __Pyx_INCREF(__pyx_t_2);
16968       __Pyx_INCREF(function);
16969       __Pyx_DECREF_SET(__pyx_t_3, function);
16970     }
16971   }
16972   __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);
16973   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16974   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16975   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
16976   __Pyx_GOTREF(__pyx_t_1);
16977   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16978   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16979   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16980   __PYX_ERR(1, 1255, __pyx_L1_error)
16981 
16982   /* "View.MemoryView":1254
16983  *
16984  * @cname('__pyx_memoryview_err_dim')
16985  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
16986  *     raise error(msg.decode('ascii') % dim)
16987  *
16988  */
16989 
16990   /* function exit code */
16991   __pyx_L1_error:;
16992   __Pyx_XDECREF(__pyx_t_1);
16993   __Pyx_XDECREF(__pyx_t_2);
16994   __Pyx_XDECREF(__pyx_t_3);
16995   __Pyx_XDECREF(__pyx_t_4);
16996   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16997   __pyx_r = -1;
16998   __Pyx_XDECREF(__pyx_v_error);
16999   __Pyx_RefNannyFinishContext();
17000   #ifdef WITH_THREAD
17001   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17002   #endif
17003   return __pyx_r;
17004 }
17005 
17006 /* "View.MemoryView":1258
17007  *
17008  * @cname('__pyx_memoryview_err')
17009  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
17010  *     if msg != NULL:
17011  *         raise error(msg.decode('ascii'))
17012  */
17013 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)17014 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
17015   int __pyx_r;
17016   __Pyx_RefNannyDeclarations
17017   int __pyx_t_1;
17018   PyObject *__pyx_t_2 = NULL;
17019   PyObject *__pyx_t_3 = NULL;
17020   PyObject *__pyx_t_4 = NULL;
17021   PyObject *__pyx_t_5 = NULL;
17022   #ifdef WITH_THREAD
17023   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17024   #endif
17025   __Pyx_RefNannySetupContext("_err", 0);
17026   __Pyx_INCREF(__pyx_v_error);
17027 
17028   /* "View.MemoryView":1259
17029  * @cname('__pyx_memoryview_err')
17030  * cdef int _err(object error, char *msg) except -1 with gil:
17031  *     if msg != NULL:             # <<<<<<<<<<<<<<
17032  *         raise error(msg.decode('ascii'))
17033  *     else:
17034  */
17035   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
17036   if (unlikely(__pyx_t_1)) {
17037 
17038     /* "View.MemoryView":1260
17039  * cdef int _err(object error, char *msg) except -1 with gil:
17040  *     if msg != NULL:
17041  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
17042  *     else:
17043  *         raise error
17044  */
17045     __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(1, 1260, __pyx_L1_error)
17046     __Pyx_GOTREF(__pyx_t_3);
17047     __Pyx_INCREF(__pyx_v_error);
17048     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
17049     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
17050       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
17051       if (likely(__pyx_t_5)) {
17052         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
17053         __Pyx_INCREF(__pyx_t_5);
17054         __Pyx_INCREF(function);
17055         __Pyx_DECREF_SET(__pyx_t_4, function);
17056       }
17057     }
17058     __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);
17059     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17060     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17061     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
17062     __Pyx_GOTREF(__pyx_t_2);
17063     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17064     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17065     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17066     __PYX_ERR(1, 1260, __pyx_L1_error)
17067 
17068     /* "View.MemoryView":1259
17069  * @cname('__pyx_memoryview_err')
17070  * cdef int _err(object error, char *msg) except -1 with gil:
17071  *     if msg != NULL:             # <<<<<<<<<<<<<<
17072  *         raise error(msg.decode('ascii'))
17073  *     else:
17074  */
17075   }
17076 
17077   /* "View.MemoryView":1262
17078  *         raise error(msg.decode('ascii'))
17079  *     else:
17080  *         raise error             # <<<<<<<<<<<<<<
17081  *
17082  * @cname('__pyx_memoryview_copy_contents')
17083  */
17084   /*else*/ {
17085     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
17086     __PYX_ERR(1, 1262, __pyx_L1_error)
17087   }
17088 
17089   /* "View.MemoryView":1258
17090  *
17091  * @cname('__pyx_memoryview_err')
17092  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
17093  *     if msg != NULL:
17094  *         raise error(msg.decode('ascii'))
17095  */
17096 
17097   /* function exit code */
17098   __pyx_L1_error:;
17099   __Pyx_XDECREF(__pyx_t_2);
17100   __Pyx_XDECREF(__pyx_t_3);
17101   __Pyx_XDECREF(__pyx_t_4);
17102   __Pyx_XDECREF(__pyx_t_5);
17103   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17104   __pyx_r = -1;
17105   __Pyx_XDECREF(__pyx_v_error);
17106   __Pyx_RefNannyFinishContext();
17107   #ifdef WITH_THREAD
17108   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17109   #endif
17110   return __pyx_r;
17111 }
17112 
17113 /* "View.MemoryView":1265
17114  *
17115  * @cname('__pyx_memoryview_copy_contents')
17116  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
17117  *                                   __Pyx_memviewslice dst,
17118  *                                   int src_ndim, int dst_ndim,
17119  */
17120 
__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)17121 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) {
17122   void *__pyx_v_tmpdata;
17123   size_t __pyx_v_itemsize;
17124   int __pyx_v_i;
17125   char __pyx_v_order;
17126   int __pyx_v_broadcasting;
17127   int __pyx_v_direct_copy;
17128   __Pyx_memviewslice __pyx_v_tmp;
17129   int __pyx_v_ndim;
17130   int __pyx_r;
17131   Py_ssize_t __pyx_t_1;
17132   int __pyx_t_2;
17133   int __pyx_t_3;
17134   int __pyx_t_4;
17135   int __pyx_t_5;
17136   int __pyx_t_6;
17137   void *__pyx_t_7;
17138   int __pyx_t_8;
17139 
17140   /* "View.MemoryView":1273
17141  *     Check for overlapping memory and verify the shapes.
17142  *     """
17143  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
17144  *     cdef size_t itemsize = src.memview.view.itemsize
17145  *     cdef int i
17146  */
17147   __pyx_v_tmpdata = NULL;
17148 
17149   /* "View.MemoryView":1274
17150  *     """
17151  *     cdef void *tmpdata = NULL
17152  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
17153  *     cdef int i
17154  *     cdef char order = get_best_order(&src, src_ndim)
17155  */
17156   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17157   __pyx_v_itemsize = __pyx_t_1;
17158 
17159   /* "View.MemoryView":1276
17160  *     cdef size_t itemsize = src.memview.view.itemsize
17161  *     cdef int i
17162  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
17163  *     cdef bint broadcasting = False
17164  *     cdef bint direct_copy = False
17165  */
17166   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17167 
17168   /* "View.MemoryView":1277
17169  *     cdef int i
17170  *     cdef char order = get_best_order(&src, src_ndim)
17171  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
17172  *     cdef bint direct_copy = False
17173  *     cdef __Pyx_memviewslice tmp
17174  */
17175   __pyx_v_broadcasting = 0;
17176 
17177   /* "View.MemoryView":1278
17178  *     cdef char order = get_best_order(&src, src_ndim)
17179  *     cdef bint broadcasting = False
17180  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
17181  *     cdef __Pyx_memviewslice tmp
17182  *
17183  */
17184   __pyx_v_direct_copy = 0;
17185 
17186   /* "View.MemoryView":1281
17187  *     cdef __Pyx_memviewslice tmp
17188  *
17189  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
17190  *         broadcast_leading(&src, src_ndim, dst_ndim)
17191  *     elif dst_ndim < src_ndim:
17192  */
17193   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
17194   if (__pyx_t_2) {
17195 
17196     /* "View.MemoryView":1282
17197  *
17198  *     if src_ndim < dst_ndim:
17199  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
17200  *     elif dst_ndim < src_ndim:
17201  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17202  */
17203     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17204 
17205     /* "View.MemoryView":1281
17206  *     cdef __Pyx_memviewslice tmp
17207  *
17208  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
17209  *         broadcast_leading(&src, src_ndim, dst_ndim)
17210  *     elif dst_ndim < src_ndim:
17211  */
17212     goto __pyx_L3;
17213   }
17214 
17215   /* "View.MemoryView":1283
17216  *     if src_ndim < dst_ndim:
17217  *         broadcast_leading(&src, src_ndim, dst_ndim)
17218  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
17219  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17220  *
17221  */
17222   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
17223   if (__pyx_t_2) {
17224 
17225     /* "View.MemoryView":1284
17226  *         broadcast_leading(&src, src_ndim, dst_ndim)
17227  *     elif dst_ndim < src_ndim:
17228  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
17229  *
17230  *     cdef int ndim = max(src_ndim, dst_ndim)
17231  */
17232     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17233 
17234     /* "View.MemoryView":1283
17235  *     if src_ndim < dst_ndim:
17236  *         broadcast_leading(&src, src_ndim, dst_ndim)
17237  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
17238  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17239  *
17240  */
17241   }
17242   __pyx_L3:;
17243 
17244   /* "View.MemoryView":1286
17245  *         broadcast_leading(&dst, dst_ndim, src_ndim)
17246  *
17247  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
17248  *
17249  *     for i in range(ndim):
17250  */
17251   __pyx_t_3 = __pyx_v_dst_ndim;
17252   __pyx_t_4 = __pyx_v_src_ndim;
17253   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
17254     __pyx_t_5 = __pyx_t_3;
17255   } else {
17256     __pyx_t_5 = __pyx_t_4;
17257   }
17258   __pyx_v_ndim = __pyx_t_5;
17259 
17260   /* "View.MemoryView":1288
17261  *     cdef int ndim = max(src_ndim, dst_ndim)
17262  *
17263  *     for i in range(ndim):             # <<<<<<<<<<<<<<
17264  *         if src.shape[i] != dst.shape[i]:
17265  *             if src.shape[i] == 1:
17266  */
17267   __pyx_t_5 = __pyx_v_ndim;
17268   __pyx_t_3 = __pyx_t_5;
17269   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17270     __pyx_v_i = __pyx_t_4;
17271 
17272     /* "View.MemoryView":1289
17273  *
17274  *     for i in range(ndim):
17275  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
17276  *             if src.shape[i] == 1:
17277  *                 broadcasting = True
17278  */
17279     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
17280     if (__pyx_t_2) {
17281 
17282       /* "View.MemoryView":1290
17283  *     for i in range(ndim):
17284  *         if src.shape[i] != dst.shape[i]:
17285  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
17286  *                 broadcasting = True
17287  *                 src.strides[i] = 0
17288  */
17289       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
17290       if (__pyx_t_2) {
17291 
17292         /* "View.MemoryView":1291
17293  *         if src.shape[i] != dst.shape[i]:
17294  *             if src.shape[i] == 1:
17295  *                 broadcasting = True             # <<<<<<<<<<<<<<
17296  *                 src.strides[i] = 0
17297  *             else:
17298  */
17299         __pyx_v_broadcasting = 1;
17300 
17301         /* "View.MemoryView":1292
17302  *             if src.shape[i] == 1:
17303  *                 broadcasting = True
17304  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
17305  *             else:
17306  *                 _err_extents(i, dst.shape[i], src.shape[i])
17307  */
17308         (__pyx_v_src.strides[__pyx_v_i]) = 0;
17309 
17310         /* "View.MemoryView":1290
17311  *     for i in range(ndim):
17312  *         if src.shape[i] != dst.shape[i]:
17313  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
17314  *                 broadcasting = True
17315  *                 src.strides[i] = 0
17316  */
17317         goto __pyx_L7;
17318       }
17319 
17320       /* "View.MemoryView":1294
17321  *                 src.strides[i] = 0
17322  *             else:
17323  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
17324  *
17325  *         if src.suboffsets[i] >= 0:
17326  */
17327       /*else*/ {
17328         __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(1, 1294, __pyx_L1_error)
17329       }
17330       __pyx_L7:;
17331 
17332       /* "View.MemoryView":1289
17333  *
17334  *     for i in range(ndim):
17335  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
17336  *             if src.shape[i] == 1:
17337  *                 broadcasting = True
17338  */
17339     }
17340 
17341     /* "View.MemoryView":1296
17342  *                 _err_extents(i, dst.shape[i], src.shape[i])
17343  *
17344  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
17345  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17346  *
17347  */
17348     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
17349     if (__pyx_t_2) {
17350 
17351       /* "View.MemoryView":1297
17352  *
17353  *         if src.suboffsets[i] >= 0:
17354  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
17355  *
17356  *     if slices_overlap(&src, &dst, ndim, itemsize):
17357  */
17358       __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(1, 1297, __pyx_L1_error)
17359 
17360       /* "View.MemoryView":1296
17361  *                 _err_extents(i, dst.shape[i], src.shape[i])
17362  *
17363  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
17364  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17365  *
17366  */
17367     }
17368   }
17369 
17370   /* "View.MemoryView":1299
17371  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17372  *
17373  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
17374  *
17375  *         if not slice_is_contig(src, order, ndim):
17376  */
17377   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
17378   if (__pyx_t_2) {
17379 
17380     /* "View.MemoryView":1301
17381  *     if slices_overlap(&src, &dst, ndim, itemsize):
17382  *
17383  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
17384  *             order = get_best_order(&dst, ndim)
17385  *
17386  */
17387     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
17388     if (__pyx_t_2) {
17389 
17390       /* "View.MemoryView":1302
17391  *
17392  *         if not slice_is_contig(src, order, ndim):
17393  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
17394  *
17395  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17396  */
17397       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17398 
17399       /* "View.MemoryView":1301
17400  *     if slices_overlap(&src, &dst, ndim, itemsize):
17401  *
17402  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
17403  *             order = get_best_order(&dst, ndim)
17404  *
17405  */
17406     }
17407 
17408     /* "View.MemoryView":1304
17409  *             order = get_best_order(&dst, ndim)
17410  *
17411  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
17412  *         src = tmp
17413  *
17414  */
17415     __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(1, 1304, __pyx_L1_error)
17416     __pyx_v_tmpdata = __pyx_t_7;
17417 
17418     /* "View.MemoryView":1305
17419  *
17420  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17421  *         src = tmp             # <<<<<<<<<<<<<<
17422  *
17423  *     if not broadcasting:
17424  */
17425     __pyx_v_src = __pyx_v_tmp;
17426 
17427     /* "View.MemoryView":1299
17428  *             _err_dim(ValueError, "Dimension %d is not direct", i)
17429  *
17430  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
17431  *
17432  *         if not slice_is_contig(src, order, ndim):
17433  */
17434   }
17435 
17436   /* "View.MemoryView":1307
17437  *         src = tmp
17438  *
17439  *     if not broadcasting:             # <<<<<<<<<<<<<<
17440  *
17441  *
17442  */
17443   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
17444   if (__pyx_t_2) {
17445 
17446     /* "View.MemoryView":1310
17447  *
17448  *
17449  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
17450  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17451  *         elif slice_is_contig(src, 'F', ndim):
17452  */
17453     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
17454     if (__pyx_t_2) {
17455 
17456       /* "View.MemoryView":1311
17457  *
17458  *         if slice_is_contig(src, 'C', ndim):
17459  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
17460  *         elif slice_is_contig(src, 'F', ndim):
17461  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17462  */
17463       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17464 
17465       /* "View.MemoryView":1310
17466  *
17467  *
17468  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
17469  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17470  *         elif slice_is_contig(src, 'F', ndim):
17471  */
17472       goto __pyx_L12;
17473     }
17474 
17475     /* "View.MemoryView":1312
17476  *         if slice_is_contig(src, 'C', ndim):
17477  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17478  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
17479  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17480  *
17481  */
17482     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
17483     if (__pyx_t_2) {
17484 
17485       /* "View.MemoryView":1313
17486  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17487  *         elif slice_is_contig(src, 'F', ndim):
17488  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
17489  *
17490  *         if direct_copy:
17491  */
17492       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17493 
17494       /* "View.MemoryView":1312
17495  *         if slice_is_contig(src, 'C', ndim):
17496  *             direct_copy = slice_is_contig(dst, 'C', ndim)
17497  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
17498  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17499  *
17500  */
17501     }
17502     __pyx_L12:;
17503 
17504     /* "View.MemoryView":1315
17505  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17506  *
17507  *         if direct_copy:             # <<<<<<<<<<<<<<
17508  *
17509  *             refcount_copying(&dst, dtype_is_object, ndim, False)
17510  */
17511     __pyx_t_2 = (__pyx_v_direct_copy != 0);
17512     if (__pyx_t_2) {
17513 
17514       /* "View.MemoryView":1317
17515  *         if direct_copy:
17516  *
17517  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
17518  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17519  *             refcount_copying(&dst, dtype_is_object, ndim, True)
17520  */
17521       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17522 
17523       /* "View.MemoryView":1318
17524  *
17525  *             refcount_copying(&dst, dtype_is_object, ndim, False)
17526  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
17527  *             refcount_copying(&dst, dtype_is_object, ndim, True)
17528  *             free(tmpdata)
17529  */
17530       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17531 
17532       /* "View.MemoryView":1319
17533  *             refcount_copying(&dst, dtype_is_object, ndim, False)
17534  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17535  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
17536  *             free(tmpdata)
17537  *             return 0
17538  */
17539       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17540 
17541       /* "View.MemoryView":1320
17542  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17543  *             refcount_copying(&dst, dtype_is_object, ndim, True)
17544  *             free(tmpdata)             # <<<<<<<<<<<<<<
17545  *             return 0
17546  *
17547  */
17548       free(__pyx_v_tmpdata);
17549 
17550       /* "View.MemoryView":1321
17551  *             refcount_copying(&dst, dtype_is_object, ndim, True)
17552  *             free(tmpdata)
17553  *             return 0             # <<<<<<<<<<<<<<
17554  *
17555  *     if order == 'F' == get_best_order(&dst, ndim):
17556  */
17557       __pyx_r = 0;
17558       goto __pyx_L0;
17559 
17560       /* "View.MemoryView":1315
17561  *             direct_copy = slice_is_contig(dst, 'F', ndim)
17562  *
17563  *         if direct_copy:             # <<<<<<<<<<<<<<
17564  *
17565  *             refcount_copying(&dst, dtype_is_object, ndim, False)
17566  */
17567     }
17568 
17569     /* "View.MemoryView":1307
17570  *         src = tmp
17571  *
17572  *     if not broadcasting:             # <<<<<<<<<<<<<<
17573  *
17574  *
17575  */
17576   }
17577 
17578   /* "View.MemoryView":1323
17579  *             return 0
17580  *
17581  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
17582  *
17583  *
17584  */
17585   __pyx_t_2 = (__pyx_v_order == 'F');
17586   if (__pyx_t_2) {
17587     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17588   }
17589   __pyx_t_8 = (__pyx_t_2 != 0);
17590   if (__pyx_t_8) {
17591 
17592     /* "View.MemoryView":1326
17593  *
17594  *
17595  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
17596  *         transpose_memslice(&dst)
17597  *
17598  */
17599     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
17600 
17601     /* "View.MemoryView":1327
17602  *
17603  *         transpose_memslice(&src)
17604  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
17605  *
17606  *     refcount_copying(&dst, dtype_is_object, ndim, False)
17607  */
17608     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
17609 
17610     /* "View.MemoryView":1323
17611  *             return 0
17612  *
17613  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
17614  *
17615  *
17616  */
17617   }
17618 
17619   /* "View.MemoryView":1329
17620  *         transpose_memslice(&dst)
17621  *
17622  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
17623  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
17624  *     refcount_copying(&dst, dtype_is_object, ndim, True)
17625  */
17626   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17627 
17628   /* "View.MemoryView":1330
17629  *
17630  *     refcount_copying(&dst, dtype_is_object, ndim, False)
17631  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
17632  *     refcount_copying(&dst, dtype_is_object, ndim, True)
17633  *
17634  */
17635   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17636 
17637   /* "View.MemoryView":1331
17638  *     refcount_copying(&dst, dtype_is_object, ndim, False)
17639  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
17640  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
17641  *
17642  *     free(tmpdata)
17643  */
17644   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17645 
17646   /* "View.MemoryView":1333
17647  *     refcount_copying(&dst, dtype_is_object, ndim, True)
17648  *
17649  *     free(tmpdata)             # <<<<<<<<<<<<<<
17650  *     return 0
17651  *
17652  */
17653   free(__pyx_v_tmpdata);
17654 
17655   /* "View.MemoryView":1334
17656  *
17657  *     free(tmpdata)
17658  *     return 0             # <<<<<<<<<<<<<<
17659  *
17660  * @cname('__pyx_memoryview_broadcast_leading')
17661  */
17662   __pyx_r = 0;
17663   goto __pyx_L0;
17664 
17665   /* "View.MemoryView":1265
17666  *
17667  * @cname('__pyx_memoryview_copy_contents')
17668  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
17669  *                                   __Pyx_memviewslice dst,
17670  *                                   int src_ndim, int dst_ndim,
17671  */
17672 
17673   /* function exit code */
17674   __pyx_L1_error:;
17675   {
17676     #ifdef WITH_THREAD
17677     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17678     #endif
17679     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17680     #ifdef WITH_THREAD
17681     __Pyx_PyGILState_Release(__pyx_gilstate_save);
17682     #endif
17683   }
17684   __pyx_r = -1;
17685   __pyx_L0:;
17686   return __pyx_r;
17687 }
17688 
17689 /* "View.MemoryView":1337
17690  *
17691  * @cname('__pyx_memoryview_broadcast_leading')
17692  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
17693  *                             int ndim,
17694  *                             int ndim_other) nogil:
17695  */
17696 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)17697 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17698   int __pyx_v_i;
17699   int __pyx_v_offset;
17700   int __pyx_t_1;
17701   int __pyx_t_2;
17702   int __pyx_t_3;
17703 
17704   /* "View.MemoryView":1341
17705  *                             int ndim_other) nogil:
17706  *     cdef int i
17707  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
17708  *
17709  *     for i in range(ndim - 1, -1, -1):
17710  */
17711   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17712 
17713   /* "View.MemoryView":1343
17714  *     cdef int offset = ndim_other - ndim
17715  *
17716  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
17717  *         mslice.shape[i + offset] = mslice.shape[i]
17718  *         mslice.strides[i + offset] = mslice.strides[i]
17719  */
17720   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17721     __pyx_v_i = __pyx_t_1;
17722 
17723     /* "View.MemoryView":1344
17724  *
17725  *     for i in range(ndim - 1, -1, -1):
17726  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
17727  *         mslice.strides[i + offset] = mslice.strides[i]
17728  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17729  */
17730     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17731 
17732     /* "View.MemoryView":1345
17733  *     for i in range(ndim - 1, -1, -1):
17734  *         mslice.shape[i + offset] = mslice.shape[i]
17735  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
17736  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17737  *
17738  */
17739     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17740 
17741     /* "View.MemoryView":1346
17742  *         mslice.shape[i + offset] = mslice.shape[i]
17743  *         mslice.strides[i + offset] = mslice.strides[i]
17744  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
17745  *
17746  *     for i in range(offset):
17747  */
17748     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17749   }
17750 
17751   /* "View.MemoryView":1348
17752  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17753  *
17754  *     for i in range(offset):             # <<<<<<<<<<<<<<
17755  *         mslice.shape[i] = 1
17756  *         mslice.strides[i] = mslice.strides[0]
17757  */
17758   __pyx_t_1 = __pyx_v_offset;
17759   __pyx_t_2 = __pyx_t_1;
17760   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17761     __pyx_v_i = __pyx_t_3;
17762 
17763     /* "View.MemoryView":1349
17764  *
17765  *     for i in range(offset):
17766  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
17767  *         mslice.strides[i] = mslice.strides[0]
17768  *         mslice.suboffsets[i] = -1
17769  */
17770     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17771 
17772     /* "View.MemoryView":1350
17773  *     for i in range(offset):
17774  *         mslice.shape[i] = 1
17775  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
17776  *         mslice.suboffsets[i] = -1
17777  *
17778  */
17779     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17780 
17781     /* "View.MemoryView":1351
17782  *         mslice.shape[i] = 1
17783  *         mslice.strides[i] = mslice.strides[0]
17784  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
17785  *
17786  *
17787  */
17788     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17789   }
17790 
17791   /* "View.MemoryView":1337
17792  *
17793  * @cname('__pyx_memoryview_broadcast_leading')
17794  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
17795  *                             int ndim,
17796  *                             int ndim_other) nogil:
17797  */
17798 
17799   /* function exit code */
17800 }
17801 
17802 /* "View.MemoryView":1359
17803  *
17804  * @cname('__pyx_memoryview_refcount_copying')
17805  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
17806  *                            int ndim, bint inc) nogil:
17807  *
17808  */
17809 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)17810 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) {
17811   int __pyx_t_1;
17812 
17813   /* "View.MemoryView":1363
17814  *
17815  *
17816  *     if dtype_is_object:             # <<<<<<<<<<<<<<
17817  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
17818  *                                            dst.strides, ndim, inc)
17819  */
17820   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
17821   if (__pyx_t_1) {
17822 
17823     /* "View.MemoryView":1364
17824  *
17825  *     if dtype_is_object:
17826  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
17827  *                                            dst.strides, ndim, inc)
17828  *
17829  */
17830     __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);
17831 
17832     /* "View.MemoryView":1363
17833  *
17834  *
17835  *     if dtype_is_object:             # <<<<<<<<<<<<<<
17836  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
17837  *                                            dst.strides, ndim, inc)
17838  */
17839   }
17840 
17841   /* "View.MemoryView":1359
17842  *
17843  * @cname('__pyx_memoryview_refcount_copying')
17844  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
17845  *                            int ndim, bint inc) nogil:
17846  *
17847  */
17848 
17849   /* function exit code */
17850 }
17851 
17852 /* "View.MemoryView":1368
17853  *
17854  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17855  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
17856  *                                              Py_ssize_t *strides, int ndim,
17857  *                                              bint inc) with gil:
17858  */
17859 
__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)17860 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) {
17861   __Pyx_RefNannyDeclarations
17862   #ifdef WITH_THREAD
17863   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17864   #endif
17865   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
17866 
17867   /* "View.MemoryView":1371
17868  *                                              Py_ssize_t *strides, int ndim,
17869  *                                              bint inc) with gil:
17870  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
17871  *
17872  * @cname('__pyx_memoryview_refcount_objects_in_slice')
17873  */
17874   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17875 
17876   /* "View.MemoryView":1368
17877  *
17878  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17879  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
17880  *                                              Py_ssize_t *strides, int ndim,
17881  *                                              bint inc) with gil:
17882  */
17883 
17884   /* function exit code */
17885   __Pyx_RefNannyFinishContext();
17886   #ifdef WITH_THREAD
17887   __Pyx_PyGILState_Release(__pyx_gilstate_save);
17888   #endif
17889 }
17890 
17891 /* "View.MemoryView":1374
17892  *
17893  * @cname('__pyx_memoryview_refcount_objects_in_slice')
17894  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
17895  *                                     Py_ssize_t *strides, int ndim, bint inc):
17896  *     cdef Py_ssize_t i
17897  */
17898 
__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)17899 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) {
17900   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17901   __Pyx_RefNannyDeclarations
17902   Py_ssize_t __pyx_t_1;
17903   Py_ssize_t __pyx_t_2;
17904   Py_ssize_t __pyx_t_3;
17905   int __pyx_t_4;
17906   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
17907 
17908   /* "View.MemoryView":1378
17909  *     cdef Py_ssize_t i
17910  *
17911  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
17912  *         if ndim == 1:
17913  *             if inc:
17914  */
17915   __pyx_t_1 = (__pyx_v_shape[0]);
17916   __pyx_t_2 = __pyx_t_1;
17917   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17918     __pyx_v_i = __pyx_t_3;
17919 
17920     /* "View.MemoryView":1379
17921  *
17922  *     for i in range(shape[0]):
17923  *         if ndim == 1:             # <<<<<<<<<<<<<<
17924  *             if inc:
17925  *                 Py_INCREF((<PyObject **> data)[0])
17926  */
17927     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
17928     if (__pyx_t_4) {
17929 
17930       /* "View.MemoryView":1380
17931  *     for i in range(shape[0]):
17932  *         if ndim == 1:
17933  *             if inc:             # <<<<<<<<<<<<<<
17934  *                 Py_INCREF((<PyObject **> data)[0])
17935  *             else:
17936  */
17937       __pyx_t_4 = (__pyx_v_inc != 0);
17938       if (__pyx_t_4) {
17939 
17940         /* "View.MemoryView":1381
17941  *         if ndim == 1:
17942  *             if inc:
17943  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
17944  *             else:
17945  *                 Py_DECREF((<PyObject **> data)[0])
17946  */
17947         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17948 
17949         /* "View.MemoryView":1380
17950  *     for i in range(shape[0]):
17951  *         if ndim == 1:
17952  *             if inc:             # <<<<<<<<<<<<<<
17953  *                 Py_INCREF((<PyObject **> data)[0])
17954  *             else:
17955  */
17956         goto __pyx_L6;
17957       }
17958 
17959       /* "View.MemoryView":1383
17960  *                 Py_INCREF((<PyObject **> data)[0])
17961  *             else:
17962  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
17963  *         else:
17964  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
17965  */
17966       /*else*/ {
17967         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17968       }
17969       __pyx_L6:;
17970 
17971       /* "View.MemoryView":1379
17972  *
17973  *     for i in range(shape[0]):
17974  *         if ndim == 1:             # <<<<<<<<<<<<<<
17975  *             if inc:
17976  *                 Py_INCREF((<PyObject **> data)[0])
17977  */
17978       goto __pyx_L5;
17979     }
17980 
17981     /* "View.MemoryView":1385
17982  *                 Py_DECREF((<PyObject **> data)[0])
17983  *         else:
17984  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
17985  *                                       ndim - 1, inc)
17986  *
17987  */
17988     /*else*/ {
17989 
17990       /* "View.MemoryView":1386
17991  *         else:
17992  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
17993  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
17994  *
17995  *         data += strides[0]
17996  */
17997       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17998     }
17999     __pyx_L5:;
18000 
18001     /* "View.MemoryView":1388
18002  *                                       ndim - 1, inc)
18003  *
18004  *         data += strides[0]             # <<<<<<<<<<<<<<
18005  *
18006  *
18007  */
18008     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
18009   }
18010 
18011   /* "View.MemoryView":1374
18012  *
18013  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18014  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18015  *                                     Py_ssize_t *strides, int ndim, bint inc):
18016  *     cdef Py_ssize_t i
18017  */
18018 
18019   /* function exit code */
18020   __Pyx_RefNannyFinishContext();
18021 }
18022 
18023 /* "View.MemoryView":1394
18024  *
18025  * @cname('__pyx_memoryview_slice_assign_scalar')
18026  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
18027  *                               size_t itemsize, void *item,
18028  *                               bint dtype_is_object) nogil:
18029  */
18030 
__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)18031 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) {
18032 
18033   /* "View.MemoryView":1397
18034  *                               size_t itemsize, void *item,
18035  *                               bint dtype_is_object) nogil:
18036  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
18037  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18038  *                          itemsize, item)
18039  */
18040   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18041 
18042   /* "View.MemoryView":1398
18043  *                               bint dtype_is_object) nogil:
18044  *     refcount_copying(dst, dtype_is_object, ndim, False)
18045  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
18046  *                          itemsize, item)
18047  *     refcount_copying(dst, dtype_is_object, ndim, True)
18048  */
18049   __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);
18050 
18051   /* "View.MemoryView":1400
18052  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18053  *                          itemsize, item)
18054  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
18055  *
18056  *
18057  */
18058   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18059 
18060   /* "View.MemoryView":1394
18061  *
18062  * @cname('__pyx_memoryview_slice_assign_scalar')
18063  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
18064  *                               size_t itemsize, void *item,
18065  *                               bint dtype_is_object) nogil:
18066  */
18067 
18068   /* function exit code */
18069 }
18070 
18071 /* "View.MemoryView":1404
18072  *
18073  * @cname('__pyx_memoryview__slice_assign_scalar')
18074  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18075  *                               Py_ssize_t *strides, int ndim,
18076  *                               size_t itemsize, void *item) nogil:
18077  */
18078 
__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)18079 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) {
18080   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18081   Py_ssize_t __pyx_v_stride;
18082   Py_ssize_t __pyx_v_extent;
18083   int __pyx_t_1;
18084   Py_ssize_t __pyx_t_2;
18085   Py_ssize_t __pyx_t_3;
18086   Py_ssize_t __pyx_t_4;
18087 
18088   /* "View.MemoryView":1408
18089  *                               size_t itemsize, void *item) nogil:
18090  *     cdef Py_ssize_t i
18091  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
18092  *     cdef Py_ssize_t extent = shape[0]
18093  *
18094  */
18095   __pyx_v_stride = (__pyx_v_strides[0]);
18096 
18097   /* "View.MemoryView":1409
18098  *     cdef Py_ssize_t i
18099  *     cdef Py_ssize_t stride = strides[0]
18100  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
18101  *
18102  *     if ndim == 1:
18103  */
18104   __pyx_v_extent = (__pyx_v_shape[0]);
18105 
18106   /* "View.MemoryView":1411
18107  *     cdef Py_ssize_t extent = shape[0]
18108  *
18109  *     if ndim == 1:             # <<<<<<<<<<<<<<
18110  *         for i in range(extent):
18111  *             memcpy(data, item, itemsize)
18112  */
18113   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18114   if (__pyx_t_1) {
18115 
18116     /* "View.MemoryView":1412
18117  *
18118  *     if ndim == 1:
18119  *         for i in range(extent):             # <<<<<<<<<<<<<<
18120  *             memcpy(data, item, itemsize)
18121  *             data += stride
18122  */
18123     __pyx_t_2 = __pyx_v_extent;
18124     __pyx_t_3 = __pyx_t_2;
18125     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18126       __pyx_v_i = __pyx_t_4;
18127 
18128       /* "View.MemoryView":1413
18129  *     if ndim == 1:
18130  *         for i in range(extent):
18131  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
18132  *             data += stride
18133  *     else:
18134  */
18135       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18136 
18137       /* "View.MemoryView":1414
18138  *         for i in range(extent):
18139  *             memcpy(data, item, itemsize)
18140  *             data += stride             # <<<<<<<<<<<<<<
18141  *     else:
18142  *         for i in range(extent):
18143  */
18144       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18145     }
18146 
18147     /* "View.MemoryView":1411
18148  *     cdef Py_ssize_t extent = shape[0]
18149  *
18150  *     if ndim == 1:             # <<<<<<<<<<<<<<
18151  *         for i in range(extent):
18152  *             memcpy(data, item, itemsize)
18153  */
18154     goto __pyx_L3;
18155   }
18156 
18157   /* "View.MemoryView":1416
18158  *             data += stride
18159  *     else:
18160  *         for i in range(extent):             # <<<<<<<<<<<<<<
18161  *             _slice_assign_scalar(data, shape + 1, strides + 1,
18162  *                                 ndim - 1, itemsize, item)
18163  */
18164   /*else*/ {
18165     __pyx_t_2 = __pyx_v_extent;
18166     __pyx_t_3 = __pyx_t_2;
18167     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18168       __pyx_v_i = __pyx_t_4;
18169 
18170       /* "View.MemoryView":1417
18171  *     else:
18172  *         for i in range(extent):
18173  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
18174  *                                 ndim - 1, itemsize, item)
18175  *             data += stride
18176  */
18177       __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);
18178 
18179       /* "View.MemoryView":1419
18180  *             _slice_assign_scalar(data, shape + 1, strides + 1,
18181  *                                 ndim - 1, itemsize, item)
18182  *             data += stride             # <<<<<<<<<<<<<<
18183  *
18184  *
18185  */
18186       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18187     }
18188   }
18189   __pyx_L3:;
18190 
18191   /* "View.MemoryView":1404
18192  *
18193  * @cname('__pyx_memoryview__slice_assign_scalar')
18194  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
18195  *                               Py_ssize_t *strides, int ndim,
18196  *                               size_t itemsize, void *item) nogil:
18197  */
18198 
18199   /* function exit code */
18200 }
18201 
18202 /* "(tree fragment)":1
18203  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18204  *     cdef object __pyx_PickleError
18205  *     cdef object __pyx_result
18206  */
18207 
18208 /* Python wrapper */
18209 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18210 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)18211 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18212   PyObject *__pyx_v___pyx_type = 0;
18213   long __pyx_v___pyx_checksum;
18214   PyObject *__pyx_v___pyx_state = 0;
18215   PyObject *__pyx_r = 0;
18216   __Pyx_RefNannyDeclarations
18217   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18218   {
18219     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18220     PyObject* values[3] = {0,0,0};
18221     if (unlikely(__pyx_kwds)) {
18222       Py_ssize_t kw_args;
18223       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18224       switch (pos_args) {
18225         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18226         CYTHON_FALLTHROUGH;
18227         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18228         CYTHON_FALLTHROUGH;
18229         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18230         CYTHON_FALLTHROUGH;
18231         case  0: break;
18232         default: goto __pyx_L5_argtuple_error;
18233       }
18234       kw_args = PyDict_Size(__pyx_kwds);
18235       switch (pos_args) {
18236         case  0:
18237         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
18238         else goto __pyx_L5_argtuple_error;
18239         CYTHON_FALLTHROUGH;
18240         case  1:
18241         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
18242         else {
18243           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
18244         }
18245         CYTHON_FALLTHROUGH;
18246         case  2:
18247         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
18248         else {
18249           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18250         }
18251       }
18252       if (unlikely(kw_args > 0)) {
18253         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18254       }
18255     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18256       goto __pyx_L5_argtuple_error;
18257     } else {
18258       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18259       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18260       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18261     }
18262     __pyx_v___pyx_type = values[0];
18263     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18264     __pyx_v___pyx_state = values[2];
18265   }
18266   goto __pyx_L4_argument_unpacking_done;
18267   __pyx_L5_argtuple_error:;
18268   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
18269   __pyx_L3_error:;
18270   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18271   __Pyx_RefNannyFinishContext();
18272   return NULL;
18273   __pyx_L4_argument_unpacking_done:;
18274   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18275 
18276   /* function exit code */
18277   __Pyx_RefNannyFinishContext();
18278   return __pyx_r;
18279 }
18280 
__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)18281 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) {
18282   PyObject *__pyx_v___pyx_PickleError = 0;
18283   PyObject *__pyx_v___pyx_result = 0;
18284   PyObject *__pyx_r = NULL;
18285   __Pyx_RefNannyDeclarations
18286   int __pyx_t_1;
18287   PyObject *__pyx_t_2 = NULL;
18288   PyObject *__pyx_t_3 = NULL;
18289   PyObject *__pyx_t_4 = NULL;
18290   PyObject *__pyx_t_5 = NULL;
18291   int __pyx_t_6;
18292   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18293 
18294   /* "(tree fragment)":4
18295  *     cdef object __pyx_PickleError
18296  *     cdef object __pyx_result
18297  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
18298  *         from pickle import PickleError as __pyx_PickleError
18299  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18300  */
18301   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
18302   if (__pyx_t_1) {
18303 
18304     /* "(tree fragment)":5
18305  *     cdef object __pyx_result
18306  *     if __pyx_checksum != 0xb068931:
18307  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
18308  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18309  *     __pyx_result = Enum.__new__(__pyx_type)
18310  */
18311     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
18312     __Pyx_GOTREF(__pyx_t_2);
18313     __Pyx_INCREF(__pyx_n_s_PickleError);
18314     __Pyx_GIVEREF(__pyx_n_s_PickleError);
18315     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
18316     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18317     __Pyx_GOTREF(__pyx_t_3);
18318     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18319     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
18320     __Pyx_GOTREF(__pyx_t_2);
18321     __Pyx_INCREF(__pyx_t_2);
18322     __pyx_v___pyx_PickleError = __pyx_t_2;
18323     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18324     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18325 
18326     /* "(tree fragment)":6
18327  *     if __pyx_checksum != 0xb068931:
18328  *         from pickle import PickleError as __pyx_PickleError
18329  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
18330  *     __pyx_result = Enum.__new__(__pyx_type)
18331  *     if __pyx_state is not None:
18332  */
18333     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
18334     __Pyx_GOTREF(__pyx_t_2);
18335     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
18336     __Pyx_GOTREF(__pyx_t_4);
18337     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18338     __Pyx_INCREF(__pyx_v___pyx_PickleError);
18339     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
18340     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
18341       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
18342       if (likely(__pyx_t_5)) {
18343         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18344         __Pyx_INCREF(__pyx_t_5);
18345         __Pyx_INCREF(function);
18346         __Pyx_DECREF_SET(__pyx_t_2, function);
18347       }
18348     }
18349     __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);
18350     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18351     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18352     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18353     __Pyx_GOTREF(__pyx_t_3);
18354     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18355     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18356     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18357     __PYX_ERR(1, 6, __pyx_L1_error)
18358 
18359     /* "(tree fragment)":4
18360  *     cdef object __pyx_PickleError
18361  *     cdef object __pyx_result
18362  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
18363  *         from pickle import PickleError as __pyx_PickleError
18364  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18365  */
18366   }
18367 
18368   /* "(tree fragment)":7
18369  *         from pickle import PickleError as __pyx_PickleError
18370  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18371  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
18372  *     if __pyx_state is not None:
18373  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18374  */
18375   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18376   __Pyx_GOTREF(__pyx_t_2);
18377   __pyx_t_4 = NULL;
18378   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18379     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
18380     if (likely(__pyx_t_4)) {
18381       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18382       __Pyx_INCREF(__pyx_t_4);
18383       __Pyx_INCREF(function);
18384       __Pyx_DECREF_SET(__pyx_t_2, function);
18385     }
18386   }
18387   __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);
18388   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18389   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18390   __Pyx_GOTREF(__pyx_t_3);
18391   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18392   __pyx_v___pyx_result = __pyx_t_3;
18393   __pyx_t_3 = 0;
18394 
18395   /* "(tree fragment)":8
18396  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18397  *     __pyx_result = Enum.__new__(__pyx_type)
18398  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18399  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18400  *     return __pyx_result
18401  */
18402   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
18403   __pyx_t_6 = (__pyx_t_1 != 0);
18404   if (__pyx_t_6) {
18405 
18406     /* "(tree fragment)":9
18407  *     __pyx_result = Enum.__new__(__pyx_type)
18408  *     if __pyx_state is not None:
18409  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
18410  *     return __pyx_result
18411  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18412  */
18413     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(1, 9, __pyx_L1_error)
18414     __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(1, 9, __pyx_L1_error)
18415     __Pyx_GOTREF(__pyx_t_3);
18416     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18417 
18418     /* "(tree fragment)":8
18419  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
18420  *     __pyx_result = Enum.__new__(__pyx_type)
18421  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18422  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18423  *     return __pyx_result
18424  */
18425   }
18426 
18427   /* "(tree fragment)":10
18428  *     if __pyx_state is not None:
18429  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18430  *     return __pyx_result             # <<<<<<<<<<<<<<
18431  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18432  *     __pyx_result.name = __pyx_state[0]
18433  */
18434   __Pyx_XDECREF(__pyx_r);
18435   __Pyx_INCREF(__pyx_v___pyx_result);
18436   __pyx_r = __pyx_v___pyx_result;
18437   goto __pyx_L0;
18438 
18439   /* "(tree fragment)":1
18440  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18441  *     cdef object __pyx_PickleError
18442  *     cdef object __pyx_result
18443  */
18444 
18445   /* function exit code */
18446   __pyx_L1_error:;
18447   __Pyx_XDECREF(__pyx_t_2);
18448   __Pyx_XDECREF(__pyx_t_3);
18449   __Pyx_XDECREF(__pyx_t_4);
18450   __Pyx_XDECREF(__pyx_t_5);
18451   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18452   __pyx_r = NULL;
18453   __pyx_L0:;
18454   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18455   __Pyx_XDECREF(__pyx_v___pyx_result);
18456   __Pyx_XGIVEREF(__pyx_r);
18457   __Pyx_RefNannyFinishContext();
18458   return __pyx_r;
18459 }
18460 
18461 /* "(tree fragment)":11
18462  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18463  *     return __pyx_result
18464  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18465  *     __pyx_result.name = __pyx_state[0]
18466  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18467  */
18468 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)18469 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18470   PyObject *__pyx_r = NULL;
18471   __Pyx_RefNannyDeclarations
18472   PyObject *__pyx_t_1 = NULL;
18473   int __pyx_t_2;
18474   Py_ssize_t __pyx_t_3;
18475   int __pyx_t_4;
18476   int __pyx_t_5;
18477   PyObject *__pyx_t_6 = NULL;
18478   PyObject *__pyx_t_7 = NULL;
18479   PyObject *__pyx_t_8 = NULL;
18480   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
18481 
18482   /* "(tree fragment)":12
18483  *     return __pyx_result
18484  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18485  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
18486  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18487  *         __pyx_result.__dict__.update(__pyx_state[1])
18488  */
18489   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18490     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18491     __PYX_ERR(1, 12, __pyx_L1_error)
18492   }
18493   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18494   __Pyx_GOTREF(__pyx_t_1);
18495   __Pyx_GIVEREF(__pyx_t_1);
18496   __Pyx_GOTREF(__pyx_v___pyx_result->name);
18497   __Pyx_DECREF(__pyx_v___pyx_result->name);
18498   __pyx_v___pyx_result->name = __pyx_t_1;
18499   __pyx_t_1 = 0;
18500 
18501   /* "(tree fragment)":13
18502  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18503  *     __pyx_result.name = __pyx_state[0]
18504  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
18505  *         __pyx_result.__dict__.update(__pyx_state[1])
18506  */
18507   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18508     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18509     __PYX_ERR(1, 13, __pyx_L1_error)
18510   }
18511   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18512   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
18513   if (__pyx_t_4) {
18514   } else {
18515     __pyx_t_2 = __pyx_t_4;
18516     goto __pyx_L4_bool_binop_done;
18517   }
18518   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18519   __pyx_t_5 = (__pyx_t_4 != 0);
18520   __pyx_t_2 = __pyx_t_5;
18521   __pyx_L4_bool_binop_done:;
18522   if (__pyx_t_2) {
18523 
18524     /* "(tree fragment)":14
18525  *     __pyx_result.name = __pyx_state[0]
18526  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18527  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
18528  */
18529     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18530     __Pyx_GOTREF(__pyx_t_6);
18531     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
18532     __Pyx_GOTREF(__pyx_t_7);
18533     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18534     if (unlikely(__pyx_v___pyx_state == Py_None)) {
18535       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18536       __PYX_ERR(1, 14, __pyx_L1_error)
18537     }
18538     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18539     __Pyx_GOTREF(__pyx_t_6);
18540     __pyx_t_8 = NULL;
18541     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
18542       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
18543       if (likely(__pyx_t_8)) {
18544         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
18545         __Pyx_INCREF(__pyx_t_8);
18546         __Pyx_INCREF(function);
18547         __Pyx_DECREF_SET(__pyx_t_7, function);
18548       }
18549     }
18550     __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);
18551     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18552     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18553     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18554     __Pyx_GOTREF(__pyx_t_1);
18555     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18556     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18557 
18558     /* "(tree fragment)":13
18559  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18560  *     __pyx_result.name = __pyx_state[0]
18561  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
18562  *         __pyx_result.__dict__.update(__pyx_state[1])
18563  */
18564   }
18565 
18566   /* "(tree fragment)":11
18567  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18568  *     return __pyx_result
18569  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18570  *     __pyx_result.name = __pyx_state[0]
18571  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18572  */
18573 
18574   /* function exit code */
18575   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18576   goto __pyx_L0;
18577   __pyx_L1_error:;
18578   __Pyx_XDECREF(__pyx_t_1);
18579   __Pyx_XDECREF(__pyx_t_6);
18580   __Pyx_XDECREF(__pyx_t_7);
18581   __Pyx_XDECREF(__pyx_t_8);
18582   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18583   __pyx_r = 0;
18584   __pyx_L0:;
18585   __Pyx_XGIVEREF(__pyx_r);
18586   __Pyx_RefNannyFinishContext();
18587   return __pyx_r;
18588 }
18589 
__pyx_tp_new_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)18590 static PyObject *__pyx_tp_new_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18591   PyObject *o;
18592   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18593     o = (*t->tp_alloc)(t, 0);
18594   } else {
18595     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18596   }
18597   if (unlikely(!o)) return 0;
18598   return o;
18599 }
18600 
__pyx_tp_dealloc_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing(PyObject * o)18601 static void __pyx_tp_dealloc_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing(PyObject *o) {
18602   #if CYTHON_USE_TP_FINALIZE
18603   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))) {
18604     if (PyObject_CallFinalizerFromDealloc(o)) return;
18605   }
18606   #endif
18607   {
18608     PyObject *etype, *eval, *etb;
18609     PyErr_Fetch(&etype, &eval, &etb);
18610     ++Py_REFCNT(o);
18611     __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_5__dealloc__(o);
18612     --Py_REFCNT(o);
18613     PyErr_Restore(etype, eval, etb);
18614   }
18615   (*Py_TYPE(o)->tp_free)(o);
18616 }
18617 
18618 static PyMethodDef __pyx_methods_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing[] = {
18619   {"add_nodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_3add_nodes, METH_VARARGS|METH_KEYWORDS, 0},
18620   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_7__reduce_cython__, METH_NOARGS, 0},
18621   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_9__setstate_cython__, METH_O, 0},
18622   {0, 0, 0, 0}
18623 };
18624 
18625 static PyTypeObject __pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing = {
18626   PyVarObject_HEAD_INIT(0, 0)
18627   "yt.utilities.lib._octree_raytracing._OctreeRayTracing", /*tp_name*/
18628   sizeof(struct __pyx_obj_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing), /*tp_basicsize*/
18629   0, /*tp_itemsize*/
18630   __pyx_tp_dealloc_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing, /*tp_dealloc*/
18631   0, /*tp_print*/
18632   0, /*tp_getattr*/
18633   0, /*tp_setattr*/
18634   #if PY_MAJOR_VERSION < 3
18635   0, /*tp_compare*/
18636   #endif
18637   #if PY_MAJOR_VERSION >= 3
18638   0, /*tp_as_async*/
18639   #endif
18640   0, /*tp_repr*/
18641   0, /*tp_as_number*/
18642   0, /*tp_as_sequence*/
18643   0, /*tp_as_mapping*/
18644   0, /*tp_hash*/
18645   0, /*tp_call*/
18646   0, /*tp_str*/
18647   0, /*tp_getattro*/
18648   0, /*tp_setattro*/
18649   0, /*tp_as_buffer*/
18650   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
18651   0, /*tp_doc*/
18652   0, /*tp_traverse*/
18653   0, /*tp_clear*/
18654   0, /*tp_richcompare*/
18655   0, /*tp_weaklistoffset*/
18656   0, /*tp_iter*/
18657   0, /*tp_iternext*/
18658   __pyx_methods_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing, /*tp_methods*/
18659   0, /*tp_members*/
18660   0, /*tp_getset*/
18661   0, /*tp_base*/
18662   0, /*tp_dict*/
18663   0, /*tp_descr_get*/
18664   0, /*tp_descr_set*/
18665   0, /*tp_dictoffset*/
18666   __pyx_pw_2yt_9utilities_3lib_18_octree_raytracing_17_OctreeRayTracing_1__init__, /*tp_init*/
18667   0, /*tp_alloc*/
18668   __pyx_tp_new_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing, /*tp_new*/
18669   0, /*tp_free*/
18670   0, /*tp_is_gc*/
18671   0, /*tp_bases*/
18672   0, /*tp_mro*/
18673   0, /*tp_cache*/
18674   0, /*tp_subclasses*/
18675   0, /*tp_weaklist*/
18676   0, /*tp_del*/
18677   0, /*tp_version_tag*/
18678   #if PY_VERSION_HEX >= 0x030400a1
18679   0, /*tp_finalize*/
18680   #endif
18681   #if PY_VERSION_HEX >= 0x030800b1
18682   0, /*tp_vectorcall*/
18683   #endif
18684 };
18685 static struct __pyx_vtabstruct_array __pyx_vtable_array;
18686 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)18687 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
18688   struct __pyx_array_obj *p;
18689   PyObject *o;
18690   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18691     o = (*t->tp_alloc)(t, 0);
18692   } else {
18693     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18694   }
18695   if (unlikely(!o)) return 0;
18696   p = ((struct __pyx_array_obj *)o);
18697   p->__pyx_vtab = __pyx_vtabptr_array;
18698   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
18699   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
18700   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
18701   return o;
18702   bad:
18703   Py_DECREF(o); o = 0;
18704   return NULL;
18705 }
18706 
__pyx_tp_dealloc_array(PyObject * o)18707 static void __pyx_tp_dealloc_array(PyObject *o) {
18708   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
18709   #if CYTHON_USE_TP_FINALIZE
18710   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))) {
18711     if (PyObject_CallFinalizerFromDealloc(o)) return;
18712   }
18713   #endif
18714   {
18715     PyObject *etype, *eval, *etb;
18716     PyErr_Fetch(&etype, &eval, &etb);
18717     ++Py_REFCNT(o);
18718     __pyx_array___dealloc__(o);
18719     --Py_REFCNT(o);
18720     PyErr_Restore(etype, eval, etb);
18721   }
18722   Py_CLEAR(p->mode);
18723   Py_CLEAR(p->_format);
18724   (*Py_TYPE(o)->tp_free)(o);
18725 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)18726 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
18727   PyObject *r;
18728   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
18729   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18730   Py_DECREF(x);
18731   return r;
18732 }
18733 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)18734 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
18735   if (v) {
18736     return __pyx_array___setitem__(o, i, v);
18737   }
18738   else {
18739     PyErr_Format(PyExc_NotImplementedError,
18740       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18741     return -1;
18742   }
18743 }
18744 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)18745 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
18746   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
18747   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
18748     PyErr_Clear();
18749     v = __pyx_array___getattr__(o, n);
18750   }
18751   return v;
18752 }
18753 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)18754 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
18755   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
18756 }
18757 
18758 static PyMethodDef __pyx_methods_array[] = {
18759   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
18760   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
18761   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
18762   {0, 0, 0, 0}
18763 };
18764 
18765 static struct PyGetSetDef __pyx_getsets_array[] = {
18766   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
18767   {0, 0, 0, 0, 0}
18768 };
18769 
18770 static PySequenceMethods __pyx_tp_as_sequence_array = {
18771   __pyx_array___len__, /*sq_length*/
18772   0, /*sq_concat*/
18773   0, /*sq_repeat*/
18774   __pyx_sq_item_array, /*sq_item*/
18775   0, /*sq_slice*/
18776   0, /*sq_ass_item*/
18777   0, /*sq_ass_slice*/
18778   0, /*sq_contains*/
18779   0, /*sq_inplace_concat*/
18780   0, /*sq_inplace_repeat*/
18781 };
18782 
18783 static PyMappingMethods __pyx_tp_as_mapping_array = {
18784   __pyx_array___len__, /*mp_length*/
18785   __pyx_array___getitem__, /*mp_subscript*/
18786   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
18787 };
18788 
18789 static PyBufferProcs __pyx_tp_as_buffer_array = {
18790   #if PY_MAJOR_VERSION < 3
18791   0, /*bf_getreadbuffer*/
18792   #endif
18793   #if PY_MAJOR_VERSION < 3
18794   0, /*bf_getwritebuffer*/
18795   #endif
18796   #if PY_MAJOR_VERSION < 3
18797   0, /*bf_getsegcount*/
18798   #endif
18799   #if PY_MAJOR_VERSION < 3
18800   0, /*bf_getcharbuffer*/
18801   #endif
18802   __pyx_array_getbuffer, /*bf_getbuffer*/
18803   0, /*bf_releasebuffer*/
18804 };
18805 
18806 static PyTypeObject __pyx_type___pyx_array = {
18807   PyVarObject_HEAD_INIT(0, 0)
18808   "yt.utilities.lib._octree_raytracing.array", /*tp_name*/
18809   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
18810   0, /*tp_itemsize*/
18811   __pyx_tp_dealloc_array, /*tp_dealloc*/
18812   0, /*tp_print*/
18813   0, /*tp_getattr*/
18814   0, /*tp_setattr*/
18815   #if PY_MAJOR_VERSION < 3
18816   0, /*tp_compare*/
18817   #endif
18818   #if PY_MAJOR_VERSION >= 3
18819   0, /*tp_as_async*/
18820   #endif
18821   0, /*tp_repr*/
18822   0, /*tp_as_number*/
18823   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
18824   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
18825   0, /*tp_hash*/
18826   0, /*tp_call*/
18827   0, /*tp_str*/
18828   __pyx_tp_getattro_array, /*tp_getattro*/
18829   0, /*tp_setattro*/
18830   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
18831   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
18832   0, /*tp_doc*/
18833   0, /*tp_traverse*/
18834   0, /*tp_clear*/
18835   0, /*tp_richcompare*/
18836   0, /*tp_weaklistoffset*/
18837   0, /*tp_iter*/
18838   0, /*tp_iternext*/
18839   __pyx_methods_array, /*tp_methods*/
18840   0, /*tp_members*/
18841   __pyx_getsets_array, /*tp_getset*/
18842   0, /*tp_base*/
18843   0, /*tp_dict*/
18844   0, /*tp_descr_get*/
18845   0, /*tp_descr_set*/
18846   0, /*tp_dictoffset*/
18847   0, /*tp_init*/
18848   0, /*tp_alloc*/
18849   __pyx_tp_new_array, /*tp_new*/
18850   0, /*tp_free*/
18851   0, /*tp_is_gc*/
18852   0, /*tp_bases*/
18853   0, /*tp_mro*/
18854   0, /*tp_cache*/
18855   0, /*tp_subclasses*/
18856   0, /*tp_weaklist*/
18857   0, /*tp_del*/
18858   0, /*tp_version_tag*/
18859   #if PY_VERSION_HEX >= 0x030400a1
18860   0, /*tp_finalize*/
18861   #endif
18862   #if PY_VERSION_HEX >= 0x030800b1
18863   0, /*tp_vectorcall*/
18864   #endif
18865 };
18866 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)18867 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18868   struct __pyx_MemviewEnum_obj *p;
18869   PyObject *o;
18870   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18871     o = (*t->tp_alloc)(t, 0);
18872   } else {
18873     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18874   }
18875   if (unlikely(!o)) return 0;
18876   p = ((struct __pyx_MemviewEnum_obj *)o);
18877   p->name = Py_None; Py_INCREF(Py_None);
18878   return o;
18879 }
18880 
__pyx_tp_dealloc_Enum(PyObject * o)18881 static void __pyx_tp_dealloc_Enum(PyObject *o) {
18882   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18883   #if CYTHON_USE_TP_FINALIZE
18884   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
18885     if (PyObject_CallFinalizerFromDealloc(o)) return;
18886   }
18887   #endif
18888   PyObject_GC_UnTrack(o);
18889   Py_CLEAR(p->name);
18890   (*Py_TYPE(o)->tp_free)(o);
18891 }
18892 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)18893 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
18894   int e;
18895   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18896   if (p->name) {
18897     e = (*v)(p->name, a); if (e) return e;
18898   }
18899   return 0;
18900 }
18901 
__pyx_tp_clear_Enum(PyObject * o)18902 static int __pyx_tp_clear_Enum(PyObject *o) {
18903   PyObject* tmp;
18904   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18905   tmp = ((PyObject*)p->name);
18906   p->name = Py_None; Py_INCREF(Py_None);
18907   Py_XDECREF(tmp);
18908   return 0;
18909 }
18910 
18911 static PyMethodDef __pyx_methods_Enum[] = {
18912   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
18913   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
18914   {0, 0, 0, 0}
18915 };
18916 
18917 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
18918   PyVarObject_HEAD_INIT(0, 0)
18919   "yt.utilities.lib._octree_raytracing.Enum", /*tp_name*/
18920   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
18921   0, /*tp_itemsize*/
18922   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
18923   0, /*tp_print*/
18924   0, /*tp_getattr*/
18925   0, /*tp_setattr*/
18926   #if PY_MAJOR_VERSION < 3
18927   0, /*tp_compare*/
18928   #endif
18929   #if PY_MAJOR_VERSION >= 3
18930   0, /*tp_as_async*/
18931   #endif
18932   __pyx_MemviewEnum___repr__, /*tp_repr*/
18933   0, /*tp_as_number*/
18934   0, /*tp_as_sequence*/
18935   0, /*tp_as_mapping*/
18936   0, /*tp_hash*/
18937   0, /*tp_call*/
18938   0, /*tp_str*/
18939   0, /*tp_getattro*/
18940   0, /*tp_setattro*/
18941   0, /*tp_as_buffer*/
18942   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
18943   0, /*tp_doc*/
18944   __pyx_tp_traverse_Enum, /*tp_traverse*/
18945   __pyx_tp_clear_Enum, /*tp_clear*/
18946   0, /*tp_richcompare*/
18947   0, /*tp_weaklistoffset*/
18948   0, /*tp_iter*/
18949   0, /*tp_iternext*/
18950   __pyx_methods_Enum, /*tp_methods*/
18951   0, /*tp_members*/
18952   0, /*tp_getset*/
18953   0, /*tp_base*/
18954   0, /*tp_dict*/
18955   0, /*tp_descr_get*/
18956   0, /*tp_descr_set*/
18957   0, /*tp_dictoffset*/
18958   __pyx_MemviewEnum___init__, /*tp_init*/
18959   0, /*tp_alloc*/
18960   __pyx_tp_new_Enum, /*tp_new*/
18961   0, /*tp_free*/
18962   0, /*tp_is_gc*/
18963   0, /*tp_bases*/
18964   0, /*tp_mro*/
18965   0, /*tp_cache*/
18966   0, /*tp_subclasses*/
18967   0, /*tp_weaklist*/
18968   0, /*tp_del*/
18969   0, /*tp_version_tag*/
18970   #if PY_VERSION_HEX >= 0x030400a1
18971   0, /*tp_finalize*/
18972   #endif
18973   #if PY_VERSION_HEX >= 0x030800b1
18974   0, /*tp_vectorcall*/
18975   #endif
18976 };
18977 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
18978 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)18979 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
18980   struct __pyx_memoryview_obj *p;
18981   PyObject *o;
18982   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18983     o = (*t->tp_alloc)(t, 0);
18984   } else {
18985     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18986   }
18987   if (unlikely(!o)) return 0;
18988   p = ((struct __pyx_memoryview_obj *)o);
18989   p->__pyx_vtab = __pyx_vtabptr_memoryview;
18990   p->obj = Py_None; Py_INCREF(Py_None);
18991   p->_size = Py_None; Py_INCREF(Py_None);
18992   p->_array_interface = Py_None; Py_INCREF(Py_None);
18993   p->view.obj = NULL;
18994   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
18995   return o;
18996   bad:
18997   Py_DECREF(o); o = 0;
18998   return NULL;
18999 }
19000 
__pyx_tp_dealloc_memoryview(PyObject * o)19001 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
19002   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19003   #if CYTHON_USE_TP_FINALIZE
19004   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19005     if (PyObject_CallFinalizerFromDealloc(o)) return;
19006   }
19007   #endif
19008   PyObject_GC_UnTrack(o);
19009   {
19010     PyObject *etype, *eval, *etb;
19011     PyErr_Fetch(&etype, &eval, &etb);
19012     ++Py_REFCNT(o);
19013     __pyx_memoryview___dealloc__(o);
19014     --Py_REFCNT(o);
19015     PyErr_Restore(etype, eval, etb);
19016   }
19017   Py_CLEAR(p->obj);
19018   Py_CLEAR(p->_size);
19019   Py_CLEAR(p->_array_interface);
19020   (*Py_TYPE(o)->tp_free)(o);
19021 }
19022 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)19023 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
19024   int e;
19025   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19026   if (p->obj) {
19027     e = (*v)(p->obj, a); if (e) return e;
19028   }
19029   if (p->_size) {
19030     e = (*v)(p->_size, a); if (e) return e;
19031   }
19032   if (p->_array_interface) {
19033     e = (*v)(p->_array_interface, a); if (e) return e;
19034   }
19035   if (p->view.obj) {
19036     e = (*v)(p->view.obj, a); if (e) return e;
19037   }
19038   return 0;
19039 }
19040 
__pyx_tp_clear_memoryview(PyObject * o)19041 static int __pyx_tp_clear_memoryview(PyObject *o) {
19042   PyObject* tmp;
19043   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
19044   tmp = ((PyObject*)p->obj);
19045   p->obj = Py_None; Py_INCREF(Py_None);
19046   Py_XDECREF(tmp);
19047   tmp = ((PyObject*)p->_size);
19048   p->_size = Py_None; Py_INCREF(Py_None);
19049   Py_XDECREF(tmp);
19050   tmp = ((PyObject*)p->_array_interface);
19051   p->_array_interface = Py_None; Py_INCREF(Py_None);
19052   Py_XDECREF(tmp);
19053   Py_CLEAR(p->view.obj);
19054   return 0;
19055 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)19056 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
19057   PyObject *r;
19058   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19059   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19060   Py_DECREF(x);
19061   return r;
19062 }
19063 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)19064 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
19065   if (v) {
19066     return __pyx_memoryview___setitem__(o, i, v);
19067   }
19068   else {
19069     PyErr_Format(PyExc_NotImplementedError,
19070       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19071     return -1;
19072   }
19073 }
19074 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)19075 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
19076   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
19077 }
19078 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)19079 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
19080   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
19081 }
19082 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)19083 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
19084   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
19085 }
19086 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)19087 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
19088   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
19089 }
19090 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)19091 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
19092   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
19093 }
19094 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)19095 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
19096   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
19097 }
19098 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)19099 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
19100   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
19101 }
19102 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)19103 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
19104   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
19105 }
19106 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)19107 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
19108   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
19109 }
19110 
19111 static PyMethodDef __pyx_methods_memoryview[] = {
19112   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
19113   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
19114   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
19115   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
19116   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
19117   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
19118   {0, 0, 0, 0}
19119 };
19120 
19121 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
19122   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
19123   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
19124   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
19125   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
19126   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
19127   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
19128   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
19129   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
19130   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
19131   {0, 0, 0, 0, 0}
19132 };
19133 
19134 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
19135   __pyx_memoryview___len__, /*sq_length*/
19136   0, /*sq_concat*/
19137   0, /*sq_repeat*/
19138   __pyx_sq_item_memoryview, /*sq_item*/
19139   0, /*sq_slice*/
19140   0, /*sq_ass_item*/
19141   0, /*sq_ass_slice*/
19142   0, /*sq_contains*/
19143   0, /*sq_inplace_concat*/
19144   0, /*sq_inplace_repeat*/
19145 };
19146 
19147 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
19148   __pyx_memoryview___len__, /*mp_length*/
19149   __pyx_memoryview___getitem__, /*mp_subscript*/
19150   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
19151 };
19152 
19153 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
19154   #if PY_MAJOR_VERSION < 3
19155   0, /*bf_getreadbuffer*/
19156   #endif
19157   #if PY_MAJOR_VERSION < 3
19158   0, /*bf_getwritebuffer*/
19159   #endif
19160   #if PY_MAJOR_VERSION < 3
19161   0, /*bf_getsegcount*/
19162   #endif
19163   #if PY_MAJOR_VERSION < 3
19164   0, /*bf_getcharbuffer*/
19165   #endif
19166   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
19167   0, /*bf_releasebuffer*/
19168 };
19169 
19170 static PyTypeObject __pyx_type___pyx_memoryview = {
19171   PyVarObject_HEAD_INIT(0, 0)
19172   "yt.utilities.lib._octree_raytracing.memoryview", /*tp_name*/
19173   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
19174   0, /*tp_itemsize*/
19175   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
19176   0, /*tp_print*/
19177   0, /*tp_getattr*/
19178   0, /*tp_setattr*/
19179   #if PY_MAJOR_VERSION < 3
19180   0, /*tp_compare*/
19181   #endif
19182   #if PY_MAJOR_VERSION >= 3
19183   0, /*tp_as_async*/
19184   #endif
19185   __pyx_memoryview___repr__, /*tp_repr*/
19186   0, /*tp_as_number*/
19187   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
19188   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
19189   0, /*tp_hash*/
19190   0, /*tp_call*/
19191   __pyx_memoryview___str__, /*tp_str*/
19192   0, /*tp_getattro*/
19193   0, /*tp_setattro*/
19194   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
19195   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19196   0, /*tp_doc*/
19197   __pyx_tp_traverse_memoryview, /*tp_traverse*/
19198   __pyx_tp_clear_memoryview, /*tp_clear*/
19199   0, /*tp_richcompare*/
19200   0, /*tp_weaklistoffset*/
19201   0, /*tp_iter*/
19202   0, /*tp_iternext*/
19203   __pyx_methods_memoryview, /*tp_methods*/
19204   0, /*tp_members*/
19205   __pyx_getsets_memoryview, /*tp_getset*/
19206   0, /*tp_base*/
19207   0, /*tp_dict*/
19208   0, /*tp_descr_get*/
19209   0, /*tp_descr_set*/
19210   0, /*tp_dictoffset*/
19211   0, /*tp_init*/
19212   0, /*tp_alloc*/
19213   __pyx_tp_new_memoryview, /*tp_new*/
19214   0, /*tp_free*/
19215   0, /*tp_is_gc*/
19216   0, /*tp_bases*/
19217   0, /*tp_mro*/
19218   0, /*tp_cache*/
19219   0, /*tp_subclasses*/
19220   0, /*tp_weaklist*/
19221   0, /*tp_del*/
19222   0, /*tp_version_tag*/
19223   #if PY_VERSION_HEX >= 0x030400a1
19224   0, /*tp_finalize*/
19225   #endif
19226   #if PY_VERSION_HEX >= 0x030800b1
19227   0, /*tp_vectorcall*/
19228   #endif
19229 };
19230 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
19231 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)19232 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
19233   struct __pyx_memoryviewslice_obj *p;
19234   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
19235   if (unlikely(!o)) return 0;
19236   p = ((struct __pyx_memoryviewslice_obj *)o);
19237   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
19238   p->from_object = Py_None; Py_INCREF(Py_None);
19239   p->from_slice.memview = NULL;
19240   return o;
19241 }
19242 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)19243 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
19244   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19245   #if CYTHON_USE_TP_FINALIZE
19246   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19247     if (PyObject_CallFinalizerFromDealloc(o)) return;
19248   }
19249   #endif
19250   PyObject_GC_UnTrack(o);
19251   {
19252     PyObject *etype, *eval, *etb;
19253     PyErr_Fetch(&etype, &eval, &etb);
19254     ++Py_REFCNT(o);
19255     __pyx_memoryviewslice___dealloc__(o);
19256     --Py_REFCNT(o);
19257     PyErr_Restore(etype, eval, etb);
19258   }
19259   Py_CLEAR(p->from_object);
19260   PyObject_GC_Track(o);
19261   __pyx_tp_dealloc_memoryview(o);
19262 }
19263 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)19264 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
19265   int e;
19266   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19267   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
19268   if (p->from_object) {
19269     e = (*v)(p->from_object, a); if (e) return e;
19270   }
19271   return 0;
19272 }
19273 
__pyx_tp_clear__memoryviewslice(PyObject * o)19274 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
19275   PyObject* tmp;
19276   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19277   __pyx_tp_clear_memoryview(o);
19278   tmp = ((PyObject*)p->from_object);
19279   p->from_object = Py_None; Py_INCREF(Py_None);
19280   Py_XDECREF(tmp);
19281   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
19282   return 0;
19283 }
19284 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)19285 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
19286   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
19287 }
19288 
19289 static PyMethodDef __pyx_methods__memoryviewslice[] = {
19290   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
19291   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
19292   {0, 0, 0, 0}
19293 };
19294 
19295 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
19296   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
19297   {0, 0, 0, 0, 0}
19298 };
19299 
19300 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
19301   PyVarObject_HEAD_INIT(0, 0)
19302   "yt.utilities.lib._octree_raytracing._memoryviewslice", /*tp_name*/
19303   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
19304   0, /*tp_itemsize*/
19305   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
19306   0, /*tp_print*/
19307   0, /*tp_getattr*/
19308   0, /*tp_setattr*/
19309   #if PY_MAJOR_VERSION < 3
19310   0, /*tp_compare*/
19311   #endif
19312   #if PY_MAJOR_VERSION >= 3
19313   0, /*tp_as_async*/
19314   #endif
19315   #if CYTHON_COMPILING_IN_PYPY
19316   __pyx_memoryview___repr__, /*tp_repr*/
19317   #else
19318   0, /*tp_repr*/
19319   #endif
19320   0, /*tp_as_number*/
19321   0, /*tp_as_sequence*/
19322   0, /*tp_as_mapping*/
19323   0, /*tp_hash*/
19324   0, /*tp_call*/
19325   #if CYTHON_COMPILING_IN_PYPY
19326   __pyx_memoryview___str__, /*tp_str*/
19327   #else
19328   0, /*tp_str*/
19329   #endif
19330   0, /*tp_getattro*/
19331   0, /*tp_setattro*/
19332   0, /*tp_as_buffer*/
19333   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19334   "Internal class for passing memoryview slices to Python", /*tp_doc*/
19335   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
19336   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
19337   0, /*tp_richcompare*/
19338   0, /*tp_weaklistoffset*/
19339   0, /*tp_iter*/
19340   0, /*tp_iternext*/
19341   __pyx_methods__memoryviewslice, /*tp_methods*/
19342   0, /*tp_members*/
19343   __pyx_getsets__memoryviewslice, /*tp_getset*/
19344   0, /*tp_base*/
19345   0, /*tp_dict*/
19346   0, /*tp_descr_get*/
19347   0, /*tp_descr_set*/
19348   0, /*tp_dictoffset*/
19349   0, /*tp_init*/
19350   0, /*tp_alloc*/
19351   __pyx_tp_new__memoryviewslice, /*tp_new*/
19352   0, /*tp_free*/
19353   0, /*tp_is_gc*/
19354   0, /*tp_bases*/
19355   0, /*tp_mro*/
19356   0, /*tp_cache*/
19357   0, /*tp_subclasses*/
19358   0, /*tp_weaklist*/
19359   0, /*tp_del*/
19360   0, /*tp_version_tag*/
19361   #if PY_VERSION_HEX >= 0x030400a1
19362   0, /*tp_finalize*/
19363   #endif
19364   #if PY_VERSION_HEX >= 0x030800b1
19365   0, /*tp_vectorcall*/
19366   #endif
19367 };
19368 
19369 static PyMethodDef __pyx_methods[] = {
19370   {0, 0, 0, 0}
19371 };
19372 
19373 #if PY_MAJOR_VERSION >= 3
19374 #if CYTHON_PEP489_MULTI_PHASE_INIT
19375 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
19376 static int __pyx_pymod_exec__octree_raytracing(PyObject* module); /*proto*/
19377 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19378   {Py_mod_create, (void*)__pyx_pymod_create},
19379   {Py_mod_exec, (void*)__pyx_pymod_exec__octree_raytracing},
19380   {0, NULL}
19381 };
19382 #endif
19383 
19384 static struct PyModuleDef __pyx_moduledef = {
19385     PyModuleDef_HEAD_INIT,
19386     "_octree_raytracing",
19387     __pyx_k_This_is_a_wrapper_around_the_C_c, /* m_doc */
19388   #if CYTHON_PEP489_MULTI_PHASE_INIT
19389     0, /* m_size */
19390   #else
19391     -1, /* m_size */
19392   #endif
19393     __pyx_methods /* m_methods */,
19394   #if CYTHON_PEP489_MULTI_PHASE_INIT
19395     __pyx_moduledef_slots, /* m_slots */
19396   #else
19397     NULL, /* m_reload */
19398   #endif
19399     NULL, /* m_traverse */
19400     NULL, /* m_clear */
19401     NULL /* m_free */
19402 };
19403 #endif
19404 #ifndef CYTHON_SMALL_CODE
19405 #if defined(__clang__)
19406     #define CYTHON_SMALL_CODE
19407 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19408     #define CYTHON_SMALL_CODE __attribute__((cold))
19409 #else
19410     #define CYTHON_SMALL_CODE
19411 #endif
19412 #endif
19413 
19414 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19415   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
19416   {&__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},
19417   {&__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},
19418   {&__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},
19419   {&__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},
19420   {&__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},
19421   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
19422   {&__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},
19423   {&__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},
19424   {&__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},
19425   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
19426   {&__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},
19427   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19428   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
19429   {&__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},
19430   {&__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},
19431   {&__pyx_n_s_LE, __pyx_k_LE, sizeof(__pyx_k_LE), 0, 0, 1, 1},
19432   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
19433   {&__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},
19434   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
19435   {&__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},
19436   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
19437   {&__pyx_n_s_OctreeRayTracing, __pyx_k_OctreeRayTracing, sizeof(__pyx_k_OctreeRayTracing), 0, 0, 1, 1},
19438   {&__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},
19439   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
19440   {&__pyx_n_s_RE, __pyx_k_RE, sizeof(__pyx_k_RE), 0, 0, 1, 1},
19441   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
19442   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19443   {&__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},
19444   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19445   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
19446   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
19447   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
19448   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
19449   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
19450   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
19451   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19452   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
19453   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
19454   {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
19455   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
19456   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
19457   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
19458   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
19459   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
19460   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
19461   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
19462   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
19463   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
19464   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19465   {&__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},
19466   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
19467   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
19468   {&__pyx_n_s_ipos_view, __pyx_k_ipos_view, sizeof(__pyx_k_ipos_view), 0, 0, 1, 1},
19469   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
19470   {&__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},
19471   {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
19472   {&__pyx_n_s_lvl_view, __pyx_k_lvl_view, sizeof(__pyx_k_lvl_view), 0, 0, 1, 1},
19473   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
19474   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
19475   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
19476   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
19477   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
19478   {&__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},
19479   {&__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},
19480   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
19481   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
19482   {&__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},
19483   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
19484   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
19485   {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
19486   {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
19487   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
19488   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
19489   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
19490   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
19491   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
19492   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
19493   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
19494   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
19495   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
19496   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
19497   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19498   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
19499   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19500   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19501   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19502   {&__pyx_kp_s_self_oct_cannot_be_converted_to, __pyx_k_self_oct_cannot_be_converted_to, sizeof(__pyx_k_self_oct_cannot_be_converted_to), 0, 0, 1, 0},
19503   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19504   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19505   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
19506   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
19507   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
19508   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
19509   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
19510   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
19511   {&__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},
19512   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
19513   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
19514   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
19515   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
19516   {&__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},
19517   {&__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},
19518   {&__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},
19519   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
19520   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
19521   {0, 0, 0, 0, 0, 0, 0}
19522 };
__Pyx_InitCachedBuiltins(void)19523 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
19524   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 40, __pyx_L1_error)
19525   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
19526   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
19527   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
19528   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
19529   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
19530   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
19531   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
19532   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
19533   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
19534   return 0;
19535   __pyx_L1_error:;
19536   return -1;
19537 }
19538 
__Pyx_InitCachedConstants(void)19539 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
19540   __Pyx_RefNannyDeclarations
19541   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
19542 
19543   /* "(tree fragment)":2
19544  * def __reduce_cython__(self):
19545  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
19546  * def __setstate_cython__(self, __pyx_state):
19547  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
19548  */
19549   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_oct_cannot_be_converted_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
19550   __Pyx_GOTREF(__pyx_tuple_);
19551   __Pyx_GIVEREF(__pyx_tuple_);
19552 
19553   /* "(tree fragment)":4
19554  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")
19555  * def __setstate_cython__(self, __pyx_state):
19556  *     raise TypeError("self.oct cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
19557  */
19558   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_oct_cannot_be_converted_to); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
19559   __Pyx_GOTREF(__pyx_tuple__2);
19560   __Pyx_GIVEREF(__pyx_tuple__2);
19561 
19562   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
19563  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
19564  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
19565  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
19566  *
19567  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
19568  */
19569   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 272, __pyx_L1_error)
19570   __Pyx_GOTREF(__pyx_tuple__3);
19571   __Pyx_GIVEREF(__pyx_tuple__3);
19572 
19573   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
19574  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
19575  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
19576  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
19577  *
19578  *             info.buf = PyArray_DATA(self)
19579  */
19580   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 276, __pyx_L1_error)
19581   __Pyx_GOTREF(__pyx_tuple__4);
19582   __Pyx_GIVEREF(__pyx_tuple__4);
19583 
19584   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
19585  *                 if ((descr.byteorder == c'>' and little_endian) or
19586  *                     (descr.byteorder == c'<' and not little_endian)):
19587  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
19588  *                 if   t == NPY_BYTE:        f = "b"
19589  *                 elif t == NPY_UBYTE:       f = "B"
19590  */
19591   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 306, __pyx_L1_error)
19592   __Pyx_GOTREF(__pyx_tuple__5);
19593   __Pyx_GIVEREF(__pyx_tuple__5);
19594 
19595   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
19596  *
19597  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
19598  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
19599  *
19600  *         if ((child.byteorder == c'>' and little_endian) or
19601  */
19602   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 856, __pyx_L1_error)
19603   __Pyx_GOTREF(__pyx_tuple__6);
19604   __Pyx_GIVEREF(__pyx_tuple__6);
19605 
19606   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
19607  *             t = child.type_num
19608  *             if end - f < 5:
19609  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
19610  *
19611  *             # Until ticket #99 is fixed, use integers to avoid warnings
19612  */
19613   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 880, __pyx_L1_error)
19614   __Pyx_GOTREF(__pyx_tuple__7);
19615   __Pyx_GIVEREF(__pyx_tuple__7);
19616 
19617   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
19618  *         _import_array()
19619  *     except Exception:
19620  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
19621  *
19622  * cdef inline int import_umath() except -1:
19623  */
19624   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 1038, __pyx_L1_error)
19625   __Pyx_GOTREF(__pyx_tuple__8);
19626   __Pyx_GIVEREF(__pyx_tuple__8);
19627 
19628   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
19629  *         _import_umath()
19630  *     except Exception:
19631  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
19632  *
19633  * cdef inline int import_ufunc() except -1:
19634  */
19635   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1044, __pyx_L1_error)
19636   __Pyx_GOTREF(__pyx_tuple__9);
19637   __Pyx_GIVEREF(__pyx_tuple__9);
19638 
19639   /* "View.MemoryView":133
19640  *
19641  *         if not self.ndim:
19642  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
19643  *
19644  *         if itemsize <= 0:
19645  */
19646   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 133, __pyx_L1_error)
19647   __Pyx_GOTREF(__pyx_tuple__10);
19648   __Pyx_GIVEREF(__pyx_tuple__10);
19649 
19650   /* "View.MemoryView":136
19651  *
19652  *         if itemsize <= 0:
19653  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
19654  *
19655  *         if not isinstance(format, bytes):
19656  */
19657   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 136, __pyx_L1_error)
19658   __Pyx_GOTREF(__pyx_tuple__11);
19659   __Pyx_GIVEREF(__pyx_tuple__11);
19660 
19661   /* "View.MemoryView":148
19662  *
19663  *         if not self._shape:
19664  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
19665  *
19666  *
19667  */
19668   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 148, __pyx_L1_error)
19669   __Pyx_GOTREF(__pyx_tuple__12);
19670   __Pyx_GIVEREF(__pyx_tuple__12);
19671 
19672   /* "View.MemoryView":176
19673  *             self.data = <char *>malloc(self.len)
19674  *             if not self.data:
19675  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
19676  *
19677  *             if self.dtype_is_object:
19678  */
19679   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 176, __pyx_L1_error)
19680   __Pyx_GOTREF(__pyx_tuple__13);
19681   __Pyx_GIVEREF(__pyx_tuple__13);
19682 
19683   /* "View.MemoryView":192
19684  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
19685  *         if not (flags & bufmode):
19686  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
19687  *         info.buf = self.data
19688  *         info.len = self.len
19689  */
19690   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 192, __pyx_L1_error)
19691   __Pyx_GOTREF(__pyx_tuple__14);
19692   __Pyx_GIVEREF(__pyx_tuple__14);
19693 
19694   /* "(tree fragment)":2
19695  * def __reduce_cython__(self):
19696  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19697  * def __setstate_cython__(self, __pyx_state):
19698  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19699  */
19700   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
19701   __Pyx_GOTREF(__pyx_tuple__15);
19702   __Pyx_GIVEREF(__pyx_tuple__15);
19703 
19704   /* "(tree fragment)":4
19705  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19706  * def __setstate_cython__(self, __pyx_state):
19707  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19708  */
19709   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
19710   __Pyx_GOTREF(__pyx_tuple__16);
19711   __Pyx_GIVEREF(__pyx_tuple__16);
19712 
19713   /* "View.MemoryView":414
19714  *     def __setitem__(memoryview self, object index, object value):
19715  *         if self.view.readonly:
19716  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
19717  *
19718  *         have_slices, index = _unellipsify(index, self.view.ndim)
19719  */
19720   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 414, __pyx_L1_error)
19721   __Pyx_GOTREF(__pyx_tuple__17);
19722   __Pyx_GIVEREF(__pyx_tuple__17);
19723 
19724   /* "View.MemoryView":491
19725  *             result = struct.unpack(self.view.format, bytesitem)
19726  *         except struct.error:
19727  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
19728  *         else:
19729  *             if len(self.view.format) == 1:
19730  */
19731   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 491, __pyx_L1_error)
19732   __Pyx_GOTREF(__pyx_tuple__18);
19733   __Pyx_GIVEREF(__pyx_tuple__18);
19734 
19735   /* "View.MemoryView":516
19736  *     def __getbuffer__(self, Py_buffer *info, int flags):
19737  *         if flags & PyBUF_WRITABLE and self.view.readonly:
19738  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
19739  *
19740  *         if flags & PyBUF_ND:
19741  */
19742   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 516, __pyx_L1_error)
19743   __Pyx_GOTREF(__pyx_tuple__19);
19744   __Pyx_GIVEREF(__pyx_tuple__19);
19745 
19746   /* "View.MemoryView":566
19747  *         if self.view.strides == NULL:
19748  *
19749  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
19750  *
19751  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
19752  */
19753   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 566, __pyx_L1_error)
19754   __Pyx_GOTREF(__pyx_tuple__20);
19755   __Pyx_GIVEREF(__pyx_tuple__20);
19756 
19757   /* "View.MemoryView":573
19758  *     def suboffsets(self):
19759  *         if self.view.suboffsets == NULL:
19760  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
19761  *
19762  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
19763  */
19764   __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 573, __pyx_L1_error)
19765   __Pyx_GOTREF(__pyx_tuple__21);
19766   __Pyx_INCREF(__pyx_int_neg_1);
19767   __Pyx_GIVEREF(__pyx_int_neg_1);
19768   PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1);
19769   __Pyx_GIVEREF(__pyx_tuple__21);
19770 
19771   /* "(tree fragment)":2
19772  * def __reduce_cython__(self):
19773  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19774  * def __setstate_cython__(self, __pyx_state):
19775  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19776  */
19777   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
19778   __Pyx_GOTREF(__pyx_tuple__22);
19779   __Pyx_GIVEREF(__pyx_tuple__22);
19780 
19781   /* "(tree fragment)":4
19782  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19783  * def __setstate_cython__(self, __pyx_state):
19784  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19785  */
19786   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
19787   __Pyx_GOTREF(__pyx_tuple__23);
19788   __Pyx_GIVEREF(__pyx_tuple__23);
19789 
19790   /* "View.MemoryView":678
19791  *         if item is Ellipsis:
19792  *             if not seen_ellipsis:
19793  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
19794  *                 seen_ellipsis = True
19795  *             else:
19796  */
19797   __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(1, 678, __pyx_L1_error)
19798   __Pyx_GOTREF(__pyx_slice__24);
19799   __Pyx_GIVEREF(__pyx_slice__24);
19800 
19801   /* "View.MemoryView":699
19802  *     for suboffset in suboffsets[:ndim]:
19803  *         if suboffset >= 0:
19804  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
19805  *
19806  *
19807  */
19808   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 699, __pyx_L1_error)
19809   __Pyx_GOTREF(__pyx_tuple__25);
19810   __Pyx_GIVEREF(__pyx_tuple__25);
19811 
19812   /* "(tree fragment)":2
19813  * def __reduce_cython__(self):
19814  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19815  * def __setstate_cython__(self, __pyx_state):
19816  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19817  */
19818   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error)
19819   __Pyx_GOTREF(__pyx_tuple__26);
19820   __Pyx_GIVEREF(__pyx_tuple__26);
19821 
19822   /* "(tree fragment)":4
19823  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19824  * def __setstate_cython__(self, __pyx_state):
19825  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19826  */
19827   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error)
19828   __Pyx_GOTREF(__pyx_tuple__27);
19829   __Pyx_GIVEREF(__pyx_tuple__27);
19830 
19831   /* "View.MemoryView":286
19832  *         return self.name
19833  *
19834  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
19835  * cdef strided = Enum("<strided and direct>") # default
19836  * cdef indirect = Enum("<strided and indirect>")
19837  */
19838   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 286, __pyx_L1_error)
19839   __Pyx_GOTREF(__pyx_tuple__28);
19840   __Pyx_GIVEREF(__pyx_tuple__28);
19841 
19842   /* "View.MemoryView":287
19843  *
19844  * cdef generic = Enum("<strided and direct or indirect>")
19845  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
19846  * cdef indirect = Enum("<strided and indirect>")
19847  *
19848  */
19849   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 287, __pyx_L1_error)
19850   __Pyx_GOTREF(__pyx_tuple__29);
19851   __Pyx_GIVEREF(__pyx_tuple__29);
19852 
19853   /* "View.MemoryView":288
19854  * cdef generic = Enum("<strided and direct or indirect>")
19855  * cdef strided = Enum("<strided and direct>") # default
19856  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
19857  *
19858  *
19859  */
19860   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 288, __pyx_L1_error)
19861   __Pyx_GOTREF(__pyx_tuple__30);
19862   __Pyx_GIVEREF(__pyx_tuple__30);
19863 
19864   /* "View.MemoryView":291
19865  *
19866  *
19867  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
19868  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
19869  *
19870  */
19871   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 291, __pyx_L1_error)
19872   __Pyx_GOTREF(__pyx_tuple__31);
19873   __Pyx_GIVEREF(__pyx_tuple__31);
19874 
19875   /* "View.MemoryView":292
19876  *
19877  * cdef contiguous = Enum("<contiguous and direct>")
19878  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
19879  *
19880  *
19881  */
19882   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 292, __pyx_L1_error)
19883   __Pyx_GOTREF(__pyx_tuple__32);
19884   __Pyx_GIVEREF(__pyx_tuple__32);
19885 
19886   /* "(tree fragment)":1
19887  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
19888  *     cdef object __pyx_PickleError
19889  *     cdef object __pyx_result
19890  */
19891   __pyx_tuple__33 = 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__33)) __PYX_ERR(1, 1, __pyx_L1_error)
19892   __Pyx_GOTREF(__pyx_tuple__33);
19893   __Pyx_GIVEREF(__pyx_tuple__33);
19894   __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error)
19895   __Pyx_RefNannyFinishContext();
19896   return 0;
19897   __pyx_L1_error:;
19898   __Pyx_RefNannyFinishContext();
19899   return -1;
19900 }
19901 
__Pyx_InitGlobals(void)19902 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
19903   /* InitThreads.init */
19904   #ifdef WITH_THREAD
19905 PyEval_InitThreads();
19906 #endif
19907 
19908 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
19909 
19910   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
19911   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
19912   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19913   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
19914   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
19915   return 0;
19916   __pyx_L1_error:;
19917   return -1;
19918 }
19919 
19920 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
19921 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
19922 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
19923 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
19924 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
19925 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
19926 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
19927 
__Pyx_modinit_global_init_code(void)19928 static int __Pyx_modinit_global_init_code(void) {
19929   __Pyx_RefNannyDeclarations
19930   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
19931   /*--- Global init code ---*/
19932   generic = Py_None; Py_INCREF(Py_None);
19933   strided = Py_None; Py_INCREF(Py_None);
19934   indirect = Py_None; Py_INCREF(Py_None);
19935   contiguous = Py_None; Py_INCREF(Py_None);
19936   indirect_contiguous = Py_None; Py_INCREF(Py_None);
19937   __Pyx_RefNannyFinishContext();
19938   return 0;
19939 }
19940 
__Pyx_modinit_variable_export_code(void)19941 static int __Pyx_modinit_variable_export_code(void) {
19942   __Pyx_RefNannyDeclarations
19943   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
19944   /*--- Variable export code ---*/
19945   __Pyx_RefNannyFinishContext();
19946   return 0;
19947 }
19948 
__Pyx_modinit_function_export_code(void)19949 static int __Pyx_modinit_function_export_code(void) {
19950   __Pyx_RefNannyDeclarations
19951   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
19952   /*--- Function export code ---*/
19953   __Pyx_RefNannyFinishContext();
19954   return 0;
19955 }
19956 
__Pyx_modinit_type_init_code(void)19957 static int __Pyx_modinit_type_init_code(void) {
19958   __Pyx_RefNannyDeclarations
19959   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
19960   /*--- Type init code ---*/
19961   if (PyType_Ready(&__pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
19962   #if PY_VERSION_HEX < 0x030800B1
19963   __pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing.tp_print = 0;
19964   #endif
19965   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing.tp_dictoffset && __pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing.tp_getattro == PyObject_GenericGetAttr)) {
19966     __pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19967   }
19968   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OctreeRayTracing, (PyObject *)&__pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
19969   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
19970   __pyx_ptype_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing = &__pyx_type_2yt_9utilities_3lib_18_octree_raytracing__OctreeRayTracing;
19971   __pyx_vtabptr_array = &__pyx_vtable_array;
19972   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
19973   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
19974   #if PY_VERSION_HEX < 0x030800B1
19975   __pyx_type___pyx_array.tp_print = 0;
19976   #endif
19977   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
19978   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
19979   __pyx_array_type = &__pyx_type___pyx_array;
19980   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
19981   #if PY_VERSION_HEX < 0x030800B1
19982   __pyx_type___pyx_MemviewEnum.tp_print = 0;
19983   #endif
19984   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
19985     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19986   }
19987   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
19988   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
19989   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
19990   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
19991   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
19992   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
19993   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
19994   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
19995   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
19996   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
19997   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
19998   #if PY_VERSION_HEX < 0x030800B1
19999   __pyx_type___pyx_memoryview.tp_print = 0;
20000   #endif
20001   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
20002     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20003   }
20004   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
20005   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
20006   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
20007   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
20008   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
20009   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
20010   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
20011   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
20012   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
20013   #if PY_VERSION_HEX < 0x030800B1
20014   __pyx_type___pyx_memoryviewslice.tp_print = 0;
20015   #endif
20016   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
20017     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20018   }
20019   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
20020   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
20021   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
20022   __Pyx_RefNannyFinishContext();
20023   return 0;
20024   __pyx_L1_error:;
20025   __Pyx_RefNannyFinishContext();
20026   return -1;
20027 }
20028 
__Pyx_modinit_type_import_code(void)20029 static int __Pyx_modinit_type_import_code(void) {
20030   __Pyx_RefNannyDeclarations
20031   PyObject *__pyx_t_1 = NULL;
20032   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
20033   /*--- Type import code ---*/
20034   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
20035   __Pyx_GOTREF(__pyx_t_1);
20036   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
20037   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
20038   sizeof(PyTypeObject),
20039   #else
20040   sizeof(PyHeapTypeObject),
20041   #endif
20042   __Pyx_ImportType_CheckSize_Warn);
20043    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
20044   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20045   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
20046   __Pyx_GOTREF(__pyx_t_1);
20047   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
20048    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
20049   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
20050    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
20051   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
20052    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
20053   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
20054    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
20055   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
20056    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
20057   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20058   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.partitioned_grid"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
20059   __Pyx_GOTREF(__pyx_t_1);
20060   __pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.partitioned_grid", "PartitionedGrid", sizeof(struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid), __Pyx_ImportType_CheckSize_Warn);
20061    if (!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) __PYX_ERR(4, 18, __pyx_L1_error)
20062   __pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = (struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid)) __PYX_ERR(4, 18, __pyx_L1_error)
20063   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20064   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.image_samplers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
20065   __Pyx_GOTREF(__pyx_t_1);
20066   __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.image_samplers", "ImageSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler), __Pyx_ImportType_CheckSize_Warn);
20067    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler) __PYX_ERR(5, 37, __pyx_L1_error)
20068   __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler)) __PYX_ERR(5, 37, __pyx_L1_error)
20069   __pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.image_samplers", "ProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler), __Pyx_ImportType_CheckSize_Warn);
20070    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) __PYX_ERR(5, 71, __pyx_L1_error)
20071   __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler)) __PYX_ERR(5, 71, __pyx_L1_error)
20072   __pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.image_samplers", "InterpolatedProjectionSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler), __Pyx_ImportType_CheckSize_Warn);
20073    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) __PYX_ERR(5, 74, __pyx_L1_error)
20074   __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler)) __PYX_ERR(5, 74, __pyx_L1_error)
20075   __pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.image_samplers", "VolumeRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler), __Pyx_ImportType_CheckSize_Warn);
20076    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) __PYX_ERR(5, 79, __pyx_L1_error)
20077   __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler)) __PYX_ERR(5, 79, __pyx_L1_error)
20078   __pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.image_samplers", "LightSourceRenderSampler", sizeof(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler), __Pyx_ImportType_CheckSize_Warn);
20079    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) __PYX_ERR(5, 85, __pyx_L1_error)
20080   __pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = (struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler)) __PYX_ERR(5, 85, __pyx_L1_error)
20081   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20082   __Pyx_RefNannyFinishContext();
20083   return 0;
20084   __pyx_L1_error:;
20085   __Pyx_XDECREF(__pyx_t_1);
20086   __Pyx_RefNannyFinishContext();
20087   return -1;
20088 }
20089 
__Pyx_modinit_variable_import_code(void)20090 static int __Pyx_modinit_variable_import_code(void) {
20091   __Pyx_RefNannyDeclarations
20092   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
20093   /*--- Variable import code ---*/
20094   __Pyx_RefNannyFinishContext();
20095   return 0;
20096 }
20097 
__Pyx_modinit_function_import_code(void)20098 static int __Pyx_modinit_function_import_code(void) {
20099   __Pyx_RefNannyDeclarations
20100   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
20101   /*--- Function import code ---*/
20102   __Pyx_RefNannyFinishContext();
20103   return 0;
20104 }
20105 
20106 
20107 #if PY_MAJOR_VERSION < 3
20108 #ifdef CYTHON_NO_PYINIT_EXPORT
20109 #define __Pyx_PyMODINIT_FUNC void
20110 #else
20111 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20112 #endif
20113 #else
20114 #ifdef CYTHON_NO_PYINIT_EXPORT
20115 #define __Pyx_PyMODINIT_FUNC PyObject *
20116 #else
20117 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20118 #endif
20119 #endif
20120 
20121 
20122 #if PY_MAJOR_VERSION < 3
20123 __Pyx_PyMODINIT_FUNC init_octree_raytracing(void) CYTHON_SMALL_CODE; /*proto*/
init_octree_raytracing(void)20124 __Pyx_PyMODINIT_FUNC init_octree_raytracing(void)
20125 #else
20126 __Pyx_PyMODINIT_FUNC PyInit__octree_raytracing(void) CYTHON_SMALL_CODE; /*proto*/
20127 __Pyx_PyMODINIT_FUNC PyInit__octree_raytracing(void)
20128 #if CYTHON_PEP489_MULTI_PHASE_INIT
20129 {
20130   return PyModuleDef_Init(&__pyx_moduledef);
20131 }
20132 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
20133     #if PY_VERSION_HEX >= 0x030700A1
20134     static PY_INT64_T main_interpreter_id = -1;
20135     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
20136     if (main_interpreter_id == -1) {
20137         main_interpreter_id = current_id;
20138         return (unlikely(current_id == -1)) ? -1 : 0;
20139     } else if (unlikely(main_interpreter_id != current_id))
20140     #else
20141     static PyInterpreterState *main_interpreter = NULL;
20142     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
20143     if (!main_interpreter) {
20144         main_interpreter = current_interpreter;
20145     } else if (unlikely(main_interpreter != current_interpreter))
20146     #endif
20147     {
20148         PyErr_SetString(
20149             PyExc_ImportError,
20150             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
20151         return -1;
20152     }
20153     return 0;
20154 }
20155 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) {
20156     PyObject *value = PyObject_GetAttrString(spec, from_name);
20157     int result = 0;
20158     if (likely(value)) {
20159         if (allow_none || value != Py_None) {
20160             result = PyDict_SetItemString(moddict, to_name, value);
20161         }
20162         Py_DECREF(value);
20163     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20164         PyErr_Clear();
20165     } else {
20166         result = -1;
20167     }
20168     return result;
20169 }
20170 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20171     PyObject *module = NULL, *moddict, *modname;
20172     if (__Pyx_check_single_interpreter())
20173         return NULL;
20174     if (__pyx_m)
20175         return __Pyx_NewRef(__pyx_m);
20176     modname = PyObject_GetAttrString(spec, "name");
20177     if (unlikely(!modname)) goto bad;
20178     module = PyModule_NewObject(modname);
20179     Py_DECREF(modname);
20180     if (unlikely(!module)) goto bad;
20181     moddict = PyModule_GetDict(module);
20182     if (unlikely(!moddict)) goto bad;
20183     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
20184     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
20185     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
20186     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
20187     return module;
20188 bad:
20189     Py_XDECREF(module);
20190     return NULL;
20191 }
20192 
20193 
20194 static CYTHON_SMALL_CODE int __pyx_pymod_exec__octree_raytracing(PyObject *__pyx_pyinit_module)
20195 #endif
20196 #endif
20197 {
20198   PyObject *__pyx_t_1 = NULL;
20199   static PyThread_type_lock __pyx_t_2[8];
20200   __Pyx_RefNannyDeclarations
20201   #if CYTHON_PEP489_MULTI_PHASE_INIT
20202   if (__pyx_m) {
20203     if (__pyx_m == __pyx_pyinit_module) return 0;
20204     PyErr_SetString(PyExc_RuntimeError, "Module '_octree_raytracing' has already been imported. Re-initialisation is not supported.");
20205     return -1;
20206   }
20207   #elif PY_MAJOR_VERSION >= 3
20208   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
20209   #endif
20210   #if CYTHON_REFNANNY
20211 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
20212 if (!__Pyx_RefNanny) {
20213   PyErr_Clear();
20214   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
20215   if (!__Pyx_RefNanny)
20216       Py_FatalError("failed to import 'refnanny' module");
20217 }
20218 #endif
20219   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__octree_raytracing(void)", 0);
20220   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20221   #ifdef __Pxy_PyFrame_Initialize_Offsets
20222   __Pxy_PyFrame_Initialize_Offsets();
20223   #endif
20224   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20225   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20226   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20227   #ifdef __Pyx_CyFunction_USED
20228   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20229   #endif
20230   #ifdef __Pyx_FusedFunction_USED
20231   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20232   #endif
20233   #ifdef __Pyx_Coroutine_USED
20234   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20235   #endif
20236   #ifdef __Pyx_Generator_USED
20237   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20238   #endif
20239   #ifdef __Pyx_AsyncGen_USED
20240   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20241   #endif
20242   #ifdef __Pyx_StopAsyncIteration_USED
20243   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20244   #endif
20245   /*--- Library function declarations ---*/
20246   /*--- Threads initialization code ---*/
20247   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
20248   #ifdef WITH_THREAD /* Python build with threading support? */
20249   PyEval_InitThreads();
20250   #endif
20251   #endif
20252   /*--- Module creation code ---*/
20253   #if CYTHON_PEP489_MULTI_PHASE_INIT
20254   __pyx_m = __pyx_pyinit_module;
20255   Py_INCREF(__pyx_m);
20256   #else
20257   #if PY_MAJOR_VERSION < 3
20258   __pyx_m = Py_InitModule4("_octree_raytracing", __pyx_methods, __pyx_k_This_is_a_wrapper_around_the_C_c, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20259   #else
20260   __pyx_m = PyModule_Create(&__pyx_moduledef);
20261   #endif
20262   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
20263   #endif
20264   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20265   Py_INCREF(__pyx_d);
20266   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20267   Py_INCREF(__pyx_b);
20268   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20269   Py_INCREF(__pyx_cython_runtime);
20270   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
20271   /*--- Initialize various global constants etc. ---*/
20272   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20273   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20274   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20275   #endif
20276   if (__pyx_module_is_main_yt__utilities__lib___octree_raytracing) {
20277     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20278   }
20279   #if PY_MAJOR_VERSION >= 3
20280   {
20281     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20282     if (!PyDict_GetItemString(modules, "yt.utilities.lib._octree_raytracing")) {
20283       if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib._octree_raytracing", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
20284     }
20285   }
20286   #endif
20287   /*--- Builtin init code ---*/
20288   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
20289   /*--- Constants init code ---*/
20290   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
20291   /*--- Global type/function init code ---*/
20292   (void)__Pyx_modinit_global_init_code();
20293   (void)__Pyx_modinit_variable_export_code();
20294   (void)__Pyx_modinit_function_export_code();
20295   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
20296   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
20297   (void)__Pyx_modinit_variable_import_code();
20298   (void)__Pyx_modinit_function_import_code();
20299   /*--- Execution code ---*/
20300   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20301   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20302   #endif
20303 
20304   /* "yt/utilities/lib/_octree_raytracing.pyx":10
20305  * cimport numpy as np
20306  *
20307  * import numpy as np             # <<<<<<<<<<<<<<
20308  *
20309  * cimport cython
20310  */
20311   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
20312   __Pyx_GOTREF(__pyx_t_1);
20313   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
20314   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20315 
20316   /* "yt/utilities/lib/_octree_raytracing.pyx":1
20317  * # distutils: language = c++             # <<<<<<<<<<<<<<
20318  * # distutils: extra_compile_args = CPP14_FLAG
20319  * """This is a wrapper around the C++ class to efficiently cast rays into an octree.
20320  */
20321   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20322   __Pyx_GOTREF(__pyx_t_1);
20323   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20324   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20325 
20326   /* "View.MemoryView":209
20327  *         info.obj = self
20328  *
20329  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20330  *
20331  *     def __dealloc__(array self):
20332  */
20333   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
20334   __Pyx_GOTREF(__pyx_t_1);
20335   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
20336   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20337   PyType_Modified(__pyx_array_type);
20338 
20339   /* "View.MemoryView":286
20340  *         return self.name
20341  *
20342  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
20343  * cdef strided = Enum("<strided and direct>") # default
20344  * cdef indirect = Enum("<strided and indirect>")
20345  */
20346   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
20347   __Pyx_GOTREF(__pyx_t_1);
20348   __Pyx_XGOTREF(generic);
20349   __Pyx_DECREF_SET(generic, __pyx_t_1);
20350   __Pyx_GIVEREF(__pyx_t_1);
20351   __pyx_t_1 = 0;
20352 
20353   /* "View.MemoryView":287
20354  *
20355  * cdef generic = Enum("<strided and direct or indirect>")
20356  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
20357  * cdef indirect = Enum("<strided and indirect>")
20358  *
20359  */
20360   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
20361   __Pyx_GOTREF(__pyx_t_1);
20362   __Pyx_XGOTREF(strided);
20363   __Pyx_DECREF_SET(strided, __pyx_t_1);
20364   __Pyx_GIVEREF(__pyx_t_1);
20365   __pyx_t_1 = 0;
20366 
20367   /* "View.MemoryView":288
20368  * cdef generic = Enum("<strided and direct or indirect>")
20369  * cdef strided = Enum("<strided and direct>") # default
20370  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
20371  *
20372  *
20373  */
20374   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
20375   __Pyx_GOTREF(__pyx_t_1);
20376   __Pyx_XGOTREF(indirect);
20377   __Pyx_DECREF_SET(indirect, __pyx_t_1);
20378   __Pyx_GIVEREF(__pyx_t_1);
20379   __pyx_t_1 = 0;
20380 
20381   /* "View.MemoryView":291
20382  *
20383  *
20384  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
20385  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
20386  *
20387  */
20388   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
20389   __Pyx_GOTREF(__pyx_t_1);
20390   __Pyx_XGOTREF(contiguous);
20391   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
20392   __Pyx_GIVEREF(__pyx_t_1);
20393   __pyx_t_1 = 0;
20394 
20395   /* "View.MemoryView":292
20396  *
20397  * cdef contiguous = Enum("<contiguous and direct>")
20398  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
20399  *
20400  *
20401  */
20402   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
20403   __Pyx_GOTREF(__pyx_t_1);
20404   __Pyx_XGOTREF(indirect_contiguous);
20405   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
20406   __Pyx_GIVEREF(__pyx_t_1);
20407   __pyx_t_1 = 0;
20408 
20409   /* "View.MemoryView":316
20410  *
20411  * DEF THREAD_LOCKS_PREALLOCATED = 8
20412  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
20413  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
20414  *     PyThread_allocate_lock(),
20415  */
20416   __pyx_memoryview_thread_locks_used = 0;
20417 
20418   /* "View.MemoryView":317
20419  * DEF THREAD_LOCKS_PREALLOCATED = 8
20420  * cdef int __pyx_memoryview_thread_locks_used = 0
20421  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
20422  *     PyThread_allocate_lock(),
20423  *     PyThread_allocate_lock(),
20424  */
20425   __pyx_t_2[0] = PyThread_allocate_lock();
20426   __pyx_t_2[1] = PyThread_allocate_lock();
20427   __pyx_t_2[2] = PyThread_allocate_lock();
20428   __pyx_t_2[3] = PyThread_allocate_lock();
20429   __pyx_t_2[4] = PyThread_allocate_lock();
20430   __pyx_t_2[5] = PyThread_allocate_lock();
20431   __pyx_t_2[6] = PyThread_allocate_lock();
20432   __pyx_t_2[7] = PyThread_allocate_lock();
20433   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
20434 
20435   /* "View.MemoryView":545
20436  *         info.obj = self
20437  *
20438  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20439  *
20440  *
20441  */
20442   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
20443   __Pyx_GOTREF(__pyx_t_1);
20444   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
20445   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20446   PyType_Modified(__pyx_memoryview_type);
20447 
20448   /* "View.MemoryView":991
20449  *         return self.from_object
20450  *
20451  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
20452  *
20453  *
20454  */
20455   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
20456   __Pyx_GOTREF(__pyx_t_1);
20457   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
20458   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20459   PyType_Modified(__pyx_memoryviewslice_type);
20460 
20461   /* "(tree fragment)":1
20462  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
20463  *     cdef object __pyx_PickleError
20464  *     cdef object __pyx_result
20465  */
20466   __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(1, 1, __pyx_L1_error)
20467   __Pyx_GOTREF(__pyx_t_1);
20468   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20469   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20470 
20471   /* "(tree fragment)":11
20472  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20473  *     return __pyx_result
20474  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
20475  *     __pyx_result.name = __pyx_state[0]
20476  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20477  */
20478 
20479   /*--- Wrapped vars code ---*/
20480 
20481   goto __pyx_L0;
20482   __pyx_L1_error:;
20483   __Pyx_XDECREF(__pyx_t_1);
20484   if (__pyx_m) {
20485     if (__pyx_d) {
20486       __Pyx_AddTraceback("init yt.utilities.lib._octree_raytracing", __pyx_clineno, __pyx_lineno, __pyx_filename);
20487     }
20488     Py_CLEAR(__pyx_m);
20489   } else if (!PyErr_Occurred()) {
20490     PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib._octree_raytracing");
20491   }
20492   __pyx_L0:;
20493   __Pyx_RefNannyFinishContext();
20494   #if CYTHON_PEP489_MULTI_PHASE_INIT
20495   return (__pyx_m != NULL) ? 0 : -1;
20496   #elif PY_MAJOR_VERSION >= 3
20497   return __pyx_m;
20498   #else
20499   return;
20500   #endif
20501 }
20502 
20503 /* --- Runtime support code --- */
20504 /* Refnanny */
20505 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)20506 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
20507     PyObject *m = NULL, *p = NULL;
20508     void *r = NULL;
20509     m = PyImport_ImportModule(modname);
20510     if (!m) goto end;
20511     p = PyObject_GetAttrString(m, "RefNannyAPI");
20512     if (!p) goto end;
20513     r = PyLong_AsVoidPtr(p);
20514 end:
20515     Py_XDECREF(p);
20516     Py_XDECREF(m);
20517     return (__Pyx_RefNannyAPIStruct *)r;
20518 }
20519 #endif
20520 
20521 /* PyObjectGetAttrStr */
20522 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)20523 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
20524     PyTypeObject* tp = Py_TYPE(obj);
20525     if (likely(tp->tp_getattro))
20526         return tp->tp_getattro(obj, attr_name);
20527 #if PY_MAJOR_VERSION < 3
20528     if (likely(tp->tp_getattr))
20529         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
20530 #endif
20531     return PyObject_GetAttr(obj, attr_name);
20532 }
20533 #endif
20534 
20535 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)20536 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20537     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20538     if (unlikely(!result)) {
20539         PyErr_Format(PyExc_NameError,
20540 #if PY_MAJOR_VERSION >= 3
20541             "name '%U' is not defined", name);
20542 #else
20543             "name '%.200s' is not defined", PyString_AS_STRING(name));
20544 #endif
20545     }
20546     return result;
20547 }
20548 
20549 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)20550 static void __Pyx_RaiseArgtupleInvalid(
20551     const char* func_name,
20552     int exact,
20553     Py_ssize_t num_min,
20554     Py_ssize_t num_max,
20555     Py_ssize_t num_found)
20556 {
20557     Py_ssize_t num_expected;
20558     const char *more_or_less;
20559     if (num_found < num_min) {
20560         num_expected = num_min;
20561         more_or_less = "at least";
20562     } else {
20563         num_expected = num_max;
20564         more_or_less = "at most";
20565     }
20566     if (exact) {
20567         more_or_less = "exactly";
20568     }
20569     PyErr_Format(PyExc_TypeError,
20570                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
20571                  func_name, more_or_less, num_expected,
20572                  (num_expected == 1) ? "" : "s", num_found);
20573 }
20574 
20575 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)20576 static void __Pyx_RaiseDoubleKeywordsError(
20577     const char* func_name,
20578     PyObject* kw_name)
20579 {
20580     PyErr_Format(PyExc_TypeError,
20581         #if PY_MAJOR_VERSION >= 3
20582         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
20583         #else
20584         "%s() got multiple values for keyword argument '%s'", func_name,
20585         PyString_AsString(kw_name));
20586         #endif
20587 }
20588 
20589 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)20590 static int __Pyx_ParseOptionalKeywords(
20591     PyObject *kwds,
20592     PyObject **argnames[],
20593     PyObject *kwds2,
20594     PyObject *values[],
20595     Py_ssize_t num_pos_args,
20596     const char* function_name)
20597 {
20598     PyObject *key = 0, *value = 0;
20599     Py_ssize_t pos = 0;
20600     PyObject*** name;
20601     PyObject*** first_kw_arg = argnames + num_pos_args;
20602     while (PyDict_Next(kwds, &pos, &key, &value)) {
20603         name = first_kw_arg;
20604         while (*name && (**name != key)) name++;
20605         if (*name) {
20606             values[name-argnames] = value;
20607             continue;
20608         }
20609         name = first_kw_arg;
20610         #if PY_MAJOR_VERSION < 3
20611         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
20612             while (*name) {
20613                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
20614                         && _PyString_Eq(**name, key)) {
20615                     values[name-argnames] = value;
20616                     break;
20617                 }
20618                 name++;
20619             }
20620             if (*name) continue;
20621             else {
20622                 PyObject*** argname = argnames;
20623                 while (argname != first_kw_arg) {
20624                     if ((**argname == key) || (
20625                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
20626                              && _PyString_Eq(**argname, key))) {
20627                         goto arg_passed_twice;
20628                     }
20629                     argname++;
20630                 }
20631             }
20632         } else
20633         #endif
20634         if (likely(PyUnicode_Check(key))) {
20635             while (*name) {
20636                 int cmp = (**name == key) ? 0 :
20637                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20638                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
20639                 #endif
20640                     PyUnicode_Compare(**name, key);
20641                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
20642                 if (cmp == 0) {
20643                     values[name-argnames] = value;
20644                     break;
20645                 }
20646                 name++;
20647             }
20648             if (*name) continue;
20649             else {
20650                 PyObject*** argname = argnames;
20651                 while (argname != first_kw_arg) {
20652                     int cmp = (**argname == key) ? 0 :
20653                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20654                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
20655                     #endif
20656                         PyUnicode_Compare(**argname, key);
20657                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
20658                     if (cmp == 0) goto arg_passed_twice;
20659                     argname++;
20660                 }
20661             }
20662         } else
20663             goto invalid_keyword_type;
20664         if (kwds2) {
20665             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
20666         } else {
20667             goto invalid_keyword;
20668         }
20669     }
20670     return 0;
20671 arg_passed_twice:
20672     __Pyx_RaiseDoubleKeywordsError(function_name, key);
20673     goto bad;
20674 invalid_keyword_type:
20675     PyErr_Format(PyExc_TypeError,
20676         "%.200s() keywords must be strings", function_name);
20677     goto bad;
20678 invalid_keyword:
20679     PyErr_Format(PyExc_TypeError,
20680     #if PY_MAJOR_VERSION < 3
20681         "%.200s() got an unexpected keyword argument '%.200s'",
20682         function_name, PyString_AsString(key));
20683     #else
20684         "%s() got an unexpected keyword argument '%U'",
20685         function_name, key);
20686     #endif
20687 bad:
20688     return -1;
20689 }
20690 
20691 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)20692 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
20693 {
20694     if (unlikely(!type)) {
20695         PyErr_SetString(PyExc_SystemError, "Missing type object");
20696         return 0;
20697     }
20698     else if (exact) {
20699         #if PY_MAJOR_VERSION == 2
20700         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
20701         #endif
20702     }
20703     else {
20704         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
20705     }
20706     PyErr_Format(PyExc_TypeError,
20707         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
20708         name, type->tp_name, Py_TYPE(obj)->tp_name);
20709     return 0;
20710 }
20711 
20712 /* MemviewSliceInit */
20713 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)20714 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
20715                         int ndim,
20716                         __Pyx_memviewslice *memviewslice,
20717                         int memview_is_new_reference)
20718 {
20719     __Pyx_RefNannyDeclarations
20720     int i, retval=-1;
20721     Py_buffer *buf = &memview->view;
20722     __Pyx_RefNannySetupContext("init_memviewslice", 0);
20723     if (memviewslice->memview || memviewslice->data) {
20724         PyErr_SetString(PyExc_ValueError,
20725             "memviewslice is already initialized!");
20726         goto fail;
20727     }
20728     if (buf->strides) {
20729         for (i = 0; i < ndim; i++) {
20730             memviewslice->strides[i] = buf->strides[i];
20731         }
20732     } else {
20733         Py_ssize_t stride = buf->itemsize;
20734         for (i = ndim - 1; i >= 0; i--) {
20735             memviewslice->strides[i] = stride;
20736             stride *= buf->shape[i];
20737         }
20738     }
20739     for (i = 0; i < ndim; i++) {
20740         memviewslice->shape[i]   = buf->shape[i];
20741         if (buf->suboffsets) {
20742             memviewslice->suboffsets[i] = buf->suboffsets[i];
20743         } else {
20744             memviewslice->suboffsets[i] = -1;
20745         }
20746     }
20747     memviewslice->memview = memview;
20748     memviewslice->data = (char *)buf->buf;
20749     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
20750         Py_INCREF(memview);
20751     }
20752     retval = 0;
20753     goto no_fail;
20754 fail:
20755     memviewslice->memview = 0;
20756     memviewslice->data = 0;
20757     retval = -1;
20758 no_fail:
20759     __Pyx_RefNannyFinishContext();
20760     return retval;
20761 }
20762 #ifndef Py_NO_RETURN
20763 #define Py_NO_RETURN
20764 #endif
__pyx_fatalerror(const char * fmt,...)20765 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
20766     va_list vargs;
20767     char msg[200];
20768 #ifdef HAVE_STDARG_PROTOTYPES
20769     va_start(vargs, fmt);
20770 #else
20771     va_start(vargs);
20772 #endif
20773     vsnprintf(msg, 200, fmt, vargs);
20774     va_end(vargs);
20775     Py_FatalError(msg);
20776 }
20777 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)20778 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
20779                                    PyThread_type_lock lock)
20780 {
20781     int result;
20782     PyThread_acquire_lock(lock, 1);
20783     result = (*acquisition_count)++;
20784     PyThread_release_lock(lock);
20785     return result;
20786 }
20787 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)20788 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
20789                                    PyThread_type_lock lock)
20790 {
20791     int result;
20792     PyThread_acquire_lock(lock, 1);
20793     result = (*acquisition_count)--;
20794     PyThread_release_lock(lock);
20795     return result;
20796 }
20797 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)20798 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
20799 {
20800     int first_time;
20801     struct __pyx_memoryview_obj *memview = memslice->memview;
20802     if (!memview || (PyObject *) memview == Py_None)
20803         return;
20804     if (__pyx_get_slice_count(memview) < 0)
20805         __pyx_fatalerror("Acquisition count is %d (line %d)",
20806                          __pyx_get_slice_count(memview), lineno);
20807     first_time = __pyx_add_acquisition_count(memview) == 0;
20808     if (first_time) {
20809         if (have_gil) {
20810             Py_INCREF((PyObject *) memview);
20811         } else {
20812             PyGILState_STATE _gilstate = PyGILState_Ensure();
20813             Py_INCREF((PyObject *) memview);
20814             PyGILState_Release(_gilstate);
20815         }
20816     }
20817 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)20818 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
20819                                              int have_gil, int lineno) {
20820     int last_time;
20821     struct __pyx_memoryview_obj *memview = memslice->memview;
20822     if (!memview ) {
20823         return;
20824     } else if ((PyObject *) memview == Py_None) {
20825         memslice->memview = NULL;
20826         return;
20827     }
20828     if (__pyx_get_slice_count(memview) <= 0)
20829         __pyx_fatalerror("Acquisition count is %d (line %d)",
20830                          __pyx_get_slice_count(memview), lineno);
20831     last_time = __pyx_sub_acquisition_count(memview) == 1;
20832     memslice->data = NULL;
20833     if (last_time) {
20834         if (have_gil) {
20835             Py_CLEAR(memslice->memview);
20836         } else {
20837             PyGILState_STATE _gilstate = PyGILState_Ensure();
20838             Py_CLEAR(memslice->memview);
20839             PyGILState_Release(_gilstate);
20840         }
20841     } else {
20842         memslice->memview = NULL;
20843     }
20844 }
20845 
20846 /* PyObjectCall */
20847 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)20848 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20849     PyObject *result;
20850     ternaryfunc call = func->ob_type->tp_call;
20851     if (unlikely(!call))
20852         return PyObject_Call(func, arg, kw);
20853     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
20854         return NULL;
20855     result = (*call)(func, arg, kw);
20856     Py_LeaveRecursiveCall();
20857     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20858         PyErr_SetString(
20859             PyExc_SystemError,
20860             "NULL result without error in PyObject_Call");
20861     }
20862     return result;
20863 }
20864 #endif
20865 
20866 /* PyErrFetchRestore */
20867 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)20868 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20869     PyObject *tmp_type, *tmp_value, *tmp_tb;
20870     tmp_type = tstate->curexc_type;
20871     tmp_value = tstate->curexc_value;
20872     tmp_tb = tstate->curexc_traceback;
20873     tstate->curexc_type = type;
20874     tstate->curexc_value = value;
20875     tstate->curexc_traceback = tb;
20876     Py_XDECREF(tmp_type);
20877     Py_XDECREF(tmp_value);
20878     Py_XDECREF(tmp_tb);
20879 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)20880 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20881     *type = tstate->curexc_type;
20882     *value = tstate->curexc_value;
20883     *tb = tstate->curexc_traceback;
20884     tstate->curexc_type = 0;
20885     tstate->curexc_value = 0;
20886     tstate->curexc_traceback = 0;
20887 }
20888 #endif
20889 
20890 /* RaiseException */
20891 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)20892 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
20893                         CYTHON_UNUSED PyObject *cause) {
20894     __Pyx_PyThreadState_declare
20895     Py_XINCREF(type);
20896     if (!value || value == Py_None)
20897         value = NULL;
20898     else
20899         Py_INCREF(value);
20900     if (!tb || tb == Py_None)
20901         tb = NULL;
20902     else {
20903         Py_INCREF(tb);
20904         if (!PyTraceBack_Check(tb)) {
20905             PyErr_SetString(PyExc_TypeError,
20906                 "raise: arg 3 must be a traceback or None");
20907             goto raise_error;
20908         }
20909     }
20910     if (PyType_Check(type)) {
20911 #if CYTHON_COMPILING_IN_PYPY
20912         if (!value) {
20913             Py_INCREF(Py_None);
20914             value = Py_None;
20915         }
20916 #endif
20917         PyErr_NormalizeException(&type, &value, &tb);
20918     } else {
20919         if (value) {
20920             PyErr_SetString(PyExc_TypeError,
20921                 "instance exception may not have a separate value");
20922             goto raise_error;
20923         }
20924         value = type;
20925         type = (PyObject*) Py_TYPE(type);
20926         Py_INCREF(type);
20927         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
20928             PyErr_SetString(PyExc_TypeError,
20929                 "raise: exception class must be a subclass of BaseException");
20930             goto raise_error;
20931         }
20932     }
20933     __Pyx_PyThreadState_assign
20934     __Pyx_ErrRestore(type, value, tb);
20935     return;
20936 raise_error:
20937     Py_XDECREF(value);
20938     Py_XDECREF(type);
20939     Py_XDECREF(tb);
20940     return;
20941 }
20942 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)20943 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
20944     PyObject* owned_instance = NULL;
20945     if (tb == Py_None) {
20946         tb = 0;
20947     } else if (tb && !PyTraceBack_Check(tb)) {
20948         PyErr_SetString(PyExc_TypeError,
20949             "raise: arg 3 must be a traceback or None");
20950         goto bad;
20951     }
20952     if (value == Py_None)
20953         value = 0;
20954     if (PyExceptionInstance_Check(type)) {
20955         if (value) {
20956             PyErr_SetString(PyExc_TypeError,
20957                 "instance exception may not have a separate value");
20958             goto bad;
20959         }
20960         value = type;
20961         type = (PyObject*) Py_TYPE(value);
20962     } else if (PyExceptionClass_Check(type)) {
20963         PyObject *instance_class = NULL;
20964         if (value && PyExceptionInstance_Check(value)) {
20965             instance_class = (PyObject*) Py_TYPE(value);
20966             if (instance_class != type) {
20967                 int is_subclass = PyObject_IsSubclass(instance_class, type);
20968                 if (!is_subclass) {
20969                     instance_class = NULL;
20970                 } else if (unlikely(is_subclass == -1)) {
20971                     goto bad;
20972                 } else {
20973                     type = instance_class;
20974                 }
20975             }
20976         }
20977         if (!instance_class) {
20978             PyObject *args;
20979             if (!value)
20980                 args = PyTuple_New(0);
20981             else if (PyTuple_Check(value)) {
20982                 Py_INCREF(value);
20983                 args = value;
20984             } else
20985                 args = PyTuple_Pack(1, value);
20986             if (!args)
20987                 goto bad;
20988             owned_instance = PyObject_Call(type, args, NULL);
20989             Py_DECREF(args);
20990             if (!owned_instance)
20991                 goto bad;
20992             value = owned_instance;
20993             if (!PyExceptionInstance_Check(value)) {
20994                 PyErr_Format(PyExc_TypeError,
20995                              "calling %R should have returned an instance of "
20996                              "BaseException, not %R",
20997                              type, Py_TYPE(value));
20998                 goto bad;
20999             }
21000         }
21001     } else {
21002         PyErr_SetString(PyExc_TypeError,
21003             "raise: exception class must be a subclass of BaseException");
21004         goto bad;
21005     }
21006     if (cause) {
21007         PyObject *fixed_cause;
21008         if (cause == Py_None) {
21009             fixed_cause = NULL;
21010         } else if (PyExceptionClass_Check(cause)) {
21011             fixed_cause = PyObject_CallObject(cause, NULL);
21012             if (fixed_cause == NULL)
21013                 goto bad;
21014         } else if (PyExceptionInstance_Check(cause)) {
21015             fixed_cause = cause;
21016             Py_INCREF(fixed_cause);
21017         } else {
21018             PyErr_SetString(PyExc_TypeError,
21019                             "exception causes must derive from "
21020                             "BaseException");
21021             goto bad;
21022         }
21023         PyException_SetCause(value, fixed_cause);
21024     }
21025     PyErr_SetObject(type, value);
21026     if (tb) {
21027 #if CYTHON_COMPILING_IN_PYPY
21028         PyObject *tmp_type, *tmp_value, *tmp_tb;
21029         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21030         Py_INCREF(tb);
21031         PyErr_Restore(tmp_type, tmp_value, tb);
21032         Py_XDECREF(tmp_tb);
21033 #else
21034         PyThreadState *tstate = __Pyx_PyThreadState_Current;
21035         PyObject* tmp_tb = tstate->curexc_traceback;
21036         if (tb != tmp_tb) {
21037             Py_INCREF(tb);
21038             tstate->curexc_traceback = tb;
21039             Py_XDECREF(tmp_tb);
21040         }
21041 #endif
21042     }
21043 bad:
21044     Py_XDECREF(owned_instance);
21045     return;
21046 }
21047 #endif
21048 
21049 /* PyCFunctionFastCall */
21050 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)21051 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21052     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21053     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21054     PyObject *self = PyCFunction_GET_SELF(func);
21055     int flags = PyCFunction_GET_FLAGS(func);
21056     assert(PyCFunction_Check(func));
21057     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
21058     assert(nargs >= 0);
21059     assert(nargs == 0 || args != NULL);
21060     /* _PyCFunction_FastCallDict() must not be called with an exception set,
21061        because it may clear it (directly or indirectly) and so the
21062        caller loses its exception */
21063     assert(!PyErr_Occurred());
21064     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21065         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
21066     } else {
21067         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
21068     }
21069 }
21070 #endif
21071 
21072 /* PyFunctionFastCall */
21073 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)21074 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21075                                                PyObject *globals) {
21076     PyFrameObject *f;
21077     PyThreadState *tstate = __Pyx_PyThreadState_Current;
21078     PyObject **fastlocals;
21079     Py_ssize_t i;
21080     PyObject *result;
21081     assert(globals != NULL);
21082     /* XXX Perhaps we should create a specialized
21083        PyFrame_New() that doesn't take locals, but does
21084        take builtins without sanity checking them.
21085        */
21086     assert(tstate != NULL);
21087     f = PyFrame_New(tstate, co, globals, NULL);
21088     if (f == NULL) {
21089         return NULL;
21090     }
21091     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
21092     for (i = 0; i < na; i++) {
21093         Py_INCREF(*args);
21094         fastlocals[i] = *args++;
21095     }
21096     result = PyEval_EvalFrameEx(f,0);
21097     ++tstate->recursion_depth;
21098     Py_DECREF(f);
21099     --tstate->recursion_depth;
21100     return result;
21101 }
21102 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)21103 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
21104     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21105     PyObject *globals = PyFunction_GET_GLOBALS(func);
21106     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21107     PyObject *closure;
21108 #if PY_MAJOR_VERSION >= 3
21109     PyObject *kwdefs;
21110 #endif
21111     PyObject *kwtuple, **k;
21112     PyObject **d;
21113     Py_ssize_t nd;
21114     Py_ssize_t nk;
21115     PyObject *result;
21116     assert(kwargs == NULL || PyDict_Check(kwargs));
21117     nk = kwargs ? PyDict_Size(kwargs) : 0;
21118     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
21119         return NULL;
21120     }
21121     if (
21122 #if PY_MAJOR_VERSION >= 3
21123             co->co_kwonlyargcount == 0 &&
21124 #endif
21125             likely(kwargs == NULL || nk == 0) &&
21126             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21127         if (argdefs == NULL && co->co_argcount == nargs) {
21128             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21129             goto done;
21130         }
21131         else if (nargs == 0 && argdefs != NULL
21132                  && co->co_argcount == Py_SIZE(argdefs)) {
21133             /* function called with no arguments, but all parameters have
21134                a default value: use default values as arguments .*/
21135             args = &PyTuple_GET_ITEM(argdefs, 0);
21136             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21137             goto done;
21138         }
21139     }
21140     if (kwargs != NULL) {
21141         Py_ssize_t pos, i;
21142         kwtuple = PyTuple_New(2 * nk);
21143         if (kwtuple == NULL) {
21144             result = NULL;
21145             goto done;
21146         }
21147         k = &PyTuple_GET_ITEM(kwtuple, 0);
21148         pos = i = 0;
21149         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
21150             Py_INCREF(k[i]);
21151             Py_INCREF(k[i+1]);
21152             i += 2;
21153         }
21154         nk = i / 2;
21155     }
21156     else {
21157         kwtuple = NULL;
21158         k = NULL;
21159     }
21160     closure = PyFunction_GET_CLOSURE(func);
21161 #if PY_MAJOR_VERSION >= 3
21162     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21163 #endif
21164     if (argdefs != NULL) {
21165         d = &PyTuple_GET_ITEM(argdefs, 0);
21166         nd = Py_SIZE(argdefs);
21167     }
21168     else {
21169         d = NULL;
21170         nd = 0;
21171     }
21172 #if PY_MAJOR_VERSION >= 3
21173     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21174                                args, (int)nargs,
21175                                k, (int)nk,
21176                                d, (int)nd, kwdefs, closure);
21177 #else
21178     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21179                                args, (int)nargs,
21180                                k, (int)nk,
21181                                d, (int)nd, closure);
21182 #endif
21183     Py_XDECREF(kwtuple);
21184 done:
21185     Py_LeaveRecursiveCall();
21186     return result;
21187 }
21188 #endif
21189 #endif
21190 
21191 /* PyObjectCallMethO */
21192 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)21193 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21194     PyObject *self, *result;
21195     PyCFunction cfunc;
21196     cfunc = PyCFunction_GET_FUNCTION(func);
21197     self = PyCFunction_GET_SELF(func);
21198     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
21199         return NULL;
21200     result = cfunc(self, arg);
21201     Py_LeaveRecursiveCall();
21202     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21203         PyErr_SetString(
21204             PyExc_SystemError,
21205             "NULL result without error in PyObject_Call");
21206     }
21207     return result;
21208 }
21209 #endif
21210 
21211 /* PyObjectCallOneArg */
21212 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)21213 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21214     PyObject *result;
21215     PyObject *args = PyTuple_New(1);
21216     if (unlikely(!args)) return NULL;
21217     Py_INCREF(arg);
21218     PyTuple_SET_ITEM(args, 0, arg);
21219     result = __Pyx_PyObject_Call(func, args, NULL);
21220     Py_DECREF(args);
21221     return result;
21222 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)21223 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21224 #if CYTHON_FAST_PYCALL
21225     if (PyFunction_Check(func)) {
21226         return __Pyx_PyFunction_FastCall(func, &arg, 1);
21227     }
21228 #endif
21229     if (likely(PyCFunction_Check(func))) {
21230         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21231             return __Pyx_PyObject_CallMethO(func, arg);
21232 #if CYTHON_FAST_PYCCALL
21233         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
21234             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21235 #endif
21236         }
21237     }
21238     return __Pyx__PyObject_CallOneArg(func, arg);
21239 }
21240 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)21241 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21242     PyObject *result;
21243     PyObject *args = PyTuple_Pack(1, arg);
21244     if (unlikely(!args)) return NULL;
21245     result = __Pyx_PyObject_Call(func, args, NULL);
21246     Py_DECREF(args);
21247     return result;
21248 }
21249 #endif
21250 
21251 /* DictGetItem */
21252 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)21253 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
21254     PyObject *value;
21255     value = PyDict_GetItemWithError(d, key);
21256     if (unlikely(!value)) {
21257         if (!PyErr_Occurred()) {
21258             if (unlikely(PyTuple_Check(key))) {
21259                 PyObject* args = PyTuple_Pack(1, key);
21260                 if (likely(args)) {
21261                     PyErr_SetObject(PyExc_KeyError, args);
21262                     Py_DECREF(args);
21263                 }
21264             } else {
21265                 PyErr_SetObject(PyExc_KeyError, key);
21266             }
21267         }
21268         return NULL;
21269     }
21270     Py_INCREF(value);
21271     return value;
21272 }
21273 #endif
21274 
21275 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)21276 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
21277     PyErr_Format(PyExc_ValueError,
21278                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
21279 }
21280 
21281 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)21282 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
21283     PyErr_Format(PyExc_ValueError,
21284                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
21285                  index, (index == 1) ? "" : "s");
21286 }
21287 
21288 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)21289 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
21290     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21291 }
21292 
21293 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)21294 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
21295     if (unlikely(!type)) {
21296         PyErr_SetString(PyExc_SystemError, "Missing type object");
21297         return 0;
21298     }
21299     if (likely(__Pyx_TypeCheck(obj, type)))
21300         return 1;
21301     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
21302                  Py_TYPE(obj)->tp_name, type->tp_name);
21303     return 0;
21304 }
21305 
21306 /* GetTopmostException */
21307 #if CYTHON_USE_EXC_INFO_STACK
21308 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)21309 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21310 {
21311     _PyErr_StackItem *exc_info = tstate->exc_info;
21312     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
21313            exc_info->previous_item != NULL)
21314     {
21315         exc_info = exc_info->previous_item;
21316     }
21317     return exc_info;
21318 }
21319 #endif
21320 
21321 /* SaveResetException */
21322 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21323 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21324     #if CYTHON_USE_EXC_INFO_STACK
21325     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21326     *type = exc_info->exc_type;
21327     *value = exc_info->exc_value;
21328     *tb = exc_info->exc_traceback;
21329     #else
21330     *type = tstate->exc_type;
21331     *value = tstate->exc_value;
21332     *tb = tstate->exc_traceback;
21333     #endif
21334     Py_XINCREF(*type);
21335     Py_XINCREF(*value);
21336     Py_XINCREF(*tb);
21337 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)21338 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21339     PyObject *tmp_type, *tmp_value, *tmp_tb;
21340     #if CYTHON_USE_EXC_INFO_STACK
21341     _PyErr_StackItem *exc_info = tstate->exc_info;
21342     tmp_type = exc_info->exc_type;
21343     tmp_value = exc_info->exc_value;
21344     tmp_tb = exc_info->exc_traceback;
21345     exc_info->exc_type = type;
21346     exc_info->exc_value = value;
21347     exc_info->exc_traceback = tb;
21348     #else
21349     tmp_type = tstate->exc_type;
21350     tmp_value = tstate->exc_value;
21351     tmp_tb = tstate->exc_traceback;
21352     tstate->exc_type = type;
21353     tstate->exc_value = value;
21354     tstate->exc_traceback = tb;
21355     #endif
21356     Py_XDECREF(tmp_type);
21357     Py_XDECREF(tmp_value);
21358     Py_XDECREF(tmp_tb);
21359 }
21360 #endif
21361 
21362 /* PyErrExceptionMatches */
21363 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)21364 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21365     Py_ssize_t i, n;
21366     n = PyTuple_GET_SIZE(tuple);
21367 #if PY_MAJOR_VERSION >= 3
21368     for (i=0; i<n; i++) {
21369         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21370     }
21371 #endif
21372     for (i=0; i<n; i++) {
21373         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
21374     }
21375     return 0;
21376 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)21377 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21378     PyObject *exc_type = tstate->curexc_type;
21379     if (exc_type == err) return 1;
21380     if (unlikely(!exc_type)) return 0;
21381     if (unlikely(PyTuple_Check(err)))
21382         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21383     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21384 }
21385 #endif
21386 
21387 /* GetException */
21388 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21389 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21390 #else
21391 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21392 #endif
21393 {
21394     PyObject *local_type, *local_value, *local_tb;
21395 #if CYTHON_FAST_THREAD_STATE
21396     PyObject *tmp_type, *tmp_value, *tmp_tb;
21397     local_type = tstate->curexc_type;
21398     local_value = tstate->curexc_value;
21399     local_tb = tstate->curexc_traceback;
21400     tstate->curexc_type = 0;
21401     tstate->curexc_value = 0;
21402     tstate->curexc_traceback = 0;
21403 #else
21404     PyErr_Fetch(&local_type, &local_value, &local_tb);
21405 #endif
21406     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21407 #if CYTHON_FAST_THREAD_STATE
21408     if (unlikely(tstate->curexc_type))
21409 #else
21410     if (unlikely(PyErr_Occurred()))
21411 #endif
21412         goto bad;
21413     #if PY_MAJOR_VERSION >= 3
21414     if (local_tb) {
21415         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21416             goto bad;
21417     }
21418     #endif
21419     Py_XINCREF(local_tb);
21420     Py_XINCREF(local_type);
21421     Py_XINCREF(local_value);
21422     *type = local_type;
21423     *value = local_value;
21424     *tb = local_tb;
21425 #if CYTHON_FAST_THREAD_STATE
21426     #if CYTHON_USE_EXC_INFO_STACK
21427     {
21428         _PyErr_StackItem *exc_info = tstate->exc_info;
21429         tmp_type = exc_info->exc_type;
21430         tmp_value = exc_info->exc_value;
21431         tmp_tb = exc_info->exc_traceback;
21432         exc_info->exc_type = local_type;
21433         exc_info->exc_value = local_value;
21434         exc_info->exc_traceback = local_tb;
21435     }
21436     #else
21437     tmp_type = tstate->exc_type;
21438     tmp_value = tstate->exc_value;
21439     tmp_tb = tstate->exc_traceback;
21440     tstate->exc_type = local_type;
21441     tstate->exc_value = local_value;
21442     tstate->exc_traceback = local_tb;
21443     #endif
21444     Py_XDECREF(tmp_type);
21445     Py_XDECREF(tmp_value);
21446     Py_XDECREF(tmp_tb);
21447 #else
21448     PyErr_SetExcInfo(local_type, local_value, local_tb);
21449 #endif
21450     return 0;
21451 bad:
21452     *type = 0;
21453     *value = 0;
21454     *tb = 0;
21455     Py_XDECREF(local_type);
21456     Py_XDECREF(local_value);
21457     Py_XDECREF(local_tb);
21458     return -1;
21459 }
21460 
21461 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)21462 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
21463     PyObject *args, *result = NULL;
21464     #if CYTHON_FAST_PYCALL
21465     if (PyFunction_Check(function)) {
21466         PyObject *args[2] = {arg1, arg2};
21467         return __Pyx_PyFunction_FastCall(function, args, 2);
21468     }
21469     #endif
21470     #if CYTHON_FAST_PYCCALL
21471     if (__Pyx_PyFastCFunction_Check(function)) {
21472         PyObject *args[2] = {arg1, arg2};
21473         return __Pyx_PyCFunction_FastCall(function, args, 2);
21474     }
21475     #endif
21476     args = PyTuple_New(2);
21477     if (unlikely(!args)) goto done;
21478     Py_INCREF(arg1);
21479     PyTuple_SET_ITEM(args, 0, arg1);
21480     Py_INCREF(arg2);
21481     PyTuple_SET_ITEM(args, 1, arg2);
21482     Py_INCREF(function);
21483     result = __Pyx_PyObject_Call(function, args, NULL);
21484     Py_DECREF(args);
21485     Py_DECREF(function);
21486 done:
21487     return result;
21488 }
21489 
21490 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)21491 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
21492 #if CYTHON_COMPILING_IN_PYPY
21493     return PyObject_RichCompareBool(s1, s2, equals);
21494 #else
21495     if (s1 == s2) {
21496         return (equals == Py_EQ);
21497     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21498         const char *ps1, *ps2;
21499         Py_ssize_t length = PyBytes_GET_SIZE(s1);
21500         if (length != PyBytes_GET_SIZE(s2))
21501             return (equals == Py_NE);
21502         ps1 = PyBytes_AS_STRING(s1);
21503         ps2 = PyBytes_AS_STRING(s2);
21504         if (ps1[0] != ps2[0]) {
21505             return (equals == Py_NE);
21506         } else if (length == 1) {
21507             return (equals == Py_EQ);
21508         } else {
21509             int result;
21510 #if CYTHON_USE_UNICODE_INTERNALS
21511             Py_hash_t hash1, hash2;
21512             hash1 = ((PyBytesObject*)s1)->ob_shash;
21513             hash2 = ((PyBytesObject*)s2)->ob_shash;
21514             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21515                 return (equals == Py_NE);
21516             }
21517 #endif
21518             result = memcmp(ps1, ps2, (size_t)length);
21519             return (equals == Py_EQ) ? (result == 0) : (result != 0);
21520         }
21521     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21522         return (equals == Py_NE);
21523     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21524         return (equals == Py_NE);
21525     } else {
21526         int result;
21527         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21528         if (!py_result)
21529             return -1;
21530         result = __Pyx_PyObject_IsTrue(py_result);
21531         Py_DECREF(py_result);
21532         return result;
21533     }
21534 #endif
21535 }
21536 
21537 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)21538 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
21539 #if CYTHON_COMPILING_IN_PYPY
21540     return PyObject_RichCompareBool(s1, s2, equals);
21541 #else
21542 #if PY_MAJOR_VERSION < 3
21543     PyObject* owned_ref = NULL;
21544 #endif
21545     int s1_is_unicode, s2_is_unicode;
21546     if (s1 == s2) {
21547         goto return_eq;
21548     }
21549     s1_is_unicode = PyUnicode_CheckExact(s1);
21550     s2_is_unicode = PyUnicode_CheckExact(s2);
21551 #if PY_MAJOR_VERSION < 3
21552     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
21553         owned_ref = PyUnicode_FromObject(s2);
21554         if (unlikely(!owned_ref))
21555             return -1;
21556         s2 = owned_ref;
21557         s2_is_unicode = 1;
21558     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
21559         owned_ref = PyUnicode_FromObject(s1);
21560         if (unlikely(!owned_ref))
21561             return -1;
21562         s1 = owned_ref;
21563         s1_is_unicode = 1;
21564     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
21565         return __Pyx_PyBytes_Equals(s1, s2, equals);
21566     }
21567 #endif
21568     if (s1_is_unicode & s2_is_unicode) {
21569         Py_ssize_t length;
21570         int kind;
21571         void *data1, *data2;
21572         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
21573             return -1;
21574         length = __Pyx_PyUnicode_GET_LENGTH(s1);
21575         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
21576             goto return_ne;
21577         }
21578 #if CYTHON_USE_UNICODE_INTERNALS
21579         {
21580             Py_hash_t hash1, hash2;
21581         #if CYTHON_PEP393_ENABLED
21582             hash1 = ((PyASCIIObject*)s1)->hash;
21583             hash2 = ((PyASCIIObject*)s2)->hash;
21584         #else
21585             hash1 = ((PyUnicodeObject*)s1)->hash;
21586             hash2 = ((PyUnicodeObject*)s2)->hash;
21587         #endif
21588             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21589                 goto return_ne;
21590             }
21591         }
21592 #endif
21593         kind = __Pyx_PyUnicode_KIND(s1);
21594         if (kind != __Pyx_PyUnicode_KIND(s2)) {
21595             goto return_ne;
21596         }
21597         data1 = __Pyx_PyUnicode_DATA(s1);
21598         data2 = __Pyx_PyUnicode_DATA(s2);
21599         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
21600             goto return_ne;
21601         } else if (length == 1) {
21602             goto return_eq;
21603         } else {
21604             int result = memcmp(data1, data2, (size_t)(length * kind));
21605             #if PY_MAJOR_VERSION < 3
21606             Py_XDECREF(owned_ref);
21607             #endif
21608             return (equals == Py_EQ) ? (result == 0) : (result != 0);
21609         }
21610     } else if ((s1 == Py_None) & s2_is_unicode) {
21611         goto return_ne;
21612     } else if ((s2 == Py_None) & s1_is_unicode) {
21613         goto return_ne;
21614     } else {
21615         int result;
21616         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21617         #if PY_MAJOR_VERSION < 3
21618         Py_XDECREF(owned_ref);
21619         #endif
21620         if (!py_result)
21621             return -1;
21622         result = __Pyx_PyObject_IsTrue(py_result);
21623         Py_DECREF(py_result);
21624         return result;
21625     }
21626 return_eq:
21627     #if PY_MAJOR_VERSION < 3
21628     Py_XDECREF(owned_ref);
21629     #endif
21630     return (equals == Py_EQ);
21631 return_ne:
21632     #if PY_MAJOR_VERSION < 3
21633     Py_XDECREF(owned_ref);
21634     #endif
21635     return (equals == Py_NE);
21636 #endif
21637 }
21638 
21639 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)21640 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
21641     Py_ssize_t q = a / b;
21642     Py_ssize_t r = a - q*b;
21643     q -= ((r != 0) & ((r ^ b) < 0));
21644     return q;
21645 }
21646 
21647 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)21648 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
21649 #if CYTHON_USE_TYPE_SLOTS
21650 #if PY_MAJOR_VERSION >= 3
21651     if (likely(PyUnicode_Check(n)))
21652 #else
21653     if (likely(PyString_Check(n)))
21654 #endif
21655         return __Pyx_PyObject_GetAttrStr(o, n);
21656 #endif
21657     return PyObject_GetAttr(o, n);
21658 }
21659 
21660 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)21661 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
21662     PyObject *r;
21663     if (!j) return NULL;
21664     r = PyObject_GetItem(o, j);
21665     Py_DECREF(j);
21666     return r;
21667 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)21668 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
21669                                                               CYTHON_NCP_UNUSED int wraparound,
21670                                                               CYTHON_NCP_UNUSED int boundscheck) {
21671 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21672     Py_ssize_t wrapped_i = i;
21673     if (wraparound & unlikely(i < 0)) {
21674         wrapped_i += PyList_GET_SIZE(o);
21675     }
21676     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
21677         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
21678         Py_INCREF(r);
21679         return r;
21680     }
21681     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21682 #else
21683     return PySequence_GetItem(o, i);
21684 #endif
21685 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)21686 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
21687                                                               CYTHON_NCP_UNUSED int wraparound,
21688                                                               CYTHON_NCP_UNUSED int boundscheck) {
21689 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21690     Py_ssize_t wrapped_i = i;
21691     if (wraparound & unlikely(i < 0)) {
21692         wrapped_i += PyTuple_GET_SIZE(o);
21693     }
21694     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
21695         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
21696         Py_INCREF(r);
21697         return r;
21698     }
21699     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21700 #else
21701     return PySequence_GetItem(o, i);
21702 #endif
21703 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)21704 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
21705                                                      CYTHON_NCP_UNUSED int wraparound,
21706                                                      CYTHON_NCP_UNUSED int boundscheck) {
21707 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
21708     if (is_list || PyList_CheckExact(o)) {
21709         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
21710         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
21711             PyObject *r = PyList_GET_ITEM(o, n);
21712             Py_INCREF(r);
21713             return r;
21714         }
21715     }
21716     else if (PyTuple_CheckExact(o)) {
21717         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
21718         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
21719             PyObject *r = PyTuple_GET_ITEM(o, n);
21720             Py_INCREF(r);
21721             return r;
21722         }
21723     } else {
21724         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21725         if (likely(m && m->sq_item)) {
21726             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
21727                 Py_ssize_t l = m->sq_length(o);
21728                 if (likely(l >= 0)) {
21729                     i += l;
21730                 } else {
21731                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21732                         return NULL;
21733                     PyErr_Clear();
21734                 }
21735             }
21736             return m->sq_item(o, i);
21737         }
21738     }
21739 #else
21740     if (is_list || PySequence_Check(o)) {
21741         return PySequence_GetItem(o, i);
21742     }
21743 #endif
21744     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21745 }
21746 
21747 /* ObjectGetItem */
21748 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)21749 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
21750     PyObject *runerr;
21751     Py_ssize_t key_value;
21752     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
21753     if (unlikely(!(m && m->sq_item))) {
21754         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
21755         return NULL;
21756     }
21757     key_value = __Pyx_PyIndex_AsSsize_t(index);
21758     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
21759         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
21760     }
21761     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
21762         PyErr_Clear();
21763         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
21764     }
21765     return NULL;
21766 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)21767 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
21768     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
21769     if (likely(m && m->mp_subscript)) {
21770         return m->mp_subscript(obj, key);
21771     }
21772     return __Pyx_PyObject_GetIndex(obj, key);
21773 }
21774 #endif
21775 
21776 /* 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))21777 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
21778          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
21779          const char* encoding, const char* errors,
21780          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
21781     Py_ssize_t length;
21782     if (unlikely((start < 0) | (stop < 0))) {
21783         size_t slen = strlen(cstring);
21784         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
21785             PyErr_SetString(PyExc_OverflowError,
21786                             "c-string too long to convert to Python");
21787             return NULL;
21788         }
21789         length = (Py_ssize_t) slen;
21790         if (start < 0) {
21791             start += length;
21792             if (start < 0)
21793                 start = 0;
21794         }
21795         if (stop < 0)
21796             stop += length;
21797     }
21798     length = stop - start;
21799     if (unlikely(length <= 0))
21800         return PyUnicode_FromUnicode(NULL, 0);
21801     cstring += start;
21802     if (decode_func) {
21803         return decode_func(cstring, length, errors);
21804     } else {
21805         return PyUnicode_Decode(cstring, length, encoding, errors);
21806     }
21807 }
21808 
21809 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)21810 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
21811     __Pyx_PyThreadState_declare
21812     __Pyx_PyThreadState_assign
21813     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
21814         return NULL;
21815     __Pyx_PyErr_Clear();
21816     Py_INCREF(d);
21817     return d;
21818 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)21819 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
21820     PyObject *r = __Pyx_GetAttr(o, n);
21821     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
21822 }
21823 
21824 /* PyDictVersioning */
21825 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)21826 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
21827     PyObject *dict = Py_TYPE(obj)->tp_dict;
21828     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21829 }
__Pyx_get_object_dict_version(PyObject * obj)21830 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
21831     PyObject **dictptr = NULL;
21832     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
21833     if (offset) {
21834 #if CYTHON_COMPILING_IN_CPYTHON
21835         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
21836 #else
21837         dictptr = _PyObject_GetDictPtr(obj);
21838 #endif
21839     }
21840     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21841 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)21842 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21843     PyObject *dict = Py_TYPE(obj)->tp_dict;
21844     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21845         return 0;
21846     return obj_dict_version == __Pyx_get_object_dict_version(obj);
21847 }
21848 #endif
21849 
21850 /* GetModuleGlobalName */
21851 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)21852 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21853 #else
21854 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21855 #endif
21856 {
21857     PyObject *result;
21858 #if !CYTHON_AVOID_BORROWED_REFS
21859 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21860     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21861     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21862     if (likely(result)) {
21863         return __Pyx_NewRef(result);
21864     } else if (unlikely(PyErr_Occurred())) {
21865         return NULL;
21866     }
21867 #else
21868     result = PyDict_GetItem(__pyx_d, name);
21869     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21870     if (likely(result)) {
21871         return __Pyx_NewRef(result);
21872     }
21873 #endif
21874 #else
21875     result = PyObject_GetItem(__pyx_d, name);
21876     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21877     if (likely(result)) {
21878         return __Pyx_NewRef(result);
21879     }
21880     PyErr_Clear();
21881 #endif
21882     return __Pyx_GetBuiltinName(name);
21883 }
21884 
21885 /* SwapException */
21886 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)21887 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21888     PyObject *tmp_type, *tmp_value, *tmp_tb;
21889     #if CYTHON_USE_EXC_INFO_STACK
21890     _PyErr_StackItem *exc_info = tstate->exc_info;
21891     tmp_type = exc_info->exc_type;
21892     tmp_value = exc_info->exc_value;
21893     tmp_tb = exc_info->exc_traceback;
21894     exc_info->exc_type = *type;
21895     exc_info->exc_value = *value;
21896     exc_info->exc_traceback = *tb;
21897     #else
21898     tmp_type = tstate->exc_type;
21899     tmp_value = tstate->exc_value;
21900     tmp_tb = tstate->exc_traceback;
21901     tstate->exc_type = *type;
21902     tstate->exc_value = *value;
21903     tstate->exc_traceback = *tb;
21904     #endif
21905     *type = tmp_type;
21906     *value = tmp_value;
21907     *tb = tmp_tb;
21908 }
21909 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)21910 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
21911     PyObject *tmp_type, *tmp_value, *tmp_tb;
21912     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
21913     PyErr_SetExcInfo(*type, *value, *tb);
21914     *type = tmp_type;
21915     *value = tmp_value;
21916     *tb = tmp_tb;
21917 }
21918 #endif
21919 
21920 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)21921 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
21922     PyObject *empty_list = 0;
21923     PyObject *module = 0;
21924     PyObject *global_dict = 0;
21925     PyObject *empty_dict = 0;
21926     PyObject *list;
21927     #if PY_MAJOR_VERSION < 3
21928     PyObject *py_import;
21929     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21930     if (!py_import)
21931         goto bad;
21932     #endif
21933     if (from_list)
21934         list = from_list;
21935     else {
21936         empty_list = PyList_New(0);
21937         if (!empty_list)
21938             goto bad;
21939         list = empty_list;
21940     }
21941     global_dict = PyModule_GetDict(__pyx_m);
21942     if (!global_dict)
21943         goto bad;
21944     empty_dict = PyDict_New();
21945     if (!empty_dict)
21946         goto bad;
21947     {
21948         #if PY_MAJOR_VERSION >= 3
21949         if (level == -1) {
21950             if (strchr(__Pyx_MODULE_NAME, '.')) {
21951                 module = PyImport_ImportModuleLevelObject(
21952                     name, global_dict, empty_dict, list, 1);
21953                 if (!module) {
21954                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
21955                         goto bad;
21956                     PyErr_Clear();
21957                 }
21958             }
21959             level = 0;
21960         }
21961         #endif
21962         if (!module) {
21963             #if PY_MAJOR_VERSION < 3
21964             PyObject *py_level = PyInt_FromLong(level);
21965             if (!py_level)
21966                 goto bad;
21967             module = PyObject_CallFunctionObjArgs(py_import,
21968                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
21969             Py_DECREF(py_level);
21970             #else
21971             module = PyImport_ImportModuleLevelObject(
21972                 name, global_dict, empty_dict, list, level);
21973             #endif
21974         }
21975     }
21976 bad:
21977     #if PY_MAJOR_VERSION < 3
21978     Py_XDECREF(py_import);
21979     #endif
21980     Py_XDECREF(empty_list);
21981     Py_XDECREF(empty_dict);
21982     return module;
21983 }
21984 
21985 /* FastTypeChecks */
21986 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)21987 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
21988     while (a) {
21989         a = a->tp_base;
21990         if (a == b)
21991             return 1;
21992     }
21993     return b == &PyBaseObject_Type;
21994 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)21995 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
21996     PyObject *mro;
21997     if (a == b) return 1;
21998     mro = a->tp_mro;
21999     if (likely(mro)) {
22000         Py_ssize_t i, n;
22001         n = PyTuple_GET_SIZE(mro);
22002         for (i = 0; i < n; i++) {
22003             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
22004                 return 1;
22005         }
22006         return 0;
22007     }
22008     return __Pyx_InBases(a, b);
22009 }
22010 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22011 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22012     PyObject *exception, *value, *tb;
22013     int res;
22014     __Pyx_PyThreadState_declare
22015     __Pyx_PyThreadState_assign
22016     __Pyx_ErrFetch(&exception, &value, &tb);
22017     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22018     if (unlikely(res == -1)) {
22019         PyErr_WriteUnraisable(err);
22020         res = 0;
22021     }
22022     if (!res) {
22023         res = PyObject_IsSubclass(err, exc_type2);
22024         if (unlikely(res == -1)) {
22025             PyErr_WriteUnraisable(err);
22026             res = 0;
22027         }
22028     }
22029     __Pyx_ErrRestore(exception, value, tb);
22030     return res;
22031 }
22032 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22033 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22034     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22035     if (!res) {
22036         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22037     }
22038     return res;
22039 }
22040 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)22041 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22042     Py_ssize_t i, n;
22043     assert(PyExceptionClass_Check(exc_type));
22044     n = PyTuple_GET_SIZE(tuple);
22045 #if PY_MAJOR_VERSION >= 3
22046     for (i=0; i<n; i++) {
22047         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22048     }
22049 #endif
22050     for (i=0; i<n; i++) {
22051         PyObject *t = PyTuple_GET_ITEM(tuple, i);
22052         #if PY_MAJOR_VERSION < 3
22053         if (likely(exc_type == t)) return 1;
22054         #endif
22055         if (likely(PyExceptionClass_Check(t))) {
22056             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
22057         } else {
22058         }
22059     }
22060     return 0;
22061 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)22062 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22063     if (likely(err == exc_type)) return 1;
22064     if (likely(PyExceptionClass_Check(err))) {
22065         if (likely(PyExceptionClass_Check(exc_type))) {
22066             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22067         } else if (likely(PyTuple_Check(exc_type))) {
22068             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22069         } else {
22070         }
22071     }
22072     return PyErr_GivenExceptionMatches(err, exc_type);
22073 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22074 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22075     assert(PyExceptionClass_Check(exc_type1));
22076     assert(PyExceptionClass_Check(exc_type2));
22077     if (likely(err == exc_type1 || err == exc_type2)) return 1;
22078     if (likely(PyExceptionClass_Check(err))) {
22079         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22080     }
22081     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22082 }
22083 #endif
22084 
22085 /* PyIntBinop */
22086 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)22087 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
22088     (void)inplace;
22089     (void)zerodivision_check;
22090     #if PY_MAJOR_VERSION < 3
22091     if (likely(PyInt_CheckExact(op1))) {
22092         const long b = intval;
22093         long x;
22094         long a = PyInt_AS_LONG(op1);
22095             x = (long)((unsigned long)a + b);
22096             if (likely((x^a) >= 0 || (x^b) >= 0))
22097                 return PyInt_FromLong(x);
22098             return PyLong_Type.tp_as_number->nb_add(op1, op2);
22099     }
22100     #endif
22101     #if CYTHON_USE_PYLONG_INTERNALS
22102     if (likely(PyLong_CheckExact(op1))) {
22103         const long b = intval;
22104         long a, x;
22105 #ifdef HAVE_LONG_LONG
22106         const PY_LONG_LONG llb = intval;
22107         PY_LONG_LONG lla, llx;
22108 #endif
22109         const digit* digits = ((PyLongObject*)op1)->ob_digit;
22110         const Py_ssize_t size = Py_SIZE(op1);
22111         if (likely(__Pyx_sst_abs(size) <= 1)) {
22112             a = likely(size) ? digits[0] : 0;
22113             if (size == -1) a = -a;
22114         } else {
22115             switch (size) {
22116                 case -2:
22117                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22118                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22119                         break;
22120 #ifdef HAVE_LONG_LONG
22121                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22122                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22123                         goto long_long;
22124 #endif
22125                     }
22126                     CYTHON_FALLTHROUGH;
22127                 case 2:
22128                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22129                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22130                         break;
22131 #ifdef HAVE_LONG_LONG
22132                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22133                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
22134                         goto long_long;
22135 #endif
22136                     }
22137                     CYTHON_FALLTHROUGH;
22138                 case -3:
22139                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22140                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22141                         break;
22142 #ifdef HAVE_LONG_LONG
22143                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22144                         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]));
22145                         goto long_long;
22146 #endif
22147                     }
22148                     CYTHON_FALLTHROUGH;
22149                 case 3:
22150                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22151                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22152                         break;
22153 #ifdef HAVE_LONG_LONG
22154                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22155                         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]));
22156                         goto long_long;
22157 #endif
22158                     }
22159                     CYTHON_FALLTHROUGH;
22160                 case -4:
22161                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22162                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22163                         break;
22164 #ifdef HAVE_LONG_LONG
22165                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22166                         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]));
22167                         goto long_long;
22168 #endif
22169                     }
22170                     CYTHON_FALLTHROUGH;
22171                 case 4:
22172                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22173                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
22174                         break;
22175 #ifdef HAVE_LONG_LONG
22176                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22177                         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]));
22178                         goto long_long;
22179 #endif
22180                     }
22181                     CYTHON_FALLTHROUGH;
22182                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
22183             }
22184         }
22185                 x = a + b;
22186             return PyLong_FromLong(x);
22187 #ifdef HAVE_LONG_LONG
22188         long_long:
22189                 llx = lla + llb;
22190             return PyLong_FromLongLong(llx);
22191 #endif
22192 
22193 
22194     }
22195     #endif
22196     if (PyFloat_CheckExact(op1)) {
22197         const long b = intval;
22198         double a = PyFloat_AS_DOUBLE(op1);
22199             double result;
22200             PyFPE_START_PROTECT("add", return NULL)
22201             result = ((double)a) + (double)b;
22202             PyFPE_END_PROTECT(result)
22203             return PyFloat_FromDouble(result);
22204     }
22205     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
22206 }
22207 #endif
22208 
22209 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)22210 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
22211     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
22212 }
22213 
22214 /* None */
__Pyx_div_long(long a,long b)22215 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
22216     long q = a / b;
22217     long r = a - q*b;
22218     q -= ((r != 0) & ((r ^ b) < 0));
22219     return q;
22220 }
22221 
22222 /* 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)22223 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
22224                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
22225                                   int full_traceback, CYTHON_UNUSED int nogil) {
22226     PyObject *old_exc, *old_val, *old_tb;
22227     PyObject *ctx;
22228     __Pyx_PyThreadState_declare
22229 #ifdef WITH_THREAD
22230     PyGILState_STATE state;
22231     if (nogil)
22232         state = PyGILState_Ensure();
22233 #ifdef _MSC_VER
22234     else state = (PyGILState_STATE)-1;
22235 #endif
22236 #endif
22237     __Pyx_PyThreadState_assign
22238     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
22239     if (full_traceback) {
22240         Py_XINCREF(old_exc);
22241         Py_XINCREF(old_val);
22242         Py_XINCREF(old_tb);
22243         __Pyx_ErrRestore(old_exc, old_val, old_tb);
22244         PyErr_PrintEx(1);
22245     }
22246     #if PY_MAJOR_VERSION < 3
22247     ctx = PyString_FromString(name);
22248     #else
22249     ctx = PyUnicode_FromString(name);
22250     #endif
22251     __Pyx_ErrRestore(old_exc, old_val, old_tb);
22252     if (!ctx) {
22253         PyErr_WriteUnraisable(Py_None);
22254     } else {
22255         PyErr_WriteUnraisable(ctx);
22256         Py_DECREF(ctx);
22257     }
22258 #ifdef WITH_THREAD
22259     if (nogil)
22260         PyGILState_Release(state);
22261 #endif
22262 }
22263 
22264 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)22265 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
22266     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
22267     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22268         PyErr_Format(PyExc_ImportError,
22269         #if PY_MAJOR_VERSION < 3
22270             "cannot import name %.230s", PyString_AS_STRING(name));
22271         #else
22272             "cannot import name %S", name);
22273         #endif
22274     }
22275     return value;
22276 }
22277 
22278 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)22279 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
22280     PyObject *r;
22281     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
22282         PyErr_SetString(PyExc_TypeError,
22283                         "hasattr(): attribute name must be string");
22284         return -1;
22285     }
22286     r = __Pyx_GetAttr(o, n);
22287     if (unlikely(!r)) {
22288         PyErr_Clear();
22289         return 0;
22290     } else {
22291         Py_DECREF(r);
22292         return 1;
22293     }
22294 }
22295 
22296 /* PyObject_GenericGetAttrNoDict */
22297 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)22298 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
22299     PyErr_Format(PyExc_AttributeError,
22300 #if PY_MAJOR_VERSION >= 3
22301                  "'%.50s' object has no attribute '%U'",
22302                  tp->tp_name, attr_name);
22303 #else
22304                  "'%.50s' object has no attribute '%.400s'",
22305                  tp->tp_name, PyString_AS_STRING(attr_name));
22306 #endif
22307     return NULL;
22308 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)22309 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
22310     PyObject *descr;
22311     PyTypeObject *tp = Py_TYPE(obj);
22312     if (unlikely(!PyString_Check(attr_name))) {
22313         return PyObject_GenericGetAttr(obj, attr_name);
22314     }
22315     assert(!tp->tp_dictoffset);
22316     descr = _PyType_Lookup(tp, attr_name);
22317     if (unlikely(!descr)) {
22318         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
22319     }
22320     Py_INCREF(descr);
22321     #if PY_MAJOR_VERSION < 3
22322     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
22323     #endif
22324     {
22325         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
22326         if (unlikely(f)) {
22327             PyObject *res = f(descr, obj, (PyObject *)tp);
22328             Py_DECREF(descr);
22329             return res;
22330         }
22331     }
22332     return descr;
22333 }
22334 #endif
22335 
22336 /* PyObject_GenericGetAttr */
22337 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)22338 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
22339     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
22340         return PyObject_GenericGetAttr(obj, attr_name);
22341     }
22342     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
22343 }
22344 #endif
22345 
22346 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)22347 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
22348   int ret;
22349   PyObject *name_attr;
22350   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
22351   if (likely(name_attr)) {
22352       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
22353   } else {
22354       ret = -1;
22355   }
22356   if (unlikely(ret < 0)) {
22357       PyErr_Clear();
22358       ret = 0;
22359   }
22360   Py_XDECREF(name_attr);
22361   return ret;
22362 }
__Pyx_setup_reduce(PyObject * type_obj)22363 static int __Pyx_setup_reduce(PyObject* type_obj) {
22364     int ret = 0;
22365     PyObject *object_reduce = NULL;
22366     PyObject *object_reduce_ex = NULL;
22367     PyObject *reduce = NULL;
22368     PyObject *reduce_ex = NULL;
22369     PyObject *reduce_cython = NULL;
22370     PyObject *setstate = NULL;
22371     PyObject *setstate_cython = NULL;
22372 #if CYTHON_USE_PYTYPE_LOOKUP
22373     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
22374 #else
22375     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
22376 #endif
22377 #if CYTHON_USE_PYTYPE_LOOKUP
22378     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
22379 #else
22380     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
22381 #endif
22382     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
22383     if (reduce_ex == object_reduce_ex) {
22384 #if CYTHON_USE_PYTYPE_LOOKUP
22385         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
22386 #else
22387         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
22388 #endif
22389         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
22390         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22391             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
22392             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
22393             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
22394             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22395             if (!setstate) PyErr_Clear();
22396             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22397                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
22398                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
22399                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
22400             }
22401             PyType_Modified((PyTypeObject*)type_obj);
22402         }
22403     }
22404     goto GOOD;
22405 BAD:
22406     if (!PyErr_Occurred())
22407         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22408     ret = -1;
22409 GOOD:
22410 #if !CYTHON_USE_PYTYPE_LOOKUP
22411     Py_XDECREF(object_reduce);
22412     Py_XDECREF(object_reduce_ex);
22413 #endif
22414     Py_XDECREF(reduce);
22415     Py_XDECREF(reduce_ex);
22416     Py_XDECREF(reduce_cython);
22417     Py_XDECREF(setstate);
22418     Py_XDECREF(setstate_cython);
22419     return ret;
22420 }
22421 
22422 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)22423 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
22424 #if PY_VERSION_HEX >= 0x02070000
22425     PyObject *ob = PyCapsule_New(vtable, 0, 0);
22426 #else
22427     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22428 #endif
22429     if (!ob)
22430         goto bad;
22431     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22432         goto bad;
22433     Py_DECREF(ob);
22434     return 0;
22435 bad:
22436     Py_XDECREF(ob);
22437     return -1;
22438 }
22439 
22440 /* TypeImport */
22441 #ifndef __PYX_HAVE_RT_ImportType
22442 #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)22443 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
22444     size_t size, enum __Pyx_ImportType_CheckSize check_size)
22445 {
22446     PyObject *result = 0;
22447     char warning[200];
22448     Py_ssize_t basicsize;
22449 #ifdef Py_LIMITED_API
22450     PyObject *py_basicsize;
22451 #endif
22452     result = PyObject_GetAttrString(module, class_name);
22453     if (!result)
22454         goto bad;
22455     if (!PyType_Check(result)) {
22456         PyErr_Format(PyExc_TypeError,
22457             "%.200s.%.200s is not a type object",
22458             module_name, class_name);
22459         goto bad;
22460     }
22461 #ifndef Py_LIMITED_API
22462     basicsize = ((PyTypeObject *)result)->tp_basicsize;
22463 #else
22464     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
22465     if (!py_basicsize)
22466         goto bad;
22467     basicsize = PyLong_AsSsize_t(py_basicsize);
22468     Py_DECREF(py_basicsize);
22469     py_basicsize = 0;
22470     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
22471         goto bad;
22472 #endif
22473     if ((size_t)basicsize < size) {
22474         PyErr_Format(PyExc_ValueError,
22475             "%.200s.%.200s size changed, may indicate binary incompatibility. "
22476             "Expected %zd from C header, got %zd from PyObject",
22477             module_name, class_name, size, basicsize);
22478         goto bad;
22479     }
22480     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
22481         PyErr_Format(PyExc_ValueError,
22482             "%.200s.%.200s size changed, may indicate binary incompatibility. "
22483             "Expected %zd from C header, got %zd from PyObject",
22484             module_name, class_name, size, basicsize);
22485         goto bad;
22486     }
22487     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
22488         PyOS_snprintf(warning, sizeof(warning),
22489             "%s.%s size changed, may indicate binary incompatibility. "
22490             "Expected %zd from C header, got %zd from PyObject",
22491             module_name, class_name, size, basicsize);
22492         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
22493     }
22494     return (PyTypeObject *)result;
22495 bad:
22496     Py_XDECREF(result);
22497     return NULL;
22498 }
22499 #endif
22500 
22501 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)22502 static void* __Pyx_GetVtable(PyObject *dict) {
22503     void* ptr;
22504     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
22505     if (!ob)
22506         goto bad;
22507 #if PY_VERSION_HEX >= 0x02070000
22508     ptr = PyCapsule_GetPointer(ob, 0);
22509 #else
22510     ptr = PyCObject_AsVoidPtr(ob);
22511 #endif
22512     if (!ptr && !PyErr_Occurred())
22513         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
22514     Py_DECREF(ob);
22515     return ptr;
22516 bad:
22517     Py_XDECREF(ob);
22518     return NULL;
22519 }
22520 
22521 /* CLineInTraceback */
22522 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)22523 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
22524     PyObject *use_cline;
22525     PyObject *ptype, *pvalue, *ptraceback;
22526 #if CYTHON_COMPILING_IN_CPYTHON
22527     PyObject **cython_runtime_dict;
22528 #endif
22529     if (unlikely(!__pyx_cython_runtime)) {
22530         return c_line;
22531     }
22532     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22533 #if CYTHON_COMPILING_IN_CPYTHON
22534     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22535     if (likely(cython_runtime_dict)) {
22536         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22537             use_cline, *cython_runtime_dict,
22538             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22539     } else
22540 #endif
22541     {
22542       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22543       if (use_cline_obj) {
22544         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22545         Py_DECREF(use_cline_obj);
22546       } else {
22547         PyErr_Clear();
22548         use_cline = NULL;
22549       }
22550     }
22551     if (!use_cline) {
22552         c_line = 0;
22553         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22554     }
22555     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
22556         c_line = 0;
22557     }
22558     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22559     return c_line;
22560 }
22561 #endif
22562 
22563 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)22564 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
22565     int start = 0, mid = 0, end = count - 1;
22566     if (end >= 0 && code_line > entries[end].code_line) {
22567         return count;
22568     }
22569     while (start < end) {
22570         mid = start + (end - start) / 2;
22571         if (code_line < entries[mid].code_line) {
22572             end = mid;
22573         } else if (code_line > entries[mid].code_line) {
22574              start = mid + 1;
22575         } else {
22576             return mid;
22577         }
22578     }
22579     if (code_line <= entries[mid].code_line) {
22580         return mid;
22581     } else {
22582         return mid + 1;
22583     }
22584 }
__pyx_find_code_object(int code_line)22585 static PyCodeObject *__pyx_find_code_object(int code_line) {
22586     PyCodeObject* code_object;
22587     int pos;
22588     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22589         return NULL;
22590     }
22591     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22592     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22593         return NULL;
22594     }
22595     code_object = __pyx_code_cache.entries[pos].code_object;
22596     Py_INCREF(code_object);
22597     return code_object;
22598 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)22599 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
22600     int pos, i;
22601     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22602     if (unlikely(!code_line)) {
22603         return;
22604     }
22605     if (unlikely(!entries)) {
22606         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
22607         if (likely(entries)) {
22608             __pyx_code_cache.entries = entries;
22609             __pyx_code_cache.max_count = 64;
22610             __pyx_code_cache.count = 1;
22611             entries[0].code_line = code_line;
22612             entries[0].code_object = code_object;
22613             Py_INCREF(code_object);
22614         }
22615         return;
22616     }
22617     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22618     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22619         PyCodeObject* tmp = entries[pos].code_object;
22620         entries[pos].code_object = code_object;
22621         Py_DECREF(tmp);
22622         return;
22623     }
22624     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22625         int new_max = __pyx_code_cache.max_count + 64;
22626         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22627             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
22628         if (unlikely(!entries)) {
22629             return;
22630         }
22631         __pyx_code_cache.entries = entries;
22632         __pyx_code_cache.max_count = new_max;
22633     }
22634     for (i=__pyx_code_cache.count; i>pos; i--) {
22635         entries[i] = entries[i-1];
22636     }
22637     entries[pos].code_line = code_line;
22638     entries[pos].code_object = code_object;
22639     __pyx_code_cache.count++;
22640     Py_INCREF(code_object);
22641 }
22642 
22643 /* AddTraceback */
22644 #include "compile.h"
22645 #include "frameobject.h"
22646 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)22647 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22648             const char *funcname, int c_line,
22649             int py_line, const char *filename) {
22650     PyCodeObject *py_code = 0;
22651     PyObject *py_srcfile = 0;
22652     PyObject *py_funcname = 0;
22653     #if PY_MAJOR_VERSION < 3
22654     py_srcfile = PyString_FromString(filename);
22655     #else
22656     py_srcfile = PyUnicode_FromString(filename);
22657     #endif
22658     if (!py_srcfile) goto bad;
22659     if (c_line) {
22660         #if PY_MAJOR_VERSION < 3
22661         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22662         #else
22663         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22664         #endif
22665     }
22666     else {
22667         #if PY_MAJOR_VERSION < 3
22668         py_funcname = PyString_FromString(funcname);
22669         #else
22670         py_funcname = PyUnicode_FromString(funcname);
22671         #endif
22672     }
22673     if (!py_funcname) goto bad;
22674     py_code = __Pyx_PyCode_New(
22675         0,
22676         0,
22677         0,
22678         0,
22679         0,
22680         __pyx_empty_bytes, /*PyObject *code,*/
22681         __pyx_empty_tuple, /*PyObject *consts,*/
22682         __pyx_empty_tuple, /*PyObject *names,*/
22683         __pyx_empty_tuple, /*PyObject *varnames,*/
22684         __pyx_empty_tuple, /*PyObject *freevars,*/
22685         __pyx_empty_tuple, /*PyObject *cellvars,*/
22686         py_srcfile,   /*PyObject *filename,*/
22687         py_funcname,  /*PyObject *name,*/
22688         py_line,
22689         __pyx_empty_bytes  /*PyObject *lnotab*/
22690     );
22691     Py_DECREF(py_srcfile);
22692     Py_DECREF(py_funcname);
22693     return py_code;
22694 bad:
22695     Py_XDECREF(py_srcfile);
22696     Py_XDECREF(py_funcname);
22697     return NULL;
22698 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)22699 static void __Pyx_AddTraceback(const char *funcname, int c_line,
22700                                int py_line, const char *filename) {
22701     PyCodeObject *py_code = 0;
22702     PyFrameObject *py_frame = 0;
22703     PyThreadState *tstate = __Pyx_PyThreadState_Current;
22704     if (c_line) {
22705         c_line = __Pyx_CLineForTraceback(tstate, c_line);
22706     }
22707     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22708     if (!py_code) {
22709         py_code = __Pyx_CreateCodeObjectForTraceback(
22710             funcname, c_line, py_line, filename);
22711         if (!py_code) goto bad;
22712         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22713     }
22714     py_frame = PyFrame_New(
22715         tstate,            /*PyThreadState *tstate,*/
22716         py_code,           /*PyCodeObject *code,*/
22717         __pyx_d,    /*PyObject *globals,*/
22718         0                  /*PyObject *locals*/
22719     );
22720     if (!py_frame) goto bad;
22721     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22722     PyTraceBack_Here(py_frame);
22723 bad:
22724     Py_XDECREF(py_code);
22725     Py_XDECREF(py_frame);
22726 }
22727 
22728 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)22729 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
22730     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
22731         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
22732         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
22733         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
22734     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
22735     return -1;
22736 }
__Pyx_ReleaseBuffer(Py_buffer * view)22737 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
22738     PyObject *obj = view->obj;
22739     if (!obj) return;
22740     if (PyObject_CheckBuffer(obj)) {
22741         PyBuffer_Release(view);
22742         return;
22743     }
22744     if ((0)) {}
22745         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
22746     view->obj = NULL;
22747     Py_DECREF(obj);
22748 }
22749 #endif
22750 
22751 
22752 /* MemviewSliceIsContig */
22753 static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)22754 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
22755 {
22756     int i, index, step, start;
22757     Py_ssize_t itemsize = mvs.memview->view.itemsize;
22758     if (order == 'F') {
22759         step = 1;
22760         start = 0;
22761     } else {
22762         step = -1;
22763         start = ndim - 1;
22764     }
22765     for (i = 0; i < ndim; i++) {
22766         index = start + step * i;
22767         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
22768             return 0;
22769         itemsize *= mvs.shape[index];
22770     }
22771     return 1;
22772 }
22773 
22774 /* OverlappingSlices */
22775 static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)22776 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
22777                                void **out_start, void **out_end,
22778                                int ndim, size_t itemsize)
22779 {
22780     char *start, *end;
22781     int i;
22782     start = end = slice->data;
22783     for (i = 0; i < ndim; i++) {
22784         Py_ssize_t stride = slice->strides[i];
22785         Py_ssize_t extent = slice->shape[i];
22786         if (extent == 0) {
22787             *out_start = *out_end = start;
22788             return;
22789         } else {
22790             if (stride > 0)
22791                 end += stride * (extent - 1);
22792             else
22793                 start += stride * (extent - 1);
22794         }
22795     }
22796     *out_start = start;
22797     *out_end = end + itemsize;
22798 }
22799 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)22800 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
22801                      __Pyx_memviewslice *slice2,
22802                      int ndim, size_t itemsize)
22803 {
22804     void *start1, *end1, *start2, *end2;
22805     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
22806     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
22807     return (start1 < end2) && (start2 < end1);
22808 }
22809 
22810 /* Capsule */
22811 static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)22812 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
22813 {
22814     PyObject *cobj;
22815 #if PY_VERSION_HEX >= 0x02070000
22816     cobj = PyCapsule_New(p, sig, NULL);
22817 #else
22818     cobj = PyCObject_FromVoidPtr(p, NULL);
22819 #endif
22820     return cobj;
22821 }
22822 
22823 /* CIntFromPyVerify */
22824 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
22825     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
22826 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
22827     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
22828 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
22829     {\
22830         func_type value = func_value;\
22831         if (sizeof(target_type) < sizeof(func_type)) {\
22832             if (unlikely(value != (func_type) (target_type) value)) {\
22833                 func_type zero = 0;\
22834                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
22835                     return (target_type) -1;\
22836                 if (is_unsigned && unlikely(value < zero))\
22837                     goto raise_neg_overflow;\
22838                 else\
22839                     goto raise_overflow;\
22840             }\
22841         }\
22842         return (target_type) value;\
22843     }
22844 
22845 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)22846 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
22847 {
22848   union {
22849     uint32_t u32;
22850     uint8_t u8[4];
22851   } S;
22852   S.u32 = 0x01020304;
22853   return S.u8[0] == 4;
22854 }
22855 
22856 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)22857 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
22858                               __Pyx_BufFmt_StackElem* stack,
22859                               __Pyx_TypeInfo* type) {
22860   stack[0].field = &ctx->root;
22861   stack[0].parent_offset = 0;
22862   ctx->root.type = type;
22863   ctx->root.name = "buffer dtype";
22864   ctx->root.offset = 0;
22865   ctx->head = stack;
22866   ctx->head->field = &ctx->root;
22867   ctx->fmt_offset = 0;
22868   ctx->head->parent_offset = 0;
22869   ctx->new_packmode = '@';
22870   ctx->enc_packmode = '@';
22871   ctx->new_count = 1;
22872   ctx->enc_count = 0;
22873   ctx->enc_type = 0;
22874   ctx->is_complex = 0;
22875   ctx->is_valid_array = 0;
22876   ctx->struct_alignment = 0;
22877   while (type->typegroup == 'S') {
22878     ++ctx->head;
22879     ctx->head->field = type->fields;
22880     ctx->head->parent_offset = 0;
22881     type = type->fields->type;
22882   }
22883 }
__Pyx_BufFmt_ParseNumber(const char ** ts)22884 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
22885     int count;
22886     const char* t = *ts;
22887     if (*t < '0' || *t > '9') {
22888       return -1;
22889     } else {
22890         count = *t++ - '0';
22891         while (*t >= '0' && *t <= '9') {
22892             count *= 10;
22893             count += *t++ - '0';
22894         }
22895     }
22896     *ts = t;
22897     return count;
22898 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)22899 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
22900     int number = __Pyx_BufFmt_ParseNumber(ts);
22901     if (number == -1)
22902         PyErr_Format(PyExc_ValueError,\
22903                      "Does not understand character buffer dtype format string ('%c')", **ts);
22904     return number;
22905 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)22906 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
22907   PyErr_Format(PyExc_ValueError,
22908                "Unexpected format string character: '%c'", ch);
22909 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)22910 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
22911   switch (ch) {
22912     case 'c': return "'char'";
22913     case 'b': return "'signed char'";
22914     case 'B': return "'unsigned char'";
22915     case 'h': return "'short'";
22916     case 'H': return "'unsigned short'";
22917     case 'i': return "'int'";
22918     case 'I': return "'unsigned int'";
22919     case 'l': return "'long'";
22920     case 'L': return "'unsigned long'";
22921     case 'q': return "'long long'";
22922     case 'Q': return "'unsigned long long'";
22923     case 'f': return (is_complex ? "'complex float'" : "'float'");
22924     case 'd': return (is_complex ? "'complex double'" : "'double'");
22925     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
22926     case 'T': return "a struct";
22927     case 'O': return "Python object";
22928     case 'P': return "a pointer";
22929     case 's': case 'p': return "a string";
22930     case 0: return "end";
22931     default: return "unparseable format string";
22932   }
22933 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)22934 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
22935   switch (ch) {
22936     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22937     case 'h': case 'H': return 2;
22938     case 'i': case 'I': case 'l': case 'L': return 4;
22939     case 'q': case 'Q': return 8;
22940     case 'f': return (is_complex ? 8 : 4);
22941     case 'd': return (is_complex ? 16 : 8);
22942     case 'g': {
22943       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
22944       return 0;
22945     }
22946     case 'O': case 'P': return sizeof(void*);
22947     default:
22948       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22949       return 0;
22950     }
22951 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)22952 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
22953   switch (ch) {
22954     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22955     case 'h': case 'H': return sizeof(short);
22956     case 'i': case 'I': return sizeof(int);
22957     case 'l': case 'L': return sizeof(long);
22958     #ifdef HAVE_LONG_LONG
22959     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
22960     #endif
22961     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
22962     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
22963     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
22964     case 'O': case 'P': return sizeof(void*);
22965     default: {
22966       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22967       return 0;
22968     }
22969   }
22970 }
22971 typedef struct { char c; short x; } __Pyx_st_short;
22972 typedef struct { char c; int x; } __Pyx_st_int;
22973 typedef struct { char c; long x; } __Pyx_st_long;
22974 typedef struct { char c; float x; } __Pyx_st_float;
22975 typedef struct { char c; double x; } __Pyx_st_double;
22976 typedef struct { char c; long double x; } __Pyx_st_longdouble;
22977 typedef struct { char c; void *x; } __Pyx_st_void_p;
22978 #ifdef HAVE_LONG_LONG
22979 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
22980 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)22981 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
22982   switch (ch) {
22983     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22984     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
22985     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
22986     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
22987 #ifdef HAVE_LONG_LONG
22988     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
22989 #endif
22990     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
22991     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
22992     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
22993     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
22994     default:
22995       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22996       return 0;
22997     }
22998 }
22999 /* These are for computing the padding at the end of the struct to align
23000    on the first member of the struct. This will probably the same as above,
23001    but we don't have any guarantees.
23002  */
23003 typedef struct { short x; char c; } __Pyx_pad_short;
23004 typedef struct { int x; char c; } __Pyx_pad_int;
23005 typedef struct { long x; char c; } __Pyx_pad_long;
23006 typedef struct { float x; char c; } __Pyx_pad_float;
23007 typedef struct { double x; char c; } __Pyx_pad_double;
23008 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
23009 typedef struct { void *x; char c; } __Pyx_pad_void_p;
23010 #ifdef HAVE_LONG_LONG
23011 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
23012 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)23013 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
23014   switch (ch) {
23015     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
23016     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
23017     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
23018     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
23019 #ifdef HAVE_LONG_LONG
23020     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
23021 #endif
23022     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
23023     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
23024     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
23025     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
23026     default:
23027       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23028       return 0;
23029     }
23030 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)23031 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
23032   switch (ch) {
23033     case 'c':
23034         return 'H';
23035     case 'b': case 'h': case 'i':
23036     case 'l': case 'q': case 's': case 'p':
23037         return 'I';
23038     case 'B': case 'H': case 'I': case 'L': case 'Q':
23039         return 'U';
23040     case 'f': case 'd': case 'g':
23041         return (is_complex ? 'C' : 'R');
23042     case 'O':
23043         return 'O';
23044     case 'P':
23045         return 'P';
23046     default: {
23047       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23048       return 0;
23049     }
23050   }
23051 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)23052 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
23053   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
23054     const char* expected;
23055     const char* quote;
23056     if (ctx->head == NULL) {
23057       expected = "end";
23058       quote = "";
23059     } else {
23060       expected = ctx->head->field->type->name;
23061       quote = "'";
23062     }
23063     PyErr_Format(PyExc_ValueError,
23064                  "Buffer dtype mismatch, expected %s%s%s but got %s",
23065                  quote, expected, quote,
23066                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
23067   } else {
23068     __Pyx_StructField* field = ctx->head->field;
23069     __Pyx_StructField* parent = (ctx->head - 1)->field;
23070     PyErr_Format(PyExc_ValueError,
23071                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
23072                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
23073                  parent->type->name, field->name);
23074   }
23075 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)23076 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
23077   char group;
23078   size_t size, offset, arraysize = 1;
23079   if (ctx->enc_type == 0) return 0;
23080   if (ctx->head->field->type->arraysize[0]) {
23081     int i, ndim = 0;
23082     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
23083         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
23084         ndim = 1;
23085         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
23086             PyErr_Format(PyExc_ValueError,
23087                          "Expected a dimension of size %zu, got %zu",
23088                          ctx->head->field->type->arraysize[0], ctx->enc_count);
23089             return -1;
23090         }
23091     }
23092     if (!ctx->is_valid_array) {
23093       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
23094                    ctx->head->field->type->ndim, ndim);
23095       return -1;
23096     }
23097     for (i = 0; i < ctx->head->field->type->ndim; i++) {
23098       arraysize *= ctx->head->field->type->arraysize[i];
23099     }
23100     ctx->is_valid_array = 0;
23101     ctx->enc_count = 1;
23102   }
23103   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
23104   do {
23105     __Pyx_StructField* field = ctx->head->field;
23106     __Pyx_TypeInfo* type = field->type;
23107     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
23108       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
23109     } else {
23110       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
23111     }
23112     if (ctx->enc_packmode == '@') {
23113       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
23114       size_t align_mod_offset;
23115       if (align_at == 0) return -1;
23116       align_mod_offset = ctx->fmt_offset % align_at;
23117       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
23118       if (ctx->struct_alignment == 0)
23119           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
23120                                                                  ctx->is_complex);
23121     }
23122     if (type->size != size || type->typegroup != group) {
23123       if (type->typegroup == 'C' && type->fields != NULL) {
23124         size_t parent_offset = ctx->head->parent_offset + field->offset;
23125         ++ctx->head;
23126         ctx->head->field = type->fields;
23127         ctx->head->parent_offset = parent_offset;
23128         continue;
23129       }
23130       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
23131       } else {
23132           __Pyx_BufFmt_RaiseExpected(ctx);
23133           return -1;
23134       }
23135     }
23136     offset = ctx->head->parent_offset + field->offset;
23137     if (ctx->fmt_offset != offset) {
23138       PyErr_Format(PyExc_ValueError,
23139                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
23140                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
23141       return -1;
23142     }
23143     ctx->fmt_offset += size;
23144     if (arraysize)
23145       ctx->fmt_offset += (arraysize - 1) * size;
23146     --ctx->enc_count;
23147     while (1) {
23148       if (field == &ctx->root) {
23149         ctx->head = NULL;
23150         if (ctx->enc_count != 0) {
23151           __Pyx_BufFmt_RaiseExpected(ctx);
23152           return -1;
23153         }
23154         break;
23155       }
23156       ctx->head->field = ++field;
23157       if (field->type == NULL) {
23158         --ctx->head;
23159         field = ctx->head->field;
23160         continue;
23161       } else if (field->type->typegroup == 'S') {
23162         size_t parent_offset = ctx->head->parent_offset + field->offset;
23163         if (field->type->fields->type == NULL) continue;
23164         field = field->type->fields;
23165         ++ctx->head;
23166         ctx->head->field = field;
23167         ctx->head->parent_offset = parent_offset;
23168         break;
23169       } else {
23170         break;
23171       }
23172     }
23173   } while (ctx->enc_count);
23174   ctx->enc_type = 0;
23175   ctx->is_complex = 0;
23176   return 0;
23177 }
23178 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)23179 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
23180 {
23181     const char *ts = *tsp;
23182     int i = 0, number;
23183     int ndim = ctx->head->field->type->ndim;
23184 ;
23185     ++ts;
23186     if (ctx->new_count != 1) {
23187         PyErr_SetString(PyExc_ValueError,
23188                         "Cannot handle repeated arrays in format string");
23189         return NULL;
23190     }
23191     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23192     while (*ts && *ts != ')') {
23193         switch (*ts) {
23194             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
23195             default:  break;
23196         }
23197         number = __Pyx_BufFmt_ExpectNumber(&ts);
23198         if (number == -1) return NULL;
23199         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
23200             return PyErr_Format(PyExc_ValueError,
23201                         "Expected a dimension of size %zu, got %d",
23202                         ctx->head->field->type->arraysize[i], number);
23203         if (*ts != ',' && *ts != ')')
23204             return PyErr_Format(PyExc_ValueError,
23205                                 "Expected a comma in format string, got '%c'", *ts);
23206         if (*ts == ',') ts++;
23207         i++;
23208     }
23209     if (i != ndim)
23210         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
23211                             ctx->head->field->type->ndim, i);
23212     if (!*ts) {
23213         PyErr_SetString(PyExc_ValueError,
23214                         "Unexpected end of format string, expected ')'");
23215         return NULL;
23216     }
23217     ctx->is_valid_array = 1;
23218     ctx->new_count = 1;
23219     *tsp = ++ts;
23220     return Py_None;
23221 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)23222 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
23223   int got_Z = 0;
23224   while (1) {
23225     switch(*ts) {
23226       case 0:
23227         if (ctx->enc_type != 0 && ctx->head == NULL) {
23228           __Pyx_BufFmt_RaiseExpected(ctx);
23229           return NULL;
23230         }
23231         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23232         if (ctx->head != NULL) {
23233           __Pyx_BufFmt_RaiseExpected(ctx);
23234           return NULL;
23235         }
23236         return ts;
23237       case ' ':
23238       case '\r':
23239       case '\n':
23240         ++ts;
23241         break;
23242       case '<':
23243         if (!__Pyx_Is_Little_Endian()) {
23244           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
23245           return NULL;
23246         }
23247         ctx->new_packmode = '=';
23248         ++ts;
23249         break;
23250       case '>':
23251       case '!':
23252         if (__Pyx_Is_Little_Endian()) {
23253           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
23254           return NULL;
23255         }
23256         ctx->new_packmode = '=';
23257         ++ts;
23258         break;
23259       case '=':
23260       case '@':
23261       case '^':
23262         ctx->new_packmode = *ts++;
23263         break;
23264       case 'T':
23265         {
23266           const char* ts_after_sub;
23267           size_t i, struct_count = ctx->new_count;
23268           size_t struct_alignment = ctx->struct_alignment;
23269           ctx->new_count = 1;
23270           ++ts;
23271           if (*ts != '{') {
23272             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
23273             return NULL;
23274           }
23275           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23276           ctx->enc_type = 0;
23277           ctx->enc_count = 0;
23278           ctx->struct_alignment = 0;
23279           ++ts;
23280           ts_after_sub = ts;
23281           for (i = 0; i != struct_count; ++i) {
23282             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
23283             if (!ts_after_sub) return NULL;
23284           }
23285           ts = ts_after_sub;
23286           if (struct_alignment) ctx->struct_alignment = struct_alignment;
23287         }
23288         break;
23289       case '}':
23290         {
23291           size_t alignment = ctx->struct_alignment;
23292           ++ts;
23293           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23294           ctx->enc_type = 0;
23295           if (alignment && ctx->fmt_offset % alignment) {
23296             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
23297           }
23298         }
23299         return ts;
23300       case 'x':
23301         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23302         ctx->fmt_offset += ctx->new_count;
23303         ctx->new_count = 1;
23304         ctx->enc_count = 0;
23305         ctx->enc_type = 0;
23306         ctx->enc_packmode = ctx->new_packmode;
23307         ++ts;
23308         break;
23309       case 'Z':
23310         got_Z = 1;
23311         ++ts;
23312         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
23313           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
23314           return NULL;
23315         }
23316         CYTHON_FALLTHROUGH;
23317       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
23318       case 'l': case 'L': case 'q': case 'Q':
23319       case 'f': case 'd': case 'g':
23320       case 'O': case 'p':
23321         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
23322             ctx->enc_packmode == ctx->new_packmode) {
23323           ctx->enc_count += ctx->new_count;
23324           ctx->new_count = 1;
23325           got_Z = 0;
23326           ++ts;
23327           break;
23328         }
23329         CYTHON_FALLTHROUGH;
23330       case 's':
23331         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
23332         ctx->enc_count = ctx->new_count;
23333         ctx->enc_packmode = ctx->new_packmode;
23334         ctx->enc_type = *ts;
23335         ctx->is_complex = got_Z;
23336         ++ts;
23337         ctx->new_count = 1;
23338         got_Z = 0;
23339         break;
23340       case ':':
23341         ++ts;
23342         while(*ts != ':') ++ts;
23343         ++ts;
23344         break;
23345       case '(':
23346         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
23347         break;
23348       default:
23349         {
23350           int number = __Pyx_BufFmt_ExpectNumber(&ts);
23351           if (number == -1) return NULL;
23352           ctx->new_count = (size_t)number;
23353         }
23354     }
23355   }
23356 }
23357 
23358 /* TypeInfoCompare */
23359   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)23360 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
23361 {
23362     int i;
23363     if (!a || !b)
23364         return 0;
23365     if (a == b)
23366         return 1;
23367     if (a->size != b->size || a->typegroup != b->typegroup ||
23368             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
23369         if (a->typegroup == 'H' || b->typegroup == 'H') {
23370             return a->size == b->size;
23371         } else {
23372             return 0;
23373         }
23374     }
23375     if (a->ndim) {
23376         for (i = 0; i < a->ndim; i++)
23377             if (a->arraysize[i] != b->arraysize[i])
23378                 return 0;
23379     }
23380     if (a->typegroup == 'S') {
23381         if (a->flags != b->flags)
23382             return 0;
23383         if (a->fields || b->fields) {
23384             if (!(a->fields && b->fields))
23385                 return 0;
23386             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
23387                 __Pyx_StructField *field_a = a->fields + i;
23388                 __Pyx_StructField *field_b = b->fields + i;
23389                 if (field_a->offset != field_b->offset ||
23390                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
23391                     return 0;
23392             }
23393             return !a->fields[i].type && !b->fields[i].type;
23394         }
23395     }
23396     return 1;
23397 }
23398 
23399 /* MemviewSliceValidateAndInit */
23400   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)23401 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
23402 {
23403     if (buf->shape[dim] <= 1)
23404         return 1;
23405     if (buf->strides) {
23406         if (spec & __Pyx_MEMVIEW_CONTIG) {
23407             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
23408                 if (buf->strides[dim] != sizeof(void *)) {
23409                     PyErr_Format(PyExc_ValueError,
23410                                  "Buffer is not indirectly contiguous "
23411                                  "in dimension %d.", dim);
23412                     goto fail;
23413                 }
23414             } else if (buf->strides[dim] != buf->itemsize) {
23415                 PyErr_SetString(PyExc_ValueError,
23416                                 "Buffer and memoryview are not contiguous "
23417                                 "in the same dimension.");
23418                 goto fail;
23419             }
23420         }
23421         if (spec & __Pyx_MEMVIEW_FOLLOW) {
23422             Py_ssize_t stride = buf->strides[dim];
23423             if (stride < 0)
23424                 stride = -stride;
23425             if (stride < buf->itemsize) {
23426                 PyErr_SetString(PyExc_ValueError,
23427                                 "Buffer and memoryview are not contiguous "
23428                                 "in the same dimension.");
23429                 goto fail;
23430             }
23431         }
23432     } else {
23433         if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
23434             PyErr_Format(PyExc_ValueError,
23435                          "C-contiguous buffer is not contiguous in "
23436                          "dimension %d", dim);
23437             goto fail;
23438         } else if (spec & (__Pyx_MEMVIEW_PTR)) {
23439             PyErr_Format(PyExc_ValueError,
23440                          "C-contiguous buffer is not indirect in "
23441                          "dimension %d", dim);
23442             goto fail;
23443         } else if (buf->suboffsets) {
23444             PyErr_SetString(PyExc_ValueError,
23445                             "Buffer exposes suboffsets but no strides");
23446             goto fail;
23447         }
23448     }
23449     return 1;
23450 fail:
23451     return 0;
23452 }
23453 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)23454 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
23455 {
23456     if (spec & __Pyx_MEMVIEW_DIRECT) {
23457         if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
23458             PyErr_Format(PyExc_ValueError,
23459                          "Buffer not compatible with direct access "
23460                          "in dimension %d.", dim);
23461             goto fail;
23462         }
23463     }
23464     if (spec & __Pyx_MEMVIEW_PTR) {
23465         if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
23466             PyErr_Format(PyExc_ValueError,
23467                          "Buffer is not indirectly accessible "
23468                          "in dimension %d.", dim);
23469             goto fail;
23470         }
23471     }
23472     return 1;
23473 fail:
23474     return 0;
23475 }
23476 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)23477 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
23478 {
23479     int i;
23480     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
23481         Py_ssize_t stride = 1;
23482         for (i = 0; i < ndim; i++) {
23483             if (stride * buf->itemsize != buf->strides[i] &&
23484                     buf->shape[i] > 1)
23485             {
23486                 PyErr_SetString(PyExc_ValueError,
23487                     "Buffer not fortran contiguous.");
23488                 goto fail;
23489             }
23490             stride = stride * buf->shape[i];
23491         }
23492     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
23493         Py_ssize_t stride = 1;
23494         for (i = ndim - 1; i >- 1; i--) {
23495             if (stride * buf->itemsize != buf->strides[i] &&
23496                     buf->shape[i] > 1) {
23497                 PyErr_SetString(PyExc_ValueError,
23498                     "Buffer not C contiguous.");
23499                 goto fail;
23500             }
23501             stride = stride * buf->shape[i];
23502         }
23503     }
23504     return 1;
23505 fail:
23506     return 0;
23507 }
__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)23508 static int __Pyx_ValidateAndInit_memviewslice(
23509                 int *axes_specs,
23510                 int c_or_f_flag,
23511                 int buf_flags,
23512                 int ndim,
23513                 __Pyx_TypeInfo *dtype,
23514                 __Pyx_BufFmt_StackElem stack[],
23515                 __Pyx_memviewslice *memviewslice,
23516                 PyObject *original_obj)
23517 {
23518     struct __pyx_memoryview_obj *memview, *new_memview;
23519     __Pyx_RefNannyDeclarations
23520     Py_buffer *buf;
23521     int i, spec = 0, retval = -1;
23522     __Pyx_BufFmt_Context ctx;
23523     int from_memoryview = __pyx_memoryview_check(original_obj);
23524     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
23525     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
23526                                                             original_obj)->typeinfo)) {
23527         memview = (struct __pyx_memoryview_obj *) original_obj;
23528         new_memview = NULL;
23529     } else {
23530         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
23531                                             original_obj, buf_flags, 0, dtype);
23532         new_memview = memview;
23533         if (unlikely(!memview))
23534             goto fail;
23535     }
23536     buf = &memview->view;
23537     if (buf->ndim != ndim) {
23538         PyErr_Format(PyExc_ValueError,
23539                 "Buffer has wrong number of dimensions (expected %d, got %d)",
23540                 ndim, buf->ndim);
23541         goto fail;
23542     }
23543     if (new_memview) {
23544         __Pyx_BufFmt_Init(&ctx, stack, dtype);
23545         if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
23546     }
23547     if ((unsigned) buf->itemsize != dtype->size) {
23548         PyErr_Format(PyExc_ValueError,
23549                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
23550                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
23551                      buf->itemsize,
23552                      (buf->itemsize > 1) ? "s" : "",
23553                      dtype->name,
23554                      dtype->size,
23555                      (dtype->size > 1) ? "s" : "");
23556         goto fail;
23557     }
23558     for (i = 0; i < ndim; i++) {
23559         spec = axes_specs[i];
23560         if (!__pyx_check_strides(buf, i, ndim, spec))
23561             goto fail;
23562         if (!__pyx_check_suboffsets(buf, i, ndim, spec))
23563             goto fail;
23564     }
23565     if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
23566         goto fail;
23567     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
23568                                          new_memview != NULL) == -1)) {
23569         goto fail;
23570     }
23571     retval = 0;
23572     goto no_fail;
23573 fail:
23574     Py_XDECREF(new_memview);
23575     retval = -1;
23576 no_fail:
23577     __Pyx_RefNannyFinishContext();
23578     return retval;
23579 }
23580 
23581 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject * obj,int writable_flag)23582   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj, int writable_flag) {
23583     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
23584     __Pyx_BufFmt_StackElem stack[1];
23585     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
23586     int retcode;
23587     if (obj == Py_None) {
23588         result.memview = (struct __pyx_memoryview_obj *) Py_None;
23589         return result;
23590     }
23591     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
23592                                                  PyBUF_RECORDS_RO | writable_flag, 2,
23593                                                  &__Pyx_TypeInfo_int, stack,
23594                                                  &result, obj);
23595     if (unlikely(retcode == -1))
23596         goto __pyx_fail;
23597     return result;
23598 __pyx_fail:
23599     result.memview = NULL;
23600     result.data = NULL;
23601     return result;
23602 }
23603 
23604 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject * obj,int writable_flag)23605   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
23606     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
23607     __Pyx_BufFmt_StackElem stack[1];
23608     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
23609     int retcode;
23610     if (obj == Py_None) {
23611         result.memview = (struct __pyx_memoryview_obj *) Py_None;
23612         return result;
23613     }
23614     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
23615                                                  PyBUF_RECORDS_RO | writable_flag, 1,
23616                                                  &__Pyx_TypeInfo_int, stack,
23617                                                  &result, obj);
23618     if (unlikely(retcode == -1))
23619         goto __pyx_fail;
23620     return result;
23621 __pyx_fail:
23622     result.memview = NULL;
23623     result.data = NULL;
23624     return result;
23625 }
23626 
23627 /* CIntToPy */
__Pyx_PyInt_From_int(int value)23628   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
23629     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
23630     const int is_unsigned = neg_one > const_zero;
23631     if (is_unsigned) {
23632         if (sizeof(int) < sizeof(long)) {
23633             return PyInt_FromLong((long) value);
23634         } else if (sizeof(int) <= sizeof(unsigned long)) {
23635             return PyLong_FromUnsignedLong((unsigned long) value);
23636 #ifdef HAVE_LONG_LONG
23637         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
23638             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
23639 #endif
23640         }
23641     } else {
23642         if (sizeof(int) <= sizeof(long)) {
23643             return PyInt_FromLong((long) value);
23644 #ifdef HAVE_LONG_LONG
23645         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
23646             return PyLong_FromLongLong((PY_LONG_LONG) value);
23647 #endif
23648         }
23649     }
23650     {
23651         int one = 1; int little = (int)*(unsigned char *)&one;
23652         unsigned char *bytes = (unsigned char *)&value;
23653         return _PyLong_FromByteArray(bytes, sizeof(int),
23654                                      little, !is_unsigned);
23655     }
23656 }
23657 
23658 /* MemviewDtypeToObject */
__pyx_memview_get_int(const char * itemp)23659   static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
23660     return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
23661 }
__pyx_memview_set_int(const char * itemp,PyObject * obj)23662 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
23663     int value = __Pyx_PyInt_As_int(obj);
23664     if ((value == (int)-1) && PyErr_Occurred())
23665         return 0;
23666     *(int *) itemp = value;
23667     return 1;
23668 }
23669 
23670 /* Declarations */
23671   #if CYTHON_CCOMPLEX
23672   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)23673     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23674       return ::std::complex< float >(x, y);
23675     }
23676   #else
__pyx_t_float_complex_from_parts(float x,float y)23677     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23678       return x + y*(__pyx_t_float_complex)_Complex_I;
23679     }
23680   #endif
23681 #else
__pyx_t_float_complex_from_parts(float x,float y)23682     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23683       __pyx_t_float_complex z;
23684       z.real = x;
23685       z.imag = y;
23686       return z;
23687     }
23688 #endif
23689 
23690 /* Arithmetic */
23691   #if CYTHON_CCOMPLEX
23692 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23693     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23694        return (a.real == b.real) && (a.imag == b.imag);
23695     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23696     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23697         __pyx_t_float_complex z;
23698         z.real = a.real + b.real;
23699         z.imag = a.imag + b.imag;
23700         return z;
23701     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23702     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23703         __pyx_t_float_complex z;
23704         z.real = a.real - b.real;
23705         z.imag = a.imag - b.imag;
23706         return z;
23707     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23708     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23709         __pyx_t_float_complex z;
23710         z.real = a.real * b.real - a.imag * b.imag;
23711         z.imag = a.real * b.imag + a.imag * b.real;
23712         return z;
23713     }
23714     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23715     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23716         if (b.imag == 0) {
23717             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
23718         } else if (fabsf(b.real) >= fabsf(b.imag)) {
23719             if (b.real == 0 && b.imag == 0) {
23720                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
23721             } else {
23722                 float r = b.imag / b.real;
23723                 float s = (float)(1.0) / (b.real + b.imag * r);
23724                 return __pyx_t_float_complex_from_parts(
23725                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
23726             }
23727         } else {
23728             float r = b.real / b.imag;
23729             float s = (float)(1.0) / (b.imag + b.real * r);
23730             return __pyx_t_float_complex_from_parts(
23731                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
23732         }
23733     }
23734     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23735     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23736         if (b.imag == 0) {
23737             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
23738         } else {
23739             float denom = b.real * b.real + b.imag * b.imag;
23740             return __pyx_t_float_complex_from_parts(
23741                 (a.real * b.real + a.imag * b.imag) / denom,
23742                 (a.imag * b.real - a.real * b.imag) / denom);
23743         }
23744     }
23745     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)23746     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
23747         __pyx_t_float_complex z;
23748         z.real = -a.real;
23749         z.imag = -a.imag;
23750         return z;
23751     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)23752     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
23753        return (a.real == 0) && (a.imag == 0);
23754     }
__Pyx_c_conj_float(__pyx_t_float_complex a)23755     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
23756         __pyx_t_float_complex z;
23757         z.real =  a.real;
23758         z.imag = -a.imag;
23759         return z;
23760     }
23761     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)23762         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
23763           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
23764             return sqrtf(z.real*z.real + z.imag*z.imag);
23765           #else
23766             return hypotf(z.real, z.imag);
23767           #endif
23768         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)23769         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23770             __pyx_t_float_complex z;
23771             float r, lnr, theta, z_r, z_theta;
23772             if (b.imag == 0 && b.real == (int)b.real) {
23773                 if (b.real < 0) {
23774                     float denom = a.real * a.real + a.imag * a.imag;
23775                     a.real = a.real / denom;
23776                     a.imag = -a.imag / denom;
23777                     b.real = -b.real;
23778                 }
23779                 switch ((int)b.real) {
23780                     case 0:
23781                         z.real = 1;
23782                         z.imag = 0;
23783                         return z;
23784                     case 1:
23785                         return a;
23786                     case 2:
23787                         z = __Pyx_c_prod_float(a, a);
23788                         return __Pyx_c_prod_float(a, a);
23789                     case 3:
23790                         z = __Pyx_c_prod_float(a, a);
23791                         return __Pyx_c_prod_float(z, a);
23792                     case 4:
23793                         z = __Pyx_c_prod_float(a, a);
23794                         return __Pyx_c_prod_float(z, z);
23795                 }
23796             }
23797             if (a.imag == 0) {
23798                 if (a.real == 0) {
23799                     return a;
23800                 } else if (b.imag == 0) {
23801                     z.real = powf(a.real, b.real);
23802                     z.imag = 0;
23803                     return z;
23804                 } else if (a.real > 0) {
23805                     r = a.real;
23806                     theta = 0;
23807                 } else {
23808                     r = -a.real;
23809                     theta = atan2f(0.0, -1.0);
23810                 }
23811             } else {
23812                 r = __Pyx_c_abs_float(a);
23813                 theta = atan2f(a.imag, a.real);
23814             }
23815             lnr = logf(r);
23816             z_r = expf(lnr * b.real - theta * b.imag);
23817             z_theta = theta * b.real + lnr * b.imag;
23818             z.real = z_r * cosf(z_theta);
23819             z.imag = z_r * sinf(z_theta);
23820             return z;
23821         }
23822     #endif
23823 #endif
23824 
23825 /* Declarations */
23826   #if CYTHON_CCOMPLEX
23827   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)23828     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23829       return ::std::complex< double >(x, y);
23830     }
23831   #else
__pyx_t_double_complex_from_parts(double x,double y)23832     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23833       return x + y*(__pyx_t_double_complex)_Complex_I;
23834     }
23835   #endif
23836 #else
__pyx_t_double_complex_from_parts(double x,double y)23837     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
23838       __pyx_t_double_complex z;
23839       z.real = x;
23840       z.imag = y;
23841       return z;
23842     }
23843 #endif
23844 
23845 /* Arithmetic */
23846   #if CYTHON_CCOMPLEX
23847 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23848     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23849        return (a.real == b.real) && (a.imag == b.imag);
23850     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23851     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23852         __pyx_t_double_complex z;
23853         z.real = a.real + b.real;
23854         z.imag = a.imag + b.imag;
23855         return z;
23856     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23857     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23858         __pyx_t_double_complex z;
23859         z.real = a.real - b.real;
23860         z.imag = a.imag - b.imag;
23861         return z;
23862     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23863     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23864         __pyx_t_double_complex z;
23865         z.real = a.real * b.real - a.imag * b.imag;
23866         z.imag = a.real * b.imag + a.imag * b.real;
23867         return z;
23868     }
23869     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23870     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23871         if (b.imag == 0) {
23872             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23873         } else if (fabs(b.real) >= fabs(b.imag)) {
23874             if (b.real == 0 && b.imag == 0) {
23875                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
23876             } else {
23877                 double r = b.imag / b.real;
23878                 double s = (double)(1.0) / (b.real + b.imag * r);
23879                 return __pyx_t_double_complex_from_parts(
23880                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
23881             }
23882         } else {
23883             double r = b.real / b.imag;
23884             double s = (double)(1.0) / (b.imag + b.real * r);
23885             return __pyx_t_double_complex_from_parts(
23886                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
23887         }
23888     }
23889     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23890     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23891         if (b.imag == 0) {
23892             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23893         } else {
23894             double denom = b.real * b.real + b.imag * b.imag;
23895             return __pyx_t_double_complex_from_parts(
23896                 (a.real * b.real + a.imag * b.imag) / denom,
23897                 (a.imag * b.real - a.real * b.imag) / denom);
23898         }
23899     }
23900     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)23901     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
23902         __pyx_t_double_complex z;
23903         z.real = -a.real;
23904         z.imag = -a.imag;
23905         return z;
23906     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)23907     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
23908        return (a.real == 0) && (a.imag == 0);
23909     }
__Pyx_c_conj_double(__pyx_t_double_complex a)23910     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
23911         __pyx_t_double_complex z;
23912         z.real =  a.real;
23913         z.imag = -a.imag;
23914         return z;
23915     }
23916     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)23917         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
23918           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
23919             return sqrt(z.real*z.real + z.imag*z.imag);
23920           #else
23921             return hypot(z.real, z.imag);
23922           #endif
23923         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)23924         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23925             __pyx_t_double_complex z;
23926             double r, lnr, theta, z_r, z_theta;
23927             if (b.imag == 0 && b.real == (int)b.real) {
23928                 if (b.real < 0) {
23929                     double denom = a.real * a.real + a.imag * a.imag;
23930                     a.real = a.real / denom;
23931                     a.imag = -a.imag / denom;
23932                     b.real = -b.real;
23933                 }
23934                 switch ((int)b.real) {
23935                     case 0:
23936                         z.real = 1;
23937                         z.imag = 0;
23938                         return z;
23939                     case 1:
23940                         return a;
23941                     case 2:
23942                         z = __Pyx_c_prod_double(a, a);
23943                         return __Pyx_c_prod_double(a, a);
23944                     case 3:
23945                         z = __Pyx_c_prod_double(a, a);
23946                         return __Pyx_c_prod_double(z, a);
23947                     case 4:
23948                         z = __Pyx_c_prod_double(a, a);
23949                         return __Pyx_c_prod_double(z, z);
23950                 }
23951             }
23952             if (a.imag == 0) {
23953                 if (a.real == 0) {
23954                     return a;
23955                 } else if (b.imag == 0) {
23956                     z.real = pow(a.real, b.real);
23957                     z.imag = 0;
23958                     return z;
23959                 } else if (a.real > 0) {
23960                     r = a.real;
23961                     theta = 0;
23962                 } else {
23963                     r = -a.real;
23964                     theta = atan2(0.0, -1.0);
23965                 }
23966             } else {
23967                 r = __Pyx_c_abs_double(a);
23968                 theta = atan2(a.imag, a.real);
23969             }
23970             lnr = log(r);
23971             z_r = exp(lnr * b.real - theta * b.imag);
23972             z_theta = theta * b.real + lnr * b.imag;
23973             z.real = z_r * cos(z_theta);
23974             z.imag = z_r * sin(z_theta);
23975             return z;
23976         }
23977     #endif
23978 #endif
23979 
23980 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)23981   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
23982     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
23983     const int is_unsigned = neg_one > const_zero;
23984     if (is_unsigned) {
23985         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
23986             return PyInt_FromLong((long) value);
23987         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
23988             return PyLong_FromUnsignedLong((unsigned long) value);
23989 #ifdef HAVE_LONG_LONG
23990         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
23991             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
23992 #endif
23993         }
23994     } else {
23995         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
23996             return PyInt_FromLong((long) value);
23997 #ifdef HAVE_LONG_LONG
23998         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
23999             return PyLong_FromLongLong((PY_LONG_LONG) value);
24000 #endif
24001         }
24002     }
24003     {
24004         int one = 1; int little = (int)*(unsigned char *)&one;
24005         unsigned char *bytes = (unsigned char *)&value;
24006         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
24007                                      little, !is_unsigned);
24008     }
24009 }
24010 
24011 /* MemviewSliceCopyTemplate */
24012   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)24013 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
24014                                  const char *mode, int ndim,
24015                                  size_t sizeof_dtype, int contig_flag,
24016                                  int dtype_is_object)
24017 {
24018     __Pyx_RefNannyDeclarations
24019     int i;
24020     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
24021     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
24022     Py_buffer *buf = &from_memview->view;
24023     PyObject *shape_tuple = NULL;
24024     PyObject *temp_int = NULL;
24025     struct __pyx_array_obj *array_obj = NULL;
24026     struct __pyx_memoryview_obj *memview_obj = NULL;
24027     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
24028     for (i = 0; i < ndim; i++) {
24029         if (from_mvs->suboffsets[i] >= 0) {
24030             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
24031                                            "indirect dimensions (axis %d)", i);
24032             goto fail;
24033         }
24034     }
24035     shape_tuple = PyTuple_New(ndim);
24036     if (unlikely(!shape_tuple)) {
24037         goto fail;
24038     }
24039     __Pyx_GOTREF(shape_tuple);
24040     for(i = 0; i < ndim; i++) {
24041         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
24042         if(unlikely(!temp_int)) {
24043             goto fail;
24044         } else {
24045             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
24046             temp_int = NULL;
24047         }
24048     }
24049     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
24050     if (unlikely(!array_obj)) {
24051         goto fail;
24052     }
24053     __Pyx_GOTREF(array_obj);
24054     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
24055                                     (PyObject *) array_obj, contig_flag,
24056                                     dtype_is_object,
24057                                     from_mvs->memview->typeinfo);
24058     if (unlikely(!memview_obj))
24059         goto fail;
24060     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
24061         goto fail;
24062     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
24063                                                 dtype_is_object) < 0))
24064         goto fail;
24065     goto no_fail;
24066 fail:
24067     __Pyx_XDECREF(new_mvs.memview);
24068     new_mvs.memview = NULL;
24069     new_mvs.data = NULL;
24070 no_fail:
24071     __Pyx_XDECREF(shape_tuple);
24072     __Pyx_XDECREF(temp_int);
24073     __Pyx_XDECREF(array_obj);
24074     __Pyx_RefNannyFinishContext();
24075     return new_mvs;
24076 }
24077 
24078 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)24079   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
24080     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
24081     const int is_unsigned = neg_one > const_zero;
24082 #if PY_MAJOR_VERSION < 3
24083     if (likely(PyInt_Check(x))) {
24084         if (sizeof(int) < sizeof(long)) {
24085             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
24086         } else {
24087             long val = PyInt_AS_LONG(x);
24088             if (is_unsigned && unlikely(val < 0)) {
24089                 goto raise_neg_overflow;
24090             }
24091             return (int) val;
24092         }
24093     } else
24094 #endif
24095     if (likely(PyLong_Check(x))) {
24096         if (is_unsigned) {
24097 #if CYTHON_USE_PYLONG_INTERNALS
24098             const digit* digits = ((PyLongObject*)x)->ob_digit;
24099             switch (Py_SIZE(x)) {
24100                 case  0: return (int) 0;
24101                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
24102                 case 2:
24103                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24104                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24105                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24106                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
24107                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24108                         }
24109                     }
24110                     break;
24111                 case 3:
24112                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24113                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24114                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24115                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
24116                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24117                         }
24118                     }
24119                     break;
24120                 case 4:
24121                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24122                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24123                             __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])))
24124                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
24125                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24126                         }
24127                     }
24128                     break;
24129             }
24130 #endif
24131 #if CYTHON_COMPILING_IN_CPYTHON
24132             if (unlikely(Py_SIZE(x) < 0)) {
24133                 goto raise_neg_overflow;
24134             }
24135 #else
24136             {
24137                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24138                 if (unlikely(result < 0))
24139                     return (int) -1;
24140                 if (unlikely(result == 1))
24141                     goto raise_neg_overflow;
24142             }
24143 #endif
24144             if (sizeof(int) <= sizeof(unsigned long)) {
24145                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
24146 #ifdef HAVE_LONG_LONG
24147             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24148                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24149 #endif
24150             }
24151         } else {
24152 #if CYTHON_USE_PYLONG_INTERNALS
24153             const digit* digits = ((PyLongObject*)x)->ob_digit;
24154             switch (Py_SIZE(x)) {
24155                 case  0: return (int) 0;
24156                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
24157                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
24158                 case -2:
24159                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
24160                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24161                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24162                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24163                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24164                         }
24165                     }
24166                     break;
24167                 case 2:
24168                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24169                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24170                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24171                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24172                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24173                         }
24174                     }
24175                     break;
24176                 case -3:
24177                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24178                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24179                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24180                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24181                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24182                         }
24183                     }
24184                     break;
24185                 case 3:
24186                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24187                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24188                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24189                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24190                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24191                         }
24192                     }
24193                     break;
24194                 case -4:
24195                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24196                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24197                             __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])))
24198                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24199                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24200                         }
24201                     }
24202                     break;
24203                 case 4:
24204                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24205                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24206                             __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])))
24207                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24208                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24209                         }
24210                     }
24211                     break;
24212             }
24213 #endif
24214             if (sizeof(int) <= sizeof(long)) {
24215                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
24216 #ifdef HAVE_LONG_LONG
24217             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24218                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
24219 #endif
24220             }
24221         }
24222         {
24223 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24224             PyErr_SetString(PyExc_RuntimeError,
24225                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24226 #else
24227             int val;
24228             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24229  #if PY_MAJOR_VERSION < 3
24230             if (likely(v) && !PyLong_Check(v)) {
24231                 PyObject *tmp = v;
24232                 v = PyNumber_Long(tmp);
24233                 Py_DECREF(tmp);
24234             }
24235  #endif
24236             if (likely(v)) {
24237                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24238                 unsigned char *bytes = (unsigned char *)&val;
24239                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24240                                               bytes, sizeof(val),
24241                                               is_little, !is_unsigned);
24242                 Py_DECREF(v);
24243                 if (likely(!ret))
24244                     return val;
24245             }
24246 #endif
24247             return (int) -1;
24248         }
24249     } else {
24250         int val;
24251         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24252         if (!tmp) return (int) -1;
24253         val = __Pyx_PyInt_As_int(tmp);
24254         Py_DECREF(tmp);
24255         return val;
24256     }
24257 raise_overflow:
24258     PyErr_SetString(PyExc_OverflowError,
24259         "value too large to convert to int");
24260     return (int) -1;
24261 raise_neg_overflow:
24262     PyErr_SetString(PyExc_OverflowError,
24263         "can't convert negative value to int");
24264     return (int) -1;
24265 }
24266 
24267 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)24268   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
24269     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
24270     const int is_unsigned = neg_one > const_zero;
24271 #if PY_MAJOR_VERSION < 3
24272     if (likely(PyInt_Check(x))) {
24273         if (sizeof(long) < sizeof(long)) {
24274             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
24275         } else {
24276             long val = PyInt_AS_LONG(x);
24277             if (is_unsigned && unlikely(val < 0)) {
24278                 goto raise_neg_overflow;
24279             }
24280             return (long) val;
24281         }
24282     } else
24283 #endif
24284     if (likely(PyLong_Check(x))) {
24285         if (is_unsigned) {
24286 #if CYTHON_USE_PYLONG_INTERNALS
24287             const digit* digits = ((PyLongObject*)x)->ob_digit;
24288             switch (Py_SIZE(x)) {
24289                 case  0: return (long) 0;
24290                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
24291                 case 2:
24292                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24293                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24294                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24295                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
24296                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24297                         }
24298                     }
24299                     break;
24300                 case 3:
24301                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24302                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24303                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24304                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
24305                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24306                         }
24307                     }
24308                     break;
24309                 case 4:
24310                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24311                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24312                             __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])))
24313                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
24314                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24315                         }
24316                     }
24317                     break;
24318             }
24319 #endif
24320 #if CYTHON_COMPILING_IN_CPYTHON
24321             if (unlikely(Py_SIZE(x) < 0)) {
24322                 goto raise_neg_overflow;
24323             }
24324 #else
24325             {
24326                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24327                 if (unlikely(result < 0))
24328                     return (long) -1;
24329                 if (unlikely(result == 1))
24330                     goto raise_neg_overflow;
24331             }
24332 #endif
24333             if (sizeof(long) <= sizeof(unsigned long)) {
24334                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
24335 #ifdef HAVE_LONG_LONG
24336             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24337                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24338 #endif
24339             }
24340         } else {
24341 #if CYTHON_USE_PYLONG_INTERNALS
24342             const digit* digits = ((PyLongObject*)x)->ob_digit;
24343             switch (Py_SIZE(x)) {
24344                 case  0: return (long) 0;
24345                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
24346                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
24347                 case -2:
24348                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
24349                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24350                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24351                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24352                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24353                         }
24354                     }
24355                     break;
24356                 case 2:
24357                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24358                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24359                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24360                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24361                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24362                         }
24363                     }
24364                     break;
24365                 case -3:
24366                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24367                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24368                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24369                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24370                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24371                         }
24372                     }
24373                     break;
24374                 case 3:
24375                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24376                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24377                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24378                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24379                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24380                         }
24381                     }
24382                     break;
24383                 case -4:
24384                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24385                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24386                             __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])))
24387                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24388                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24389                         }
24390                     }
24391                     break;
24392                 case 4:
24393                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24394                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24395                             __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])))
24396                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24397                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24398                         }
24399                     }
24400                     break;
24401             }
24402 #endif
24403             if (sizeof(long) <= sizeof(long)) {
24404                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
24405 #ifdef HAVE_LONG_LONG
24406             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24407                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
24408 #endif
24409             }
24410         }
24411         {
24412 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24413             PyErr_SetString(PyExc_RuntimeError,
24414                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24415 #else
24416             long val;
24417             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24418  #if PY_MAJOR_VERSION < 3
24419             if (likely(v) && !PyLong_Check(v)) {
24420                 PyObject *tmp = v;
24421                 v = PyNumber_Long(tmp);
24422                 Py_DECREF(tmp);
24423             }
24424  #endif
24425             if (likely(v)) {
24426                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24427                 unsigned char *bytes = (unsigned char *)&val;
24428                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24429                                               bytes, sizeof(val),
24430                                               is_little, !is_unsigned);
24431                 Py_DECREF(v);
24432                 if (likely(!ret))
24433                     return val;
24434             }
24435 #endif
24436             return (long) -1;
24437         }
24438     } else {
24439         long val;
24440         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24441         if (!tmp) return (long) -1;
24442         val = __Pyx_PyInt_As_long(tmp);
24443         Py_DECREF(tmp);
24444         return val;
24445     }
24446 raise_overflow:
24447     PyErr_SetString(PyExc_OverflowError,
24448         "value too large to convert to long");
24449     return (long) -1;
24450 raise_neg_overflow:
24451     PyErr_SetString(PyExc_OverflowError,
24452         "can't convert negative value to long");
24453     return (long) -1;
24454 }
24455 
24456 /* CIntToPy */
__Pyx_PyInt_From_long(long value)24457   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
24458     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
24459     const int is_unsigned = neg_one > const_zero;
24460     if (is_unsigned) {
24461         if (sizeof(long) < sizeof(long)) {
24462             return PyInt_FromLong((long) value);
24463         } else if (sizeof(long) <= sizeof(unsigned long)) {
24464             return PyLong_FromUnsignedLong((unsigned long) value);
24465 #ifdef HAVE_LONG_LONG
24466         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24467             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24468 #endif
24469         }
24470     } else {
24471         if (sizeof(long) <= sizeof(long)) {
24472             return PyInt_FromLong((long) value);
24473 #ifdef HAVE_LONG_LONG
24474         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24475             return PyLong_FromLongLong((PY_LONG_LONG) value);
24476 #endif
24477         }
24478     }
24479     {
24480         int one = 1; int little = (int)*(unsigned char *)&one;
24481         unsigned char *bytes = (unsigned char *)&value;
24482         return _PyLong_FromByteArray(bytes, sizeof(long),
24483                                      little, !is_unsigned);
24484     }
24485 }
24486 
24487 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)24488   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
24489     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
24490     const int is_unsigned = neg_one > const_zero;
24491 #if PY_MAJOR_VERSION < 3
24492     if (likely(PyInt_Check(x))) {
24493         if (sizeof(char) < sizeof(long)) {
24494             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
24495         } else {
24496             long val = PyInt_AS_LONG(x);
24497             if (is_unsigned && unlikely(val < 0)) {
24498                 goto raise_neg_overflow;
24499             }
24500             return (char) val;
24501         }
24502     } else
24503 #endif
24504     if (likely(PyLong_Check(x))) {
24505         if (is_unsigned) {
24506 #if CYTHON_USE_PYLONG_INTERNALS
24507             const digit* digits = ((PyLongObject*)x)->ob_digit;
24508             switch (Py_SIZE(x)) {
24509                 case  0: return (char) 0;
24510                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
24511                 case 2:
24512                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
24513                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24514                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24515                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
24516                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24517                         }
24518                     }
24519                     break;
24520                 case 3:
24521                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
24522                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24523                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24524                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
24525                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24526                         }
24527                     }
24528                     break;
24529                 case 4:
24530                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
24531                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24532                             __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])))
24533                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
24534                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24535                         }
24536                     }
24537                     break;
24538             }
24539 #endif
24540 #if CYTHON_COMPILING_IN_CPYTHON
24541             if (unlikely(Py_SIZE(x) < 0)) {
24542                 goto raise_neg_overflow;
24543             }
24544 #else
24545             {
24546                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24547                 if (unlikely(result < 0))
24548                     return (char) -1;
24549                 if (unlikely(result == 1))
24550                     goto raise_neg_overflow;
24551             }
24552 #endif
24553             if (sizeof(char) <= sizeof(unsigned long)) {
24554                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
24555 #ifdef HAVE_LONG_LONG
24556             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
24557                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24558 #endif
24559             }
24560         } else {
24561 #if CYTHON_USE_PYLONG_INTERNALS
24562             const digit* digits = ((PyLongObject*)x)->ob_digit;
24563             switch (Py_SIZE(x)) {
24564                 case  0: return (char) 0;
24565                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
24566                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
24567                 case -2:
24568                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
24569                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24570                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24571                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
24572                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24573                         }
24574                     }
24575                     break;
24576                 case 2:
24577                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
24578                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24579                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24580                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
24581                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24582                         }
24583                     }
24584                     break;
24585                 case -3:
24586                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
24587                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24588                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24589                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
24590                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24591                         }
24592                     }
24593                     break;
24594                 case 3:
24595                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
24596                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24597                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24598                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
24599                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24600                         }
24601                     }
24602                     break;
24603                 case -4:
24604                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
24605                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24606                             __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])))
24607                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
24608                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24609                         }
24610                     }
24611                     break;
24612                 case 4:
24613                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
24614                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24615                             __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])))
24616                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
24617                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24618                         }
24619                     }
24620                     break;
24621             }
24622 #endif
24623             if (sizeof(char) <= sizeof(long)) {
24624                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
24625 #ifdef HAVE_LONG_LONG
24626             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
24627                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
24628 #endif
24629             }
24630         }
24631         {
24632 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24633             PyErr_SetString(PyExc_RuntimeError,
24634                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24635 #else
24636             char val;
24637             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24638  #if PY_MAJOR_VERSION < 3
24639             if (likely(v) && !PyLong_Check(v)) {
24640                 PyObject *tmp = v;
24641                 v = PyNumber_Long(tmp);
24642                 Py_DECREF(tmp);
24643             }
24644  #endif
24645             if (likely(v)) {
24646                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24647                 unsigned char *bytes = (unsigned char *)&val;
24648                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24649                                               bytes, sizeof(val),
24650                                               is_little, !is_unsigned);
24651                 Py_DECREF(v);
24652                 if (likely(!ret))
24653                     return val;
24654             }
24655 #endif
24656             return (char) -1;
24657         }
24658     } else {
24659         char val;
24660         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24661         if (!tmp) return (char) -1;
24662         val = __Pyx_PyInt_As_char(tmp);
24663         Py_DECREF(tmp);
24664         return val;
24665     }
24666 raise_overflow:
24667     PyErr_SetString(PyExc_OverflowError,
24668         "value too large to convert to char");
24669     return (char) -1;
24670 raise_neg_overflow:
24671     PyErr_SetString(PyExc_OverflowError,
24672         "can't convert negative value to char");
24673     return (char) -1;
24674 }
24675 
24676 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)24677   static int __Pyx_check_binary_version(void) {
24678     char ctversion[4], rtversion[4];
24679     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24680     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
24681     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
24682         char message[200];
24683         PyOS_snprintf(message, sizeof(message),
24684                       "compiletime version %s of module '%.100s' "
24685                       "does not match runtime version %s",
24686                       ctversion, __Pyx_MODULE_NAME, rtversion);
24687         return PyErr_WarnEx(NULL, message, 1);
24688     }
24689     return 0;
24690 }
24691 
24692 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)24693   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24694     while (t->p) {
24695         #if PY_MAJOR_VERSION < 3
24696         if (t->is_unicode) {
24697             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24698         } else if (t->intern) {
24699             *t->p = PyString_InternFromString(t->s);
24700         } else {
24701             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24702         }
24703         #else
24704         if (t->is_unicode | t->is_str) {
24705             if (t->intern) {
24706                 *t->p = PyUnicode_InternFromString(t->s);
24707             } else if (t->encoding) {
24708                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24709             } else {
24710                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24711             }
24712         } else {
24713             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24714         }
24715         #endif
24716         if (!*t->p)
24717             return -1;
24718         if (PyObject_Hash(*t->p) == -1)
24719             return -1;
24720         ++t;
24721     }
24722     return 0;
24723 }
24724 
__Pyx_PyUnicode_FromString(const char * c_str)24725 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
24726     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24727 }
__Pyx_PyObject_AsString(PyObject * o)24728 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
24729     Py_ssize_t ignore;
24730     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24731 }
24732 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24733 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)24734 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24735     char* defenc_c;
24736     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24737     if (!defenc) return NULL;
24738     defenc_c = PyBytes_AS_STRING(defenc);
24739 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24740     {
24741         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24742         char* c;
24743         for (c = defenc_c; c < end; c++) {
24744             if ((unsigned char) (*c) >= 128) {
24745                 PyUnicode_AsASCIIString(o);
24746                 return NULL;
24747             }
24748         }
24749     }
24750 #endif
24751     *length = PyBytes_GET_SIZE(defenc);
24752     return defenc_c;
24753 }
24754 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)24755 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24756     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
24757 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24758     if (likely(PyUnicode_IS_ASCII(o))) {
24759         *length = PyUnicode_GET_LENGTH(o);
24760         return PyUnicode_AsUTF8(o);
24761     } else {
24762         PyUnicode_AsASCIIString(o);
24763         return NULL;
24764     }
24765 #else
24766     return PyUnicode_AsUTF8AndSize(o, length);
24767 #endif
24768 }
24769 #endif
24770 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)24771 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24772 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24773     if (
24774 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24775             __Pyx_sys_getdefaultencoding_not_ascii &&
24776 #endif
24777             PyUnicode_Check(o)) {
24778         return __Pyx_PyUnicode_AsStringAndSize(o, length);
24779     } else
24780 #endif
24781 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
24782     if (PyByteArray_Check(o)) {
24783         *length = PyByteArray_GET_SIZE(o);
24784         return PyByteArray_AS_STRING(o);
24785     } else
24786 #endif
24787     {
24788         char* result;
24789         int r = PyBytes_AsStringAndSize(o, &result, length);
24790         if (unlikely(r < 0)) {
24791             return NULL;
24792         } else {
24793             return result;
24794         }
24795     }
24796 }
__Pyx_PyObject_IsTrue(PyObject * x)24797 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
24798    int is_true = x == Py_True;
24799    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
24800    else return PyObject_IsTrue(x);
24801 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)24802 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
24803     int retval;
24804     if (unlikely(!x)) return -1;
24805     retval = __Pyx_PyObject_IsTrue(x);
24806     Py_DECREF(x);
24807     return retval;
24808 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)24809 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
24810 #if PY_MAJOR_VERSION >= 3
24811     if (PyLong_Check(result)) {
24812         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24813                 "__int__ returned non-int (type %.200s).  "
24814                 "The ability to return an instance of a strict subclass of int "
24815                 "is deprecated, and may be removed in a future version of Python.",
24816                 Py_TYPE(result)->tp_name)) {
24817             Py_DECREF(result);
24818             return NULL;
24819         }
24820         return result;
24821     }
24822 #endif
24823     PyErr_Format(PyExc_TypeError,
24824                  "__%.4s__ returned non-%.4s (type %.200s)",
24825                  type_name, type_name, Py_TYPE(result)->tp_name);
24826     Py_DECREF(result);
24827     return NULL;
24828 }
__Pyx_PyNumber_IntOrLong(PyObject * x)24829 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24830 #if CYTHON_USE_TYPE_SLOTS
24831   PyNumberMethods *m;
24832 #endif
24833   const char *name = NULL;
24834   PyObject *res = NULL;
24835 #if PY_MAJOR_VERSION < 3
24836   if (likely(PyInt_Check(x) || PyLong_Check(x)))
24837 #else
24838   if (likely(PyLong_Check(x)))
24839 #endif
24840     return __Pyx_NewRef(x);
24841 #if CYTHON_USE_TYPE_SLOTS
24842   m = Py_TYPE(x)->tp_as_number;
24843   #if PY_MAJOR_VERSION < 3
24844   if (m && m->nb_int) {
24845     name = "int";
24846     res = m->nb_int(x);
24847   }
24848   else if (m && m->nb_long) {
24849     name = "long";
24850     res = m->nb_long(x);
24851   }
24852   #else
24853   if (likely(m && m->nb_int)) {
24854     name = "int";
24855     res = m->nb_int(x);
24856   }
24857   #endif
24858 #else
24859   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24860     res = PyNumber_Int(x);
24861   }
24862 #endif
24863   if (likely(res)) {
24864 #if PY_MAJOR_VERSION < 3
24865     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24866 #else
24867     if (unlikely(!PyLong_CheckExact(res))) {
24868 #endif
24869         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24870     }
24871   }
24872   else if (!PyErr_Occurred()) {
24873     PyErr_SetString(PyExc_TypeError,
24874                     "an integer is required");
24875   }
24876   return res;
24877 }
24878 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24879   Py_ssize_t ival;
24880   PyObject *x;
24881 #if PY_MAJOR_VERSION < 3
24882   if (likely(PyInt_CheckExact(b))) {
24883     if (sizeof(Py_ssize_t) >= sizeof(long))
24884         return PyInt_AS_LONG(b);
24885     else
24886         return PyInt_AsSsize_t(b);
24887   }
24888 #endif
24889   if (likely(PyLong_CheckExact(b))) {
24890     #if CYTHON_USE_PYLONG_INTERNALS
24891     const digit* digits = ((PyLongObject*)b)->ob_digit;
24892     const Py_ssize_t size = Py_SIZE(b);
24893     if (likely(__Pyx_sst_abs(size) <= 1)) {
24894         ival = likely(size) ? digits[0] : 0;
24895         if (size == -1) ival = -ival;
24896         return ival;
24897     } else {
24898       switch (size) {
24899          case 2:
24900            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24901              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24902            }
24903            break;
24904          case -2:
24905            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24906              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24907            }
24908            break;
24909          case 3:
24910            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24911              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24912            }
24913            break;
24914          case -3:
24915            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24916              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24917            }
24918            break;
24919          case 4:
24920            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24921              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]));
24922            }
24923            break;
24924          case -4:
24925            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24926              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]));
24927            }
24928            break;
24929       }
24930     }
24931     #endif
24932     return PyLong_AsSsize_t(b);
24933   }
24934   x = PyNumber_Index(b);
24935   if (!x) return -1;
24936   ival = PyInt_AsSsize_t(x);
24937   Py_DECREF(x);
24938   return ival;
24939 }
24940 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
24941   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24942 }
24943 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
24944     return PyInt_FromSize_t(ival);
24945 }
24946 
24947 
24948 #endif /* Py_PYTHON_H */
24949