1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/platform_dep.h"
8         ],
9         "include_dirs": [
10             "./yt/utilities/lib",
11             "yt/utilities/lib"
12         ],
13         "libraries": [
14             "m"
15         ],
16         "name": "yt.utilities.lib.lenses",
17         "sources": [
18             "yt/utilities/lib/lenses.pyx"
19         ]
20     },
21     "module_name": "yt.utilities.lib.lenses"
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 CYTHON_INLINE
310   #if defined(__clang__)
311     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312   #elif defined(__GNUC__)
313     #define CYTHON_INLINE __inline__
314   #elif defined(_MSC_VER)
315     #define CYTHON_INLINE __inline
316   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
317     #define CYTHON_INLINE inline
318   #else
319     #define CYTHON_INLINE
320   #endif
321 #endif
322 
323 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
324   #define Py_OptimizeFlag 0
325 #endif
326 #define __PYX_BUILD_PY_SSIZE_T "n"
327 #define CYTHON_FORMAT_SSIZE_T "z"
328 #if PY_MAJOR_VERSION < 3
329   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
330   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332   #define __Pyx_DefaultClassType PyClass_Type
333 #else
334   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
335 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #else
339   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
340           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
341 #endif
342   #define __Pyx_DefaultClassType PyType_Type
343 #endif
344 #ifndef Py_TPFLAGS_CHECKTYPES
345   #define Py_TPFLAGS_CHECKTYPES 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_INDEX
348   #define Py_TPFLAGS_HAVE_INDEX 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
351   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
352 #endif
353 #ifndef Py_TPFLAGS_HAVE_FINALIZE
354   #define Py_TPFLAGS_HAVE_FINALIZE 0
355 #endif
356 #ifndef METH_STACKLESS
357   #define METH_STACKLESS 0
358 #endif
359 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
360   #ifndef METH_FASTCALL
361      #define METH_FASTCALL 0x80
362   #endif
363   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
364   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
365                                                           Py_ssize_t nargs, PyObject *kwnames);
366 #else
367   #define __Pyx_PyCFunctionFast _PyCFunctionFast
368   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
369 #endif
370 #if CYTHON_FAST_PYCCALL
371 #define __Pyx_PyFastCFunction_Check(func)\
372     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
373 #else
374 #define __Pyx_PyFastCFunction_Check(func) 0
375 #endif
376 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
377   #define PyObject_Malloc(s)   PyMem_Malloc(s)
378   #define PyObject_Free(p)     PyMem_Free(p)
379   #define PyObject_Realloc(p)  PyMem_Realloc(p)
380 #endif
381 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
382   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
383   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
384   #define PyMem_RawFree(p)             PyMem_Free(p)
385 #endif
386 #if CYTHON_COMPILING_IN_PYSTON
387   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
389 #else
390   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
391   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
392 #endif
393 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
394   #define __Pyx_PyThreadState_Current PyThreadState_GET()
395 #elif PY_VERSION_HEX >= 0x03060000
396   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
397 #elif PY_VERSION_HEX >= 0x03000000
398   #define __Pyx_PyThreadState_Current PyThreadState_GET()
399 #else
400   #define __Pyx_PyThreadState_Current _PyThreadState_Current
401 #endif
402 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
403 #include "pythread.h"
404 #define Py_tss_NEEDS_INIT 0
405 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)406 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
407   *key = PyThread_create_key();
408   return 0;
409 }
PyThread_tss_alloc(void)410 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
411   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
412   *key = Py_tss_NEEDS_INIT;
413   return key;
414 }
PyThread_tss_free(Py_tss_t * key)415 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
416   PyObject_Free(key);
417 }
PyThread_tss_is_created(Py_tss_t * key)418 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
419   return *key != Py_tss_NEEDS_INIT;
420 }
PyThread_tss_delete(Py_tss_t * key)421 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
422   PyThread_delete_key(*key);
423   *key = Py_tss_NEEDS_INIT;
424 }
PyThread_tss_set(Py_tss_t * key,void * value)425 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
426   return PyThread_set_key_value(*key, value);
427 }
PyThread_tss_get(Py_tss_t * key)428 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
429   return PyThread_get_key_value(*key);
430 }
431 #endif
432 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
433 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
434 #else
435 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
436 #endif
437 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
440 #else
441   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
442   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
443 #endif
444 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
445 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
446 #else
447 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
448 #endif
449 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
450   #define CYTHON_PEP393_ENABLED 1
451   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
452                                               0 : _PyUnicode_Ready((PyObject *)(op)))
453   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
454   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
455   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
456   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
457   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
458   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
459   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
460   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
461 #else
462   #define CYTHON_PEP393_ENABLED 0
463   #define PyUnicode_1BYTE_KIND  1
464   #define PyUnicode_2BYTE_KIND  2
465   #define PyUnicode_4BYTE_KIND  4
466   #define __Pyx_PyUnicode_READY(op)       (0)
467   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
468   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
469   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
470   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
471   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
472   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
473   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY
477   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
479 #else
480   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
481   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
482       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
485   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
488   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
491   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
492 #endif
493 #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))
494 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
497 #else
498   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
499 #endif
500 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
501   #define PyObject_ASCII(o)            PyObject_Repr(o)
502 #endif
503 #if PY_MAJOR_VERSION >= 3
504   #define PyBaseString_Type            PyUnicode_Type
505   #define PyStringObject               PyUnicodeObject
506   #define PyString_Type                PyUnicode_Type
507   #define PyString_Check               PyUnicode_Check
508   #define PyString_CheckExact          PyUnicode_CheckExact
509   #define PyObject_Unicode             PyObject_Str
510 #endif
511 #if PY_MAJOR_VERSION >= 3
512   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
513   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
514 #else
515   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
516   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
517 #endif
518 #ifndef PySet_CheckExact
519   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
520 #endif
521 #if CYTHON_ASSUME_SAFE_MACROS
522   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
523 #else
524   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
525 #endif
526 #if PY_MAJOR_VERSION >= 3
527   #define PyIntObject                  PyLongObject
528   #define PyInt_Type                   PyLong_Type
529   #define PyInt_Check(op)              PyLong_Check(op)
530   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
531   #define PyInt_FromString             PyLong_FromString
532   #define PyInt_FromUnicode            PyLong_FromUnicode
533   #define PyInt_FromLong               PyLong_FromLong
534   #define PyInt_FromSize_t             PyLong_FromSize_t
535   #define PyInt_FromSsize_t            PyLong_FromSsize_t
536   #define PyInt_AsLong                 PyLong_AsLong
537   #define PyInt_AS_LONG                PyLong_AS_LONG
538   #define PyInt_AsSsize_t              PyLong_AsSsize_t
539   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
540   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
541   #define PyNumber_Int                 PyNumber_Long
542 #endif
543 #if PY_MAJOR_VERSION >= 3
544   #define PyBoolObject                 PyLongObject
545 #endif
546 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
547   #ifndef PyUnicode_InternFromString
548     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
549   #endif
550 #endif
551 #if PY_VERSION_HEX < 0x030200A4
552   typedef long Py_hash_t;
553   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
555 #else
556   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
557   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
558 #endif
559 #if PY_MAJOR_VERSION >= 3
560   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
561 #else
562   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
563 #endif
564 #if CYTHON_USE_ASYNC_SLOTS
565   #if PY_VERSION_HEX >= 0x030500B1
566     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
567     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
568   #else
569     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
570   #endif
571 #else
572   #define __Pyx_PyType_AsAsync(obj) NULL
573 #endif
574 #ifndef __Pyx_PyAsyncMethodsStruct
575     typedef struct {
576         unaryfunc am_await;
577         unaryfunc am_aiter;
578         unaryfunc am_anext;
579     } __Pyx_PyAsyncMethodsStruct;
580 #endif
581 
582 #if defined(WIN32) || defined(MS_WINDOWS)
583   #define _USE_MATH_DEFINES
584 #endif
585 #include <math.h>
586 #ifdef NAN
587 #define __PYX_NAN() ((float) NAN)
588 #else
__PYX_NAN()589 static CYTHON_INLINE float __PYX_NAN() {
590   float value;
591   memset(&value, 0xFF, sizeof(value));
592   return value;
593 }
594 #endif
595 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
596 #define __Pyx_truncl trunc
597 #else
598 #define __Pyx_truncl truncl
599 #endif
600 
601 
602 #define __PYX_ERR(f_index, lineno, Ln_error) \
603 { \
604   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
605 }
606 
607 #ifndef __PYX_EXTERN_C
608   #ifdef __cplusplus
609     #define __PYX_EXTERN_C extern "C"
610   #else
611     #define __PYX_EXTERN_C extern
612   #endif
613 #endif
614 
615 #define __PYX_HAVE__yt__utilities__lib__lenses
616 #define __PYX_HAVE_API__yt__utilities__lib__lenses
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ufuncobject.h"
622 #include <math.h>
623 #include "platform_dep.h"
624 #include "limits.h"
625 #include "pythread.h"
626 #include <stdlib.h>
627 #include "pystate.h"
628 #ifdef _OPENMP
629 #include <omp.h>
630 #endif /* _OPENMP */
631 
632 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
633 #define CYTHON_WITHOUT_ASSERTIONS
634 #endif
635 
636 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
637                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
638 
639 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
640 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
641 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
642 #define __PYX_DEFAULT_STRING_ENCODING ""
643 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
644 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
645 #define __Pyx_uchar_cast(c) ((unsigned char)c)
646 #define __Pyx_long_cast(x) ((long)x)
647 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
648     (sizeof(type) < sizeof(Py_ssize_t))  ||\
649     (sizeof(type) > sizeof(Py_ssize_t) &&\
650           likely(v < (type)PY_SSIZE_T_MAX ||\
651                  v == (type)PY_SSIZE_T_MAX)  &&\
652           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
653                                 v == (type)PY_SSIZE_T_MIN)))  ||\
654     (sizeof(type) == sizeof(Py_ssize_t) &&\
655           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
656                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)657 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
658     return (size_t) i < (size_t) limit;
659 }
660 #if defined (__cplusplus) && __cplusplus >= 201103L
661     #include <cstdlib>
662     #define __Pyx_sst_abs(value) std::abs(value)
663 #elif SIZEOF_INT >= SIZEOF_SIZE_T
664     #define __Pyx_sst_abs(value) abs(value)
665 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
666     #define __Pyx_sst_abs(value) labs(value)
667 #elif defined (_MSC_VER)
668     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
669 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
670     #define __Pyx_sst_abs(value) llabs(value)
671 #elif defined (__GNUC__)
672     #define __Pyx_sst_abs(value) __builtin_llabs(value)
673 #else
674     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
675 #endif
676 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
677 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
678 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
679 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
680 #define __Pyx_PyBytes_FromString        PyBytes_FromString
681 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
682 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
683 #if PY_MAJOR_VERSION < 3
684     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
685     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
686 #else
687     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
688     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
689 #endif
690 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
691 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
692 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
697 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
698 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
702 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
703 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
704 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
705 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)706 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
707     const Py_UNICODE *u_end = u;
708     while (*u_end++) ;
709     return (size_t)(u_end - u - 1);
710 }
711 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
712 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
713 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
714 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
715 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
716 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
717 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
718 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
719 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
720 #define __Pyx_PySequence_Tuple(obj)\
721     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
722 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
723 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
724 #if CYTHON_ASSUME_SAFE_MACROS
725 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
726 #else
727 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
728 #endif
729 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
730 #if PY_MAJOR_VERSION >= 3
731 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
732 #else
733 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
734 #endif
735 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
736 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
737 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)738 static int __Pyx_init_sys_getdefaultencoding_params(void) {
739     PyObject* sys;
740     PyObject* default_encoding = NULL;
741     PyObject* ascii_chars_u = NULL;
742     PyObject* ascii_chars_b = NULL;
743     const char* default_encoding_c;
744     sys = PyImport_ImportModule("sys");
745     if (!sys) goto bad;
746     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
747     Py_DECREF(sys);
748     if (!default_encoding) goto bad;
749     default_encoding_c = PyBytes_AsString(default_encoding);
750     if (!default_encoding_c) goto bad;
751     if (strcmp(default_encoding_c, "ascii") == 0) {
752         __Pyx_sys_getdefaultencoding_not_ascii = 0;
753     } else {
754         char ascii_chars[128];
755         int c;
756         for (c = 0; c < 128; c++) {
757             ascii_chars[c] = c;
758         }
759         __Pyx_sys_getdefaultencoding_not_ascii = 1;
760         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
761         if (!ascii_chars_u) goto bad;
762         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
763         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
764             PyErr_Format(
765                 PyExc_ValueError,
766                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
767                 default_encoding_c);
768             goto bad;
769         }
770         Py_DECREF(ascii_chars_u);
771         Py_DECREF(ascii_chars_b);
772     }
773     Py_DECREF(default_encoding);
774     return 0;
775 bad:
776     Py_XDECREF(default_encoding);
777     Py_XDECREF(ascii_chars_u);
778     Py_XDECREF(ascii_chars_b);
779     return -1;
780 }
781 #endif
782 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
783 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
784 #else
785 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
786 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
787 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)788 static int __Pyx_init_sys_getdefaultencoding_params(void) {
789     PyObject* sys;
790     PyObject* default_encoding = NULL;
791     char* default_encoding_c;
792     sys = PyImport_ImportModule("sys");
793     if (!sys) goto bad;
794     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
795     Py_DECREF(sys);
796     if (!default_encoding) goto bad;
797     default_encoding_c = PyBytes_AsString(default_encoding);
798     if (!default_encoding_c) goto bad;
799     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
800     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
801     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
802     Py_DECREF(default_encoding);
803     return 0;
804 bad:
805     Py_XDECREF(default_encoding);
806     return -1;
807 }
808 #endif
809 #endif
810 
811 
812 /* Test for GCC > 2.95 */
813 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
814   #define likely(x)   __builtin_expect(!!(x), 1)
815   #define unlikely(x) __builtin_expect(!!(x), 0)
816 #else /* !__GNUC__ or GCC < 2.95 */
817   #define likely(x)   (x)
818   #define unlikely(x) (x)
819 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)820 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
821 
822 static PyObject *__pyx_m = NULL;
823 static PyObject *__pyx_d;
824 static PyObject *__pyx_b;
825 static PyObject *__pyx_cython_runtime = NULL;
826 static PyObject *__pyx_empty_tuple;
827 static PyObject *__pyx_empty_bytes;
828 static PyObject *__pyx_empty_unicode;
829 static int __pyx_lineno;
830 static int __pyx_clineno = 0;
831 static const char * __pyx_cfilenm= __FILE__;
832 static const char *__pyx_filename;
833 
834 /* Header.proto */
835 #if !defined(CYTHON_CCOMPLEX)
836   #if defined(__cplusplus)
837     #define CYTHON_CCOMPLEX 1
838   #elif defined(_Complex_I)
839     #define CYTHON_CCOMPLEX 1
840   #else
841     #define CYTHON_CCOMPLEX 0
842   #endif
843 #endif
844 #if CYTHON_CCOMPLEX
845   #ifdef __cplusplus
846     #include <complex>
847   #else
848     #include <complex.h>
849   #endif
850 #endif
851 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
852   #undef _Complex_I
853   #define _Complex_I 1.0fj
854 #endif
855 
856 
857 static const char *__pyx_f[] = {
858   "yt/utilities/lib/lenses.pyx",
859   "__init__.pxd",
860   "yt/utilities/lib/fp_utils.pxd",
861   "stringsource",
862   "type.pxd",
863   "yt/utilities/lib/partitioned_grid.pxd",
864   "yt/utilities/lib/image_samplers.pxd",
865 };
866 /* ForceInitThreads.proto */
867 #ifndef __PYX_FORCE_INIT_THREADS
868   #define __PYX_FORCE_INIT_THREADS 0
869 #endif
870 
871 /* NoFastGil.proto */
872 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
873 #define __Pyx_PyGILState_Release PyGILState_Release
874 #define __Pyx_FastGIL_Remember()
875 #define __Pyx_FastGIL_Forget()
876 #define __Pyx_FastGilFuncInit()
877 
878 /* BufferFormatStructs.proto */
879 #define IS_UNSIGNED(type) (((type) -1) > 0)
880 struct __Pyx_StructField_;
881 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
882 typedef struct {
883   const char* name;
884   struct __Pyx_StructField_* fields;
885   size_t size;
886   size_t arraysize[8];
887   int ndim;
888   char typegroup;
889   char is_unsigned;
890   int flags;
891 } __Pyx_TypeInfo;
892 typedef struct __Pyx_StructField_ {
893   __Pyx_TypeInfo* type;
894   const char* name;
895   size_t offset;
896 } __Pyx_StructField;
897 typedef struct {
898   __Pyx_StructField* field;
899   size_t parent_offset;
900 } __Pyx_BufFmt_StackElem;
901 typedef struct {
902   __Pyx_StructField root;
903   __Pyx_BufFmt_StackElem* head;
904   size_t fmt_offset;
905   size_t new_count, enc_count;
906   size_t struct_alignment;
907   int is_complex;
908   char enc_type;
909   char new_packmode;
910   char enc_packmode;
911   char is_valid_array;
912 } __Pyx_BufFmt_Context;
913 
914 /* Atomics.proto */
915 #include <pythread.h>
916 #ifndef CYTHON_ATOMICS
917     #define CYTHON_ATOMICS 1
918 #endif
919 #define __pyx_atomic_int_type int
920 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
921                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
922                     !defined(__i386__)
923     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
924     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
925     #ifdef __PYX_DEBUG_ATOMICS
926         #warning "Using GNU atomics"
927     #endif
928 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
929     #include <Windows.h>
930     #undef __pyx_atomic_int_type
931     #define __pyx_atomic_int_type LONG
932     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
933     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
934     #ifdef __PYX_DEBUG_ATOMICS
935         #pragma message ("Using MSVC atomics")
936     #endif
937 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
938     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
939     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
940     #ifdef __PYX_DEBUG_ATOMICS
941         #warning "Using Intel atomics"
942     #endif
943 #else
944     #undef CYTHON_ATOMICS
945     #define CYTHON_ATOMICS 0
946     #ifdef __PYX_DEBUG_ATOMICS
947         #warning "Not using atomics"
948     #endif
949 #endif
950 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
951 #if CYTHON_ATOMICS
952     #define __pyx_add_acquisition_count(memview)\
953              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
954     #define __pyx_sub_acquisition_count(memview)\
955             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
956 #else
957     #define __pyx_add_acquisition_count(memview)\
958             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
959     #define __pyx_sub_acquisition_count(memview)\
960             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
961 #endif
962 
963 /* MemviewSliceStruct.proto */
964 struct __pyx_memoryview_obj;
965 typedef struct {
966   struct __pyx_memoryview_obj *memview;
967   char *data;
968   Py_ssize_t shape[8];
969   Py_ssize_t strides[8];
970   Py_ssize_t suboffsets[8];
971 } __Pyx_memviewslice;
972 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
973 
974 
975 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
976  * # in Cython to enable them only on the right systems.
977  *
978  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
979  * ctypedef npy_int16      int16_t
980  * ctypedef npy_int32      int32_t
981  */
982 typedef npy_int8 __pyx_t_5numpy_int8_t;
983 
984 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
985  *
986  * ctypedef npy_int8       int8_t
987  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
988  * ctypedef npy_int32      int32_t
989  * ctypedef npy_int64      int64_t
990  */
991 typedef npy_int16 __pyx_t_5numpy_int16_t;
992 
993 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
994  * ctypedef npy_int8       int8_t
995  * ctypedef npy_int16      int16_t
996  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
997  * ctypedef npy_int64      int64_t
998  * #ctypedef npy_int96      int96_t
999  */
1000 typedef npy_int32 __pyx_t_5numpy_int32_t;
1001 
1002 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1003  * ctypedef npy_int16      int16_t
1004  * ctypedef npy_int32      int32_t
1005  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1006  * #ctypedef npy_int96      int96_t
1007  * #ctypedef npy_int128     int128_t
1008  */
1009 typedef npy_int64 __pyx_t_5numpy_int64_t;
1010 
1011 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1012  * #ctypedef npy_int128     int128_t
1013  *
1014  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1015  * ctypedef npy_uint16     uint16_t
1016  * ctypedef npy_uint32     uint32_t
1017  */
1018 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1019 
1020 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1021  *
1022  * ctypedef npy_uint8      uint8_t
1023  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1024  * ctypedef npy_uint32     uint32_t
1025  * ctypedef npy_uint64     uint64_t
1026  */
1027 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1028 
1029 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1030  * ctypedef npy_uint8      uint8_t
1031  * ctypedef npy_uint16     uint16_t
1032  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1033  * ctypedef npy_uint64     uint64_t
1034  * #ctypedef npy_uint96     uint96_t
1035  */
1036 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1037 
1038 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1039  * ctypedef npy_uint16     uint16_t
1040  * ctypedef npy_uint32     uint32_t
1041  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1042  * #ctypedef npy_uint96     uint96_t
1043  * #ctypedef npy_uint128    uint128_t
1044  */
1045 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1046 
1047 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1048  * #ctypedef npy_uint128    uint128_t
1049  *
1050  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1051  * ctypedef npy_float64    float64_t
1052  * #ctypedef npy_float80    float80_t
1053  */
1054 typedef npy_float32 __pyx_t_5numpy_float32_t;
1055 
1056 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1057  *
1058  * ctypedef npy_float32    float32_t
1059  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1060  * #ctypedef npy_float80    float80_t
1061  * #ctypedef npy_float128   float128_t
1062  */
1063 typedef npy_float64 __pyx_t_5numpy_float64_t;
1064 
1065 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1066  * # The int types are mapped a bit surprising --
1067  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1068  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1069  * ctypedef npy_longlong   long_t
1070  * ctypedef npy_longlong   longlong_t
1071  */
1072 typedef npy_long __pyx_t_5numpy_int_t;
1073 
1074 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1075  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1076  * ctypedef npy_long       int_t
1077  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1078  * ctypedef npy_longlong   longlong_t
1079  *
1080  */
1081 typedef npy_longlong __pyx_t_5numpy_long_t;
1082 
1083 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1084  * ctypedef npy_long       int_t
1085  * ctypedef npy_longlong   long_t
1086  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1087  *
1088  * ctypedef npy_ulong      uint_t
1089  */
1090 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1091 
1092 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1093  * ctypedef npy_longlong   longlong_t
1094  *
1095  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1096  * ctypedef npy_ulonglong  ulong_t
1097  * ctypedef npy_ulonglong  ulonglong_t
1098  */
1099 typedef npy_ulong __pyx_t_5numpy_uint_t;
1100 
1101 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1102  *
1103  * ctypedef npy_ulong      uint_t
1104  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1105  * ctypedef npy_ulonglong  ulonglong_t
1106  *
1107  */
1108 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1109 
1110 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1111  * ctypedef npy_ulong      uint_t
1112  * ctypedef npy_ulonglong  ulong_t
1113  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1114  *
1115  * ctypedef npy_intp       intp_t
1116  */
1117 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1118 
1119 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1120  * ctypedef npy_ulonglong  ulonglong_t
1121  *
1122  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1123  * ctypedef npy_uintp      uintp_t
1124  *
1125  */
1126 typedef npy_intp __pyx_t_5numpy_intp_t;
1127 
1128 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1129  *
1130  * ctypedef npy_intp       intp_t
1131  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1132  *
1133  * ctypedef npy_double     float_t
1134  */
1135 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1136 
1137 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1138  * ctypedef npy_uintp      uintp_t
1139  *
1140  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1141  * ctypedef npy_double     double_t
1142  * ctypedef npy_longdouble longdouble_t
1143  */
1144 typedef npy_double __pyx_t_5numpy_float_t;
1145 
1146 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1147  *
1148  * ctypedef npy_double     float_t
1149  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1150  * ctypedef npy_longdouble longdouble_t
1151  *
1152  */
1153 typedef npy_double __pyx_t_5numpy_double_t;
1154 
1155 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1156  * ctypedef npy_double     float_t
1157  * ctypedef npy_double     double_t
1158  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1159  *
1160  * ctypedef npy_cfloat      cfloat_t
1161  */
1162 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1163 /* Declarations.proto */
1164 #if CYTHON_CCOMPLEX
1165   #ifdef __cplusplus
1166     typedef ::std::complex< float > __pyx_t_float_complex;
1167   #else
1168     typedef float _Complex __pyx_t_float_complex;
1169   #endif
1170 #else
1171     typedef struct { float real, imag; } __pyx_t_float_complex;
1172 #endif
1173 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1174 
1175 /* Declarations.proto */
1176 #if CYTHON_CCOMPLEX
1177   #ifdef __cplusplus
1178     typedef ::std::complex< double > __pyx_t_double_complex;
1179   #else
1180     typedef double _Complex __pyx_t_double_complex;
1181   #endif
1182 #else
1183     typedef struct { double real, imag; } __pyx_t_double_complex;
1184 #endif
1185 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1186 
1187 
1188 /*--- Type declarations ---*/
1189 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1190 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler;
1191 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler;
1192 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler;
1193 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler;
1194 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler;
1195 struct __pyx_array_obj;
1196 struct __pyx_MemviewEnum_obj;
1197 struct __pyx_memoryview_obj;
1198 struct __pyx_memoryviewslice_obj;
1199 
1200 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1201  * ctypedef npy_longdouble longdouble_t
1202  *
1203  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1204  * ctypedef npy_cdouble     cdouble_t
1205  * ctypedef npy_clongdouble clongdouble_t
1206  */
1207 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1208 
1209 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1210  *
1211  * ctypedef npy_cfloat      cfloat_t
1212  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1213  * ctypedef npy_clongdouble clongdouble_t
1214  *
1215  */
1216 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1217 
1218 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1219  * ctypedef npy_cfloat      cfloat_t
1220  * ctypedef npy_cdouble     cdouble_t
1221  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1222  *
1223  * ctypedef npy_cdouble     complex_t
1224  */
1225 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1226 
1227 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1228  * ctypedef npy_clongdouble clongdouble_t
1229  *
1230  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1231  *
1232  * cdef inline object PyArray_MultiIterNew1(a):
1233  */
1234 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1235 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer;
1236 
1237 /* "volume_container.pxd":13
1238  *
1239  *
1240  * cdef struct VolumeContainer:             # <<<<<<<<<<<<<<
1241  *     #-----------------------------------------------------------------------------
1242  *     # Encapsulates a volume container used for volume rendering.
1243  */
1244 struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer {
1245   int n_fields;
1246   __pyx_t_5numpy_float64_t **data;
1247   __pyx_t_5numpy_uint8_t *mask;
1248   __pyx_t_5numpy_float64_t left_edge[3];
1249   __pyx_t_5numpy_float64_t right_edge[3];
1250   __pyx_t_5numpy_float64_t dds[3];
1251   __pyx_t_5numpy_float64_t idds[3];
1252   int dims[3];
1253 };
1254 struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator;
1255 
1256 /* "image_samplers.pxd":25
1257  * cdef struct VolumeRenderAccumulator
1258  *
1259  * ctypedef int calculate_extent_function(ImageSampler image,             # <<<<<<<<<<<<<<
1260  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
1261  *
1262  */
1263 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 *);
1264 
1265 /* "image_samplers.pxd":28
1266  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1
1267  *
1268  * ctypedef void generate_vector_info_function(ImageSampler im,             # <<<<<<<<<<<<<<
1269  *             np.int64_t vi, np.int64_t vj,
1270  *             np.float64_t width[2],
1271  */
1272 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 *);
1273 
1274 /* "image_samplers.pxd":33
1275  *             np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil
1276  *
1277  * cdef struct ImageAccumulator:             # <<<<<<<<<<<<<<
1278  *     np.float64_t rgba[Nch]
1279  *     void *supp_data
1280  */
1281 struct __pyx_t_2yt_9utilities_3lib_14image_samplers_ImageAccumulator {
1282   __pyx_t_5numpy_float64_t rgba[4];
1283   void *supp_data;
1284 };
1285 
1286 /* "partitioned_grid.pxd":18
1287  *
1288  *
1289  * cdef class PartitionedGrid:             # <<<<<<<<<<<<<<
1290  *     cdef public object my_data
1291  *     cdef public object source_mask
1292  */
1293 struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1294   PyObject_HEAD
1295   struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtab;
1296   PyObject *my_data;
1297   PyObject *source_mask;
1298   PyObject *LeftEdge;
1299   PyObject *RightEdge;
1300   int parent_grid_id;
1301   struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *container;
1302   __pyx_t_5numpy_float64_t star_er;
1303   __pyx_t_5numpy_float64_t star_sigma_num;
1304   __pyx_t_5numpy_float64_t star_coeff;
1305 };
1306 
1307 
1308 /* "image_samplers.pxd":37
1309  *     void *supp_data
1310  *
1311  * cdef class ImageSampler:             # <<<<<<<<<<<<<<
1312  *     cdef np.float64_t[:,:,:] vp_pos
1313  *     cdef np.float64_t[:,:,:] vp_dir
1314  */
1315 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler {
1316   PyObject_HEAD
1317   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtab;
1318   __Pyx_memviewslice vp_pos;
1319   __Pyx_memviewslice vp_dir;
1320   __pyx_t_5numpy_float64_t *center;
1321   __Pyx_memviewslice image;
1322   __Pyx_memviewslice zbuffer;
1323   __Pyx_memviewslice image_used;
1324   __Pyx_memviewslice mesh_lines;
1325   __pyx_t_5numpy_float64_t pdx;
1326   __pyx_t_5numpy_float64_t pdy;
1327   __pyx_t_5numpy_float64_t bounds[4];
1328   __Pyx_memviewslice camera_data;
1329   int nv[2];
1330   __pyx_t_5numpy_float64_t *x_vec;
1331   __pyx_t_5numpy_float64_t *y_vec;
1332   PyObject *acenter;
1333   PyObject *aimage;
1334   PyObject *ax_vec;
1335   PyObject *ay_vec;
1336   PyObject *azbuffer;
1337   PyObject *aimage_used;
1338   PyObject *amesh_lines;
1339   void *supp_data;
1340   __pyx_t_5numpy_float64_t width[3];
1341   PyObject *lens_type;
1342   PyObject *volume_method;
1343   __pyx_t_2yt_9utilities_3lib_14image_samplers_calculate_extent_function *extent_function;
1344   __pyx_t_2yt_9utilities_3lib_14image_samplers_generate_vector_info_function *vector_function;
1345 };
1346 
1347 
1348 /* "image_samplers.pxd":71
1349  *                 void *data) nogil
1350  *
1351  * cdef class ProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1352  *     pass
1353  *
1354  */
1355 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ProjectionSampler {
1356   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1357 };
1358 
1359 
1360 /* "image_samplers.pxd":74
1361  *     pass
1362  *
1363  * cdef class InterpolatedProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1364  *     cdef VolumeRenderAccumulator *vra
1365  *     cdef public object tf_obj
1366  */
1367 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler {
1368   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1369   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1370   PyObject *tf_obj;
1371   PyObject *my_field_tables;
1372 };
1373 
1374 
1375 /* "image_samplers.pxd":79
1376  *     cdef public object my_field_tables
1377  *
1378  * cdef class VolumeRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1379  *     cdef VolumeRenderAccumulator *vra
1380  *     cdef public object tf_obj
1381  */
1382 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler {
1383   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1384   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1385   PyObject *tf_obj;
1386   PyObject *my_field_tables;
1387   PyObject *tree_containers;
1388 };
1389 
1390 
1391 /* "image_samplers.pxd":85
1392  *     cdef object tree_containers
1393  *
1394  * cdef class LightSourceRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1395  *     cdef VolumeRenderAccumulator *vra
1396  *     cdef public object tf_obj
1397  */
1398 struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler {
1399   struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1400   struct __pyx_t_2yt_9utilities_3lib_14image_samplers_VolumeRenderAccumulator *vra;
1401   PyObject *tf_obj;
1402   PyObject *my_field_tables;
1403 };
1404 
1405 
1406 /* "View.MemoryView":105
1407  *
1408  * @cname("__pyx_array")
1409  * cdef class array:             # <<<<<<<<<<<<<<
1410  *
1411  *     cdef:
1412  */
1413 struct __pyx_array_obj {
1414   PyObject_HEAD
1415   struct __pyx_vtabstruct_array *__pyx_vtab;
1416   char *data;
1417   Py_ssize_t len;
1418   char *format;
1419   int ndim;
1420   Py_ssize_t *_shape;
1421   Py_ssize_t *_strides;
1422   Py_ssize_t itemsize;
1423   PyObject *mode;
1424   PyObject *_format;
1425   void (*callback_free_data)(void *);
1426   int free_data;
1427   int dtype_is_object;
1428 };
1429 
1430 
1431 /* "View.MemoryView":279
1432  *
1433  * @cname('__pyx_MemviewEnum')
1434  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1435  *     cdef object name
1436  *     def __init__(self, name):
1437  */
1438 struct __pyx_MemviewEnum_obj {
1439   PyObject_HEAD
1440   PyObject *name;
1441 };
1442 
1443 
1444 /* "View.MemoryView":330
1445  *
1446  * @cname('__pyx_memoryview')
1447  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1448  *
1449  *     cdef object obj
1450  */
1451 struct __pyx_memoryview_obj {
1452   PyObject_HEAD
1453   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1454   PyObject *obj;
1455   PyObject *_size;
1456   PyObject *_array_interface;
1457   PyThread_type_lock lock;
1458   __pyx_atomic_int acquisition_count[2];
1459   __pyx_atomic_int *acquisition_count_aligned_p;
1460   Py_buffer view;
1461   int flags;
1462   int dtype_is_object;
1463   __Pyx_TypeInfo *typeinfo;
1464 };
1465 
1466 
1467 /* "View.MemoryView":961
1468  *
1469  * @cname('__pyx_memoryviewslice')
1470  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1471  *     "Internal class for passing memoryview slices to Python"
1472  *
1473  */
1474 struct __pyx_memoryviewslice_obj {
1475   struct __pyx_memoryview_obj __pyx_base;
1476   __Pyx_memviewslice from_slice;
1477   PyObject *from_object;
1478   PyObject *(*to_object_func)(char *);
1479   int (*to_dtype_func)(char *, PyObject *);
1480 };
1481 
1482 
1483 
1484 /* "partitioned_grid.pxd":18
1485  *
1486  *
1487  * cdef class PartitionedGrid:             # <<<<<<<<<<<<<<
1488  *     cdef public object my_data
1489  *     cdef public object source_mask
1490  */
1491 
1492 struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid {
1493   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 *);
1494 };
1495 static struct __pyx_vtabstruct_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *__pyx_vtabptr_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid;
1496 
1497 
1498 /* "image_samplers.pxd":37
1499  *     void *supp_data
1500  *
1501  * cdef class ImageSampler:             # <<<<<<<<<<<<<<
1502  *     cdef np.float64_t[:,:,:] vp_pos
1503  *     cdef np.float64_t[:,:,:] vp_dir
1504  */
1505 
1506 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler {
1507   void (*setup)(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_obj_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid *);
1508   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 *);
1509 };
1510 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ImageSampler;
1511 
1512 
1513 /* "image_samplers.pxd":71
1514  *                 void *data) nogil
1515  *
1516  * cdef class ProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1517  *     pass
1518  *
1519  */
1520 
1521 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler {
1522   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1523 };
1524 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_ProjectionSampler;
1525 
1526 
1527 /* "image_samplers.pxd":74
1528  *     pass
1529  *
1530  * cdef class InterpolatedProjectionSampler(ImageSampler):             # <<<<<<<<<<<<<<
1531  *     cdef VolumeRenderAccumulator *vra
1532  *     cdef public object tf_obj
1533  */
1534 
1535 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler {
1536   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1537 };
1538 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler;
1539 
1540 
1541 /* "image_samplers.pxd":79
1542  *     cdef public object my_field_tables
1543  *
1544  * cdef class VolumeRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1545  *     cdef VolumeRenderAccumulator *vra
1546  *     cdef public object tf_obj
1547  */
1548 
1549 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler {
1550   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1551 };
1552 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler;
1553 
1554 
1555 /* "image_samplers.pxd":85
1556  *     cdef object tree_containers
1557  *
1558  * cdef class LightSourceRenderSampler(ImageSampler):             # <<<<<<<<<<<<<<
1559  *     cdef VolumeRenderAccumulator *vra
1560  *     cdef public object tf_obj
1561  */
1562 
1563 struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler {
1564   struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_ImageSampler __pyx_base;
1565 };
1566 static struct __pyx_vtabstruct_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler *__pyx_vtabptr_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler;
1567 
1568 
1569 /* "View.MemoryView":105
1570  *
1571  * @cname("__pyx_array")
1572  * cdef class array:             # <<<<<<<<<<<<<<
1573  *
1574  *     cdef:
1575  */
1576 
1577 struct __pyx_vtabstruct_array {
1578   PyObject *(*get_memview)(struct __pyx_array_obj *);
1579 };
1580 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1581 
1582 
1583 /* "View.MemoryView":330
1584  *
1585  * @cname('__pyx_memoryview')
1586  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1587  *
1588  *     cdef object obj
1589  */
1590 
1591 struct __pyx_vtabstruct_memoryview {
1592   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1593   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1594   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1595   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1596   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1597   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1598   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1599 };
1600 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1601 
1602 
1603 /* "View.MemoryView":961
1604  *
1605  * @cname('__pyx_memoryviewslice')
1606  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1607  *     "Internal class for passing memoryview slices to Python"
1608  *
1609  */
1610 
1611 struct __pyx_vtabstruct__memoryviewslice {
1612   struct __pyx_vtabstruct_memoryview __pyx_base;
1613 };
1614 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1615 
1616 /* --- Runtime support code (head) --- */
1617 /* Refnanny.proto */
1618 #ifndef CYTHON_REFNANNY
1619   #define CYTHON_REFNANNY 0
1620 #endif
1621 #if CYTHON_REFNANNY
1622   typedef struct {
1623     void (*INCREF)(void*, PyObject*, int);
1624     void (*DECREF)(void*, PyObject*, int);
1625     void (*GOTREF)(void*, PyObject*, int);
1626     void (*GIVEREF)(void*, PyObject*, int);
1627     void* (*SetupContext)(const char*, int, const char*);
1628     void (*FinishContext)(void**);
1629   } __Pyx_RefNannyAPIStruct;
1630   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1631   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1632   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1633 #ifdef WITH_THREAD
1634   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1635           if (acquire_gil) {\
1636               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1637               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1638               PyGILState_Release(__pyx_gilstate_save);\
1639           } else {\
1640               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1641           }
1642 #else
1643   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1644           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1645 #endif
1646   #define __Pyx_RefNannyFinishContext()\
1647           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1648   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1649   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1650   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1651   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1652   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1653   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1654   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1655   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1656 #else
1657   #define __Pyx_RefNannyDeclarations
1658   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1659   #define __Pyx_RefNannyFinishContext()
1660   #define __Pyx_INCREF(r) Py_INCREF(r)
1661   #define __Pyx_DECREF(r) Py_DECREF(r)
1662   #define __Pyx_GOTREF(r)
1663   #define __Pyx_GIVEREF(r)
1664   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1665   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1666   #define __Pyx_XGOTREF(r)
1667   #define __Pyx_XGIVEREF(r)
1668 #endif
1669 #define __Pyx_XDECREF_SET(r, v) do {\
1670         PyObject *tmp = (PyObject *) r;\
1671         r = v; __Pyx_XDECREF(tmp);\
1672     } while (0)
1673 #define __Pyx_DECREF_SET(r, v) do {\
1674         PyObject *tmp = (PyObject *) r;\
1675         r = v; __Pyx_DECREF(tmp);\
1676     } while (0)
1677 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1678 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1679 
1680 /* PyObjectGetAttrStr.proto */
1681 #if CYTHON_USE_TYPE_SLOTS
1682 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1683 #else
1684 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1685 #endif
1686 
1687 /* GetBuiltinName.proto */
1688 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1689 
1690 /* PyThreadStateGet.proto */
1691 #if CYTHON_FAST_THREAD_STATE
1692 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1693 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1694 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1695 #else
1696 #define __Pyx_PyThreadState_declare
1697 #define __Pyx_PyThreadState_assign
1698 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1699 #endif
1700 
1701 /* PyErrFetchRestore.proto */
1702 #if CYTHON_FAST_THREAD_STATE
1703 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1704 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1705 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1706 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1707 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1708 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1709 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1710 #if CYTHON_COMPILING_IN_CPYTHON
1711 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1712 #else
1713 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1714 #endif
1715 #else
1716 #define __Pyx_PyErr_Clear() PyErr_Clear()
1717 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1718 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1719 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1720 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1721 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1722 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1723 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1724 #endif
1725 
1726 /* WriteUnraisableException.proto */
1727 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1728                                   int lineno, const char *filename,
1729                                   int full_traceback, int nogil);
1730 
1731 /* PyObjectCall.proto */
1732 #if CYTHON_COMPILING_IN_CPYTHON
1733 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1734 #else
1735 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1736 #endif
1737 
1738 /* RaiseException.proto */
1739 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1740 
1741 /* PyCFunctionFastCall.proto */
1742 #if CYTHON_FAST_PYCCALL
1743 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1744 #else
1745 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1746 #endif
1747 
1748 /* PyFunctionFastCall.proto */
1749 #if CYTHON_FAST_PYCALL
1750 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1751     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1752 #if 1 || PY_VERSION_HEX < 0x030600B1
1753 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1754 #else
1755 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1756 #endif
1757 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1758     (sizeof(char [1 - 2*!(cond)]) - 1)
1759 #ifndef Py_MEMBER_SIZE
1760 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1761 #endif
1762   static size_t __pyx_pyframe_localsplus_offset = 0;
1763   #include "frameobject.h"
1764   #define __Pxy_PyFrame_Initialize_Offsets()\
1765     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1766      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1767   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1768     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1769 #endif
1770 
1771 /* PyObjectCallMethO.proto */
1772 #if CYTHON_COMPILING_IN_CPYTHON
1773 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1774 #endif
1775 
1776 /* PyObjectCallOneArg.proto */
1777 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1778 
1779 /* DictGetItem.proto */
1780 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1781 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1782 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1783     (likely(PyDict_CheckExact(obj)) ?\
1784      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1785 #else
1786 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1787 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1788 #endif
1789 
1790 /* RaiseTooManyValuesToUnpack.proto */
1791 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1792 
1793 /* RaiseNeedMoreValuesToUnpack.proto */
1794 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1795 
1796 /* RaiseNoneIterError.proto */
1797 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1798 
1799 /* ExtTypeTest.proto */
1800 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1801 
1802 /* GetTopmostException.proto */
1803 #if CYTHON_USE_EXC_INFO_STACK
1804 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1805 #endif
1806 
1807 /* SaveResetException.proto */
1808 #if CYTHON_FAST_THREAD_STATE
1809 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1810 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1811 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1812 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1813 #else
1814 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1815 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1816 #endif
1817 
1818 /* PyErrExceptionMatches.proto */
1819 #if CYTHON_FAST_THREAD_STATE
1820 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1821 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1822 #else
1823 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1824 #endif
1825 
1826 /* GetException.proto */
1827 #if CYTHON_FAST_THREAD_STATE
1828 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1829 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1830 #else
1831 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1832 #endif
1833 
1834 /* GetAttr.proto */
1835 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1836 
1837 /* HasAttr.proto */
1838 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1839 
1840 /* IncludeStringH.proto */
1841 #include <string.h>
1842 
1843 /* BytesEquals.proto */
1844 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1845 
1846 /* UnicodeEquals.proto */
1847 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1848 
1849 /* StrEquals.proto */
1850 #if PY_MAJOR_VERSION >= 3
1851 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1852 #else
1853 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1854 #endif
1855 
1856 /* PyObjectCall2Args.proto */
1857 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1858 
1859 /* RaiseArgTupleInvalid.proto */
1860 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1861     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1862 
1863 /* RaiseDoubleKeywords.proto */
1864 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1865 
1866 /* ParseKeywords.proto */
1867 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1868     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1869     const char* function_name);
1870 
1871 /* ArgTypeTest.proto */
1872 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1873     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1874         __Pyx__ArgTypeTest(obj, type, name, exact))
1875 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1876 
1877 /* None.proto */
1878 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1879 
1880 /* UnaryNegOverflows.proto */
1881 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1882         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1883 
1884 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1885 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1886 /* GetItemInt.proto */
1887 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1888     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1889     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1890     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1891                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1892 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1893     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1894     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1895     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1896 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1897                                                               int wraparound, int boundscheck);
1898 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1899     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1900     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1901     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1902 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1903                                                               int wraparound, int boundscheck);
1904 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1905 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1906                                                      int is_list, int wraparound, int boundscheck);
1907 
1908 /* ObjectGetItem.proto */
1909 #if CYTHON_USE_TYPE_SLOTS
1910 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1911 #else
1912 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1913 #endif
1914 
1915 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1916 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1917     int byteorder = 0;
1918     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1919 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1920 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1921     int byteorder = -1;
1922     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1923 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1924 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1925     int byteorder = 1;
1926     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1927 }
1928 
1929 /* decode_c_string.proto */
1930 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1931          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1932          const char* encoding, const char* errors,
1933          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1934 
1935 /* GetAttr3.proto */
1936 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1937 
1938 /* PyDictVersioning.proto */
1939 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1940 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1941 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1942 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1943     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1944     (cache_var) = (value);
1945 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1946     static PY_UINT64_T __pyx_dict_version = 0;\
1947     static PyObject *__pyx_dict_cached_value = NULL;\
1948     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1949         (VAR) = __pyx_dict_cached_value;\
1950     } else {\
1951         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1952         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1953     }\
1954 }
1955 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1956 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1957 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1958 #else
1959 #define __PYX_GET_DICT_VERSION(dict)  (0)
1960 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1961 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1962 #endif
1963 
1964 /* GetModuleGlobalName.proto */
1965 #if CYTHON_USE_DICT_VERSIONS
1966 #define __Pyx_GetModuleGlobalName(var, name)  {\
1967     static PY_UINT64_T __pyx_dict_version = 0;\
1968     static PyObject *__pyx_dict_cached_value = NULL;\
1969     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1970         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1971         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1972 }
1973 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1974     PY_UINT64_T __pyx_dict_version;\
1975     PyObject *__pyx_dict_cached_value;\
1976     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1977 }
1978 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1979 #else
1980 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1981 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1982 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1983 #endif
1984 
1985 /* SwapException.proto */
1986 #if CYTHON_FAST_THREAD_STATE
1987 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1988 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1989 #else
1990 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1991 #endif
1992 
1993 /* Import.proto */
1994 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1995 
1996 /* FastTypeChecks.proto */
1997 #if CYTHON_COMPILING_IN_CPYTHON
1998 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1999 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2000 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2001 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2002 #else
2003 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2004 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2005 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2006 #endif
2007 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2008 
2009 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2010 /* ListCompAppend.proto */
2011 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)2012 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2013     PyListObject* L = (PyListObject*) list;
2014     Py_ssize_t len = Py_SIZE(list);
2015     if (likely(L->allocated > len)) {
2016         Py_INCREF(x);
2017         PyList_SET_ITEM(list, len, x);
2018         Py_SIZE(list) = len+1;
2019         return 0;
2020     }
2021     return PyList_Append(list, x);
2022 }
2023 #else
2024 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2025 #endif
2026 
2027 /* PyIntBinop.proto */
2028 #if !CYTHON_COMPILING_IN_PYPY
2029 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2030 #else
2031 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2032     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2033 #endif
2034 
2035 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)2036 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2037 #if CYTHON_COMPILING_IN_CPYTHON
2038     PyObject* none = _PyList_Extend((PyListObject*)L, v);
2039     if (unlikely(!none))
2040         return -1;
2041     Py_DECREF(none);
2042     return 0;
2043 #else
2044     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2045 #endif
2046 }
2047 
2048 /* ListAppend.proto */
2049 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)2050 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2051     PyListObject* L = (PyListObject*) list;
2052     Py_ssize_t len = Py_SIZE(list);
2053     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2054         Py_INCREF(x);
2055         PyList_SET_ITEM(list, len, x);
2056         Py_SIZE(list) = len+1;
2057         return 0;
2058     }
2059     return PyList_Append(list, x);
2060 }
2061 #else
2062 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2063 #endif
2064 
2065 /* None.proto */
2066 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2067 
2068 /* None.proto */
2069 static CYTHON_INLINE long __Pyx_div_long(long, long);
2070 
2071 /* ImportFrom.proto */
2072 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2073 
2074 /* PyObject_GenericGetAttrNoDict.proto */
2075 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2076 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2077 #else
2078 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2079 #endif
2080 
2081 /* PyObject_GenericGetAttr.proto */
2082 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2083 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2084 #else
2085 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2086 #endif
2087 
2088 /* SetVTable.proto */
2089 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2090 
2091 /* SetupReduce.proto */
2092 static int __Pyx_setup_reduce(PyObject* type_obj);
2093 
2094 /* TypeImport.proto */
2095 #ifndef __PYX_HAVE_RT_ImportType_proto
2096 #define __PYX_HAVE_RT_ImportType_proto
2097 enum __Pyx_ImportType_CheckSize {
2098    __Pyx_ImportType_CheckSize_Error = 0,
2099    __Pyx_ImportType_CheckSize_Warn = 1,
2100    __Pyx_ImportType_CheckSize_Ignore = 2
2101 };
2102 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2103 #endif
2104 
2105 /* GetVTable.proto */
2106 static void* __Pyx_GetVtable(PyObject *dict);
2107 
2108 /* CLineInTraceback.proto */
2109 #ifdef CYTHON_CLINE_IN_TRACEBACK
2110 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2111 #else
2112 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2113 #endif
2114 
2115 /* CodeObjectCache.proto */
2116 typedef struct {
2117     PyCodeObject* code_object;
2118     int code_line;
2119 } __Pyx_CodeObjectCacheEntry;
2120 struct __Pyx_CodeObjectCache {
2121     int count;
2122     int max_count;
2123     __Pyx_CodeObjectCacheEntry* entries;
2124 };
2125 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2126 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2127 static PyCodeObject *__pyx_find_code_object(int code_line);
2128 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2129 
2130 /* AddTraceback.proto */
2131 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2132                                int py_line, const char *filename);
2133 
2134 /* RealImag.proto */
2135 #if CYTHON_CCOMPLEX
2136   #ifdef __cplusplus
2137     #define __Pyx_CREAL(z) ((z).real())
2138     #define __Pyx_CIMAG(z) ((z).imag())
2139   #else
2140     #define __Pyx_CREAL(z) (__real__(z))
2141     #define __Pyx_CIMAG(z) (__imag__(z))
2142   #endif
2143 #else
2144     #define __Pyx_CREAL(z) ((z).real)
2145     #define __Pyx_CIMAG(z) ((z).imag)
2146 #endif
2147 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2148         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2149     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2150     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2151 #else
2152     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2153     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2154 #endif
2155 
2156 /* Arithmetic.proto */
2157 #if CYTHON_CCOMPLEX
2158     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2159     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2160     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2161     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2162     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2163     #define __Pyx_c_neg_float(a)     (-(a))
2164   #ifdef __cplusplus
2165     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2166     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2167     #if 1
2168         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2169         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2170     #endif
2171   #else
2172     #define __Pyx_c_is_zero_float(z) ((z)==0)
2173     #define __Pyx_c_conj_float(z)    (conjf(z))
2174     #if 1
2175         #define __Pyx_c_abs_float(z)     (cabsf(z))
2176         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2177     #endif
2178  #endif
2179 #else
2180     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2181     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2182     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2183     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2184     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2185     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2186     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2187     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2188     #if 1
2189         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2190         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2191     #endif
2192 #endif
2193 
2194 /* Arithmetic.proto */
2195 #if CYTHON_CCOMPLEX
2196     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2197     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2198     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2199     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2200     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2201     #define __Pyx_c_neg_double(a)     (-(a))
2202   #ifdef __cplusplus
2203     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2204     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2205     #if 1
2206         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2207         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2208     #endif
2209   #else
2210     #define __Pyx_c_is_zero_double(z) ((z)==0)
2211     #define __Pyx_c_conj_double(z)    (conj(z))
2212     #if 1
2213         #define __Pyx_c_abs_double(z)     (cabs(z))
2214         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2215     #endif
2216  #endif
2217 #else
2218     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2219     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2220     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2221     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2222     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2223     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2224     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2225     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2226     #if 1
2227         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2228         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2229     #endif
2230 #endif
2231 
2232 /* CIntToPy.proto */
2233 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2234 
2235 /* CIntToPy.proto */
2236 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2237 
2238 #if PY_MAJOR_VERSION < 3
2239     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2240     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2241 #else
2242     #define __Pyx_GetBuffer PyObject_GetBuffer
2243     #define __Pyx_ReleaseBuffer PyBuffer_Release
2244 #endif
2245 
2246 
2247 /* BufferStructDeclare.proto */
2248 typedef struct {
2249   Py_ssize_t shape, strides, suboffsets;
2250 } __Pyx_Buf_DimInfo;
2251 typedef struct {
2252   size_t refcount;
2253   Py_buffer pybuffer;
2254 } __Pyx_Buffer;
2255 typedef struct {
2256   __Pyx_Buffer *rcbuffer;
2257   char *data;
2258   __Pyx_Buf_DimInfo diminfo[8];
2259 } __Pyx_LocalBuf_ND;
2260 
2261 /* MemviewSliceIsContig.proto */
2262 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2263 
2264 /* OverlappingSlices.proto */
2265 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2266                                 __Pyx_memviewslice *slice2,
2267                                 int ndim, size_t itemsize);
2268 
2269 /* Capsule.proto */
2270 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2271 
2272 /* CIntFromPy.proto */
2273 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2274 
2275 /* MemviewSliceCopyTemplate.proto */
2276 static __Pyx_memviewslice
2277 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2278                                  const char *mode, int ndim,
2279                                  size_t sizeof_dtype, int contig_flag,
2280                                  int dtype_is_object);
2281 
2282 /* MemviewSliceInit.proto */
2283 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2284 #define __Pyx_MEMVIEW_DIRECT   1
2285 #define __Pyx_MEMVIEW_PTR      2
2286 #define __Pyx_MEMVIEW_FULL     4
2287 #define __Pyx_MEMVIEW_CONTIG   8
2288 #define __Pyx_MEMVIEW_STRIDED  16
2289 #define __Pyx_MEMVIEW_FOLLOW   32
2290 #define __Pyx_IS_C_CONTIG 1
2291 #define __Pyx_IS_F_CONTIG 2
2292 static int __Pyx_init_memviewslice(
2293                 struct __pyx_memoryview_obj *memview,
2294                 int ndim,
2295                 __Pyx_memviewslice *memviewslice,
2296                 int memview_is_new_reference);
2297 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2298     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2299 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2300     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2301 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2302 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2303 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2304 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2305 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2306 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2307 
2308 /* CIntFromPy.proto */
2309 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2310 
2311 /* CIntToPy.proto */
2312 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2313 
2314 /* CIntFromPy.proto */
2315 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2316 
2317 /* CheckBinaryVersion.proto */
2318 static int __Pyx_check_binary_version(void);
2319 
2320 /* FunctionExport.proto */
2321 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2322 
2323 /* InitStrings.proto */
2324 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2325 
2326 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2327 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2328 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2329 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2330 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*/
2331 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2332 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2333 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2334 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2335 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2336 
2337 /* Module declarations from 'cython.view' */
2338 
2339 /* Module declarations from 'cython' */
2340 
2341 /* Module declarations from 'cpython.buffer' */
2342 
2343 /* Module declarations from 'libc.string' */
2344 
2345 /* Module declarations from 'libc.stdio' */
2346 
2347 /* Module declarations from '__builtin__' */
2348 
2349 /* Module declarations from 'cpython.type' */
2350 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2351 
2352 /* Module declarations from 'cpython' */
2353 
2354 /* Module declarations from 'cpython.object' */
2355 
2356 /* Module declarations from 'cpython.ref' */
2357 
2358 /* Module declarations from 'cpython.mem' */
2359 
2360 /* Module declarations from 'numpy' */
2361 
2362 /* Module declarations from 'numpy' */
2363 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2364 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2365 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2366 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2367 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2368 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2369 
2370 /* Module declarations from 'libc.math' */
2371 
2372 /* Module declarations from 'yt.utilities.lib.vec3_ops' */
2373 static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *, double *); /*proto*/
2374 static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *, double *, double *); /*proto*/
2375 static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const , double *, double *, double *); /*proto*/
2376 static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *); /*proto*/
2377 
2378 /* Module declarations from 'yt.utilities.lib.fp_utils' */
2379 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
2380 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2381 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
2382 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2383 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
2384 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
2385 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
2386 
2387 /* Module declarations from 'yt.utilities.lib.volume_container' */
2388 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*/
2389 
2390 /* Module declarations from 'yt.utilities.lib.partitioned_grid' */
2391 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid = 0;
2392 
2393 /* Module declarations from 'yt.utilities.lib.image_samplers' */
2394 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler = 0;
2395 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler = 0;
2396 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler = 0;
2397 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler = 0;
2398 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler = 0;
2399 
2400 /* Module declarations from 'yt.utilities.lib.lenses' */
2401 static PyTypeObject *__pyx_array_type = 0;
2402 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2403 static PyTypeObject *__pyx_memoryview_type = 0;
2404 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2405 static PyObject *generic = 0;
2406 static PyObject *strided = 0;
2407 static PyObject *indirect = 0;
2408 static PyObject *contiguous = 0;
2409 static PyObject *indirect_contiguous = 0;
2410 static int __pyx_memoryview_thread_locks_used;
2411 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2412 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2413 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2414 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2415 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2416 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2417 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2418 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2419 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*/
2420 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2421 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2422 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2423 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2424 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2425 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2426 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2427 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2428 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2429 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2430 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2431 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2432 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2433 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2434 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2435 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2436 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2437 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2438 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2439 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2440 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2441 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2442 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2443 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2444 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2445 #define __Pyx_MODULE_NAME "yt.utilities.lib.lenses"
2446 extern int __pyx_module_is_main_yt__utilities__lib__lenses;
2447 int __pyx_module_is_main_yt__utilities__lib__lenses = 0;
2448 
2449 /* Implementation of 'yt.utilities.lib.lenses' */
2450 static PyObject *__pyx_builtin_range;
2451 static PyObject *__pyx_builtin_ValueError;
2452 static PyObject *__pyx_builtin_RuntimeError;
2453 static PyObject *__pyx_builtin_ImportError;
2454 static PyObject *__pyx_builtin_MemoryError;
2455 static PyObject *__pyx_builtin_enumerate;
2456 static PyObject *__pyx_builtin_TypeError;
2457 static PyObject *__pyx_builtin_Ellipsis;
2458 static PyObject *__pyx_builtin_id;
2459 static PyObject *__pyx_builtin_IndexError;
2460 static const char __pyx_k_O[] = "O";
2461 static const char __pyx_k_c[] = "c";
2462 static const char __pyx_k_id[] = "id";
2463 static const char __pyx_k_np[] = "np";
2464 static const char __pyx_k_new[] = "__new__";
2465 static const char __pyx_k_obj[] = "obj";
2466 static const char __pyx_k_base[] = "base";
2467 static const char __pyx_k_dict[] = "__dict__";
2468 static const char __pyx_k_main[] = "__main__";
2469 static const char __pyx_k_mode[] = "mode";
2470 static const char __pyx_k_name[] = "name";
2471 static const char __pyx_k_ndim[] = "ndim";
2472 static const char __pyx_k_pack[] = "pack";
2473 static const char __pyx_k_size[] = "size";
2474 static const char __pyx_k_step[] = "step";
2475 static const char __pyx_k_stop[] = "stop";
2476 static const char __pyx_k_test[] = "__test__";
2477 static const char __pyx_k_ASCII[] = "ASCII";
2478 static const char __pyx_k_class[] = "__class__";
2479 static const char __pyx_k_error[] = "error";
2480 static const char __pyx_k_flags[] = "flags";
2481 static const char __pyx_k_numpy[] = "numpy";
2482 static const char __pyx_k_range[] = "range";
2483 static const char __pyx_k_shape[] = "shape";
2484 static const char __pyx_k_start[] = "start";
2485 static const char __pyx_k_units[] = "units";
2486 static const char __pyx_k_encode[] = "encode";
2487 static const char __pyx_k_format[] = "format";
2488 static const char __pyx_k_import[] = "__import__";
2489 static const char __pyx_k_name_2[] = "__name__";
2490 static const char __pyx_k_pickle[] = "pickle";
2491 static const char __pyx_k_reduce[] = "__reduce__";
2492 static const char __pyx_k_struct[] = "struct";
2493 static const char __pyx_k_unpack[] = "unpack";
2494 static const char __pyx_k_update[] = "update";
2495 static const char __pyx_k_fortran[] = "fortran";
2496 static const char __pyx_k_memview[] = "memview";
2497 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2498 static const char __pyx_k_getstate[] = "__getstate__";
2499 static const char __pyx_k_itemsize[] = "itemsize";
2500 static const char __pyx_k_pyx_type[] = "__pyx_type";
2501 static const char __pyx_k_setstate[] = "__setstate__";
2502 static const char __pyx_k_TypeError[] = "TypeError";
2503 static const char __pyx_k_enumerate[] = "enumerate";
2504 static const char __pyx_k_pyx_state[] = "__pyx_state";
2505 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2506 static const char __pyx_k_IndexError[] = "IndexError";
2507 static const char __pyx_k_ValueError[] = "ValueError";
2508 static const char __pyx_k_pyx_result[] = "__pyx_result";
2509 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2510 static const char __pyx_k_ImportError[] = "ImportError";
2511 static const char __pyx_k_MemoryError[] = "MemoryError";
2512 static const char __pyx_k_PickleError[] = "PickleError";
2513 static const char __pyx_k_code_length[] = "code_length";
2514 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2515 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2516 static const char __pyx_k_stringsource[] = "stringsource";
2517 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2518 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2519 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2520 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2521 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2522 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2523 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2524 static const char __pyx_k_convert_to_units[] = "convert_to_units";
2525 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2526 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2527 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2528 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2529 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2530 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2531 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2532 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2533 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2534 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2535 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2536 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2537 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2538 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2539 static const char __pyx_k_Functions_for_computing_the_ext[] = "\nFunctions for computing the extent of lenses and whatnot\n\n\n\n";
2540 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2541 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2542 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2543 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2544 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2545 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2546 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2547 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2548 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2549 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2550 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2551 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2552 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2553 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2554 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2555 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2556 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2557 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2558 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2559 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2560 static PyObject *__pyx_n_s_ASCII;
2561 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2562 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2563 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2564 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2565 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2566 static PyObject *__pyx_n_s_Ellipsis;
2567 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2568 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2569 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2570 static PyObject *__pyx_n_s_ImportError;
2571 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2572 static PyObject *__pyx_n_s_IndexError;
2573 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2574 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2575 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2576 static PyObject *__pyx_n_s_MemoryError;
2577 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2578 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2579 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2580 static PyObject *__pyx_n_b_O;
2581 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2582 static PyObject *__pyx_n_s_PickleError;
2583 static PyObject *__pyx_n_s_RuntimeError;
2584 static PyObject *__pyx_n_s_TypeError;
2585 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2586 static PyObject *__pyx_n_s_ValueError;
2587 static PyObject *__pyx_n_s_View_MemoryView;
2588 static PyObject *__pyx_n_s_allocate_buffer;
2589 static PyObject *__pyx_n_s_base;
2590 static PyObject *__pyx_n_s_c;
2591 static PyObject *__pyx_n_u_c;
2592 static PyObject *__pyx_n_s_class;
2593 static PyObject *__pyx_n_s_cline_in_traceback;
2594 static PyObject *__pyx_n_s_code_length;
2595 static PyObject *__pyx_kp_s_contiguous_and_direct;
2596 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2597 static PyObject *__pyx_n_s_convert_to_units;
2598 static PyObject *__pyx_n_s_dict;
2599 static PyObject *__pyx_n_s_dtype_is_object;
2600 static PyObject *__pyx_n_s_encode;
2601 static PyObject *__pyx_n_s_enumerate;
2602 static PyObject *__pyx_n_s_error;
2603 static PyObject *__pyx_n_s_flags;
2604 static PyObject *__pyx_n_s_format;
2605 static PyObject *__pyx_n_s_fortran;
2606 static PyObject *__pyx_n_u_fortran;
2607 static PyObject *__pyx_n_s_getstate;
2608 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2609 static PyObject *__pyx_n_s_id;
2610 static PyObject *__pyx_n_s_import;
2611 static PyObject *__pyx_n_s_itemsize;
2612 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2613 static PyObject *__pyx_n_s_main;
2614 static PyObject *__pyx_n_s_memview;
2615 static PyObject *__pyx_n_s_mode;
2616 static PyObject *__pyx_n_s_name;
2617 static PyObject *__pyx_n_s_name_2;
2618 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2619 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2620 static PyObject *__pyx_n_s_ndim;
2621 static PyObject *__pyx_n_s_new;
2622 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2623 static PyObject *__pyx_n_s_np;
2624 static PyObject *__pyx_n_s_numpy;
2625 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2626 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2627 static PyObject *__pyx_n_s_obj;
2628 static PyObject *__pyx_n_s_pack;
2629 static PyObject *__pyx_n_s_pickle;
2630 static PyObject *__pyx_n_s_pyx_PickleError;
2631 static PyObject *__pyx_n_s_pyx_checksum;
2632 static PyObject *__pyx_n_s_pyx_getbuffer;
2633 static PyObject *__pyx_n_s_pyx_result;
2634 static PyObject *__pyx_n_s_pyx_state;
2635 static PyObject *__pyx_n_s_pyx_type;
2636 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2637 static PyObject *__pyx_n_s_pyx_vtable;
2638 static PyObject *__pyx_n_s_range;
2639 static PyObject *__pyx_n_s_reduce;
2640 static PyObject *__pyx_n_s_reduce_cython;
2641 static PyObject *__pyx_n_s_reduce_ex;
2642 static PyObject *__pyx_n_s_setstate;
2643 static PyObject *__pyx_n_s_setstate_cython;
2644 static PyObject *__pyx_n_s_shape;
2645 static PyObject *__pyx_n_s_size;
2646 static PyObject *__pyx_n_s_start;
2647 static PyObject *__pyx_n_s_step;
2648 static PyObject *__pyx_n_s_stop;
2649 static PyObject *__pyx_kp_s_strided_and_direct;
2650 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2651 static PyObject *__pyx_kp_s_strided_and_indirect;
2652 static PyObject *__pyx_kp_s_stringsource;
2653 static PyObject *__pyx_n_s_struct;
2654 static PyObject *__pyx_n_s_test;
2655 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2656 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2657 static PyObject *__pyx_n_s_units;
2658 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2659 static PyObject *__pyx_n_s_unpack;
2660 static PyObject *__pyx_n_s_update;
2661 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2662 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2663 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 */
2664 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 */
2665 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2666 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2667 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2668 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2669 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2670 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 */
2671 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2672 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 */
2673 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2674 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2675 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2676 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2677 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 */
2678 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2679 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2680 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 */
2681 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 */
2682 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2683 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2684 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2685 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2686 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2687 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2688 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2689 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2690 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2691 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2692 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2693 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2694 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2695 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2696 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2697 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2698 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2699 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 */
2700 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2701 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2702 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2703 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 */
2704 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 */
2705 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2706 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2707 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2708 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2709 static PyObject *__pyx_int_0;
2710 static PyObject *__pyx_int_1;
2711 static PyObject *__pyx_int_184977713;
2712 static PyObject *__pyx_int_neg_1;
2713 static PyObject *__pyx_tuple_;
2714 static PyObject *__pyx_tuple__2;
2715 static PyObject *__pyx_tuple__3;
2716 static PyObject *__pyx_tuple__4;
2717 static PyObject *__pyx_tuple__5;
2718 static PyObject *__pyx_tuple__6;
2719 static PyObject *__pyx_tuple__7;
2720 static PyObject *__pyx_tuple__8;
2721 static PyObject *__pyx_tuple__9;
2722 static PyObject *__pyx_slice__22;
2723 static PyObject *__pyx_tuple__10;
2724 static PyObject *__pyx_tuple__11;
2725 static PyObject *__pyx_tuple__12;
2726 static PyObject *__pyx_tuple__13;
2727 static PyObject *__pyx_tuple__14;
2728 static PyObject *__pyx_tuple__15;
2729 static PyObject *__pyx_tuple__16;
2730 static PyObject *__pyx_tuple__17;
2731 static PyObject *__pyx_tuple__18;
2732 static PyObject *__pyx_tuple__19;
2733 static PyObject *__pyx_tuple__20;
2734 static PyObject *__pyx_tuple__21;
2735 static PyObject *__pyx_tuple__23;
2736 static PyObject *__pyx_tuple__24;
2737 static PyObject *__pyx_tuple__25;
2738 static PyObject *__pyx_tuple__26;
2739 static PyObject *__pyx_tuple__27;
2740 static PyObject *__pyx_tuple__28;
2741 static PyObject *__pyx_tuple__29;
2742 static PyObject *__pyx_tuple__30;
2743 static PyObject *__pyx_tuple__31;
2744 static PyObject *__pyx_codeobj__32;
2745 /* Late includes */
2746 
2747 /* "yt/utilities/lib/lenses.pyx":22
2748  * @cython.wraparound(False)
2749  * @cython.cdivision(True)
2750  * cdef int calculate_extent_plane_parallel(ImageSampler image,             # <<<<<<<<<<<<<<
2751  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
2752  *     # We do this for all eight corners
2753  */
2754 
__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler * __pyx_v_image,struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,__pyx_t_5numpy_int64_t * __pyx_v_rv)2755 static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) {
2756   __pyx_t_5numpy_float64_t __pyx_v_temp;
2757   __pyx_t_5numpy_float64_t *__pyx_v_edges[2];
2758   __pyx_t_5numpy_float64_t __pyx_v_cx;
2759   __pyx_t_5numpy_float64_t __pyx_v_cy;
2760   __pyx_t_5numpy_float64_t __pyx_v_extrema[4];
2761   int __pyx_v_i;
2762   int __pyx_v_j;
2763   int __pyx_v_k;
2764   int __pyx_r;
2765   __pyx_t_5numpy_float64_t *__pyx_t_1;
2766   int __pyx_t_2;
2767   int __pyx_t_3;
2768   int __pyx_t_4;
2769   int __pyx_t_5;
2770 
2771   /* "yt/utilities/lib/lenses.pyx":30
2772  *     cdef np.float64_t extrema[4]
2773  *     cdef int i, j, k
2774  *     edges[0] = vc.left_edge             # <<<<<<<<<<<<<<
2775  *     edges[1] = vc.right_edge
2776  *     extrema[0] = extrema[2] = 1e300; extrema[1] = extrema[3] = -1e300
2777  */
2778   __pyx_t_1 = __pyx_v_vc->left_edge;
2779   (__pyx_v_edges[0]) = __pyx_t_1;
2780 
2781   /* "yt/utilities/lib/lenses.pyx":31
2782  *     cdef int i, j, k
2783  *     edges[0] = vc.left_edge
2784  *     edges[1] = vc.right_edge             # <<<<<<<<<<<<<<
2785  *     extrema[0] = extrema[2] = 1e300; extrema[1] = extrema[3] = -1e300
2786  *     for i in range(2):
2787  */
2788   __pyx_t_1 = __pyx_v_vc->right_edge;
2789   (__pyx_v_edges[1]) = __pyx_t_1;
2790 
2791   /* "yt/utilities/lib/lenses.pyx":32
2792  *     edges[0] = vc.left_edge
2793  *     edges[1] = vc.right_edge
2794  *     extrema[0] = extrema[2] = 1e300; extrema[1] = extrema[3] = -1e300             # <<<<<<<<<<<<<<
2795  *     for i in range(2):
2796  *         for j in range(2):
2797  */
2798   (__pyx_v_extrema[0]) = 1e300;
2799   (__pyx_v_extrema[2]) = 1e300;
2800   (__pyx_v_extrema[1]) = -1e300;
2801   (__pyx_v_extrema[3]) = -1e300;
2802 
2803   /* "yt/utilities/lib/lenses.pyx":33
2804  *     edges[1] = vc.right_edge
2805  *     extrema[0] = extrema[2] = 1e300; extrema[1] = extrema[3] = -1e300
2806  *     for i in range(2):             # <<<<<<<<<<<<<<
2807  *         for j in range(2):
2808  *             for k in range(2):
2809  */
2810   for (__pyx_t_2 = 0; __pyx_t_2 < 2; __pyx_t_2+=1) {
2811     __pyx_v_i = __pyx_t_2;
2812 
2813     /* "yt/utilities/lib/lenses.pyx":34
2814  *     extrema[0] = extrema[2] = 1e300; extrema[1] = extrema[3] = -1e300
2815  *     for i in range(2):
2816  *         for j in range(2):             # <<<<<<<<<<<<<<
2817  *             for k in range(2):
2818  *                 # This should rotate it into the vector plane
2819  */
2820     for (__pyx_t_3 = 0; __pyx_t_3 < 2; __pyx_t_3+=1) {
2821       __pyx_v_j = __pyx_t_3;
2822 
2823       /* "yt/utilities/lib/lenses.pyx":35
2824  *     for i in range(2):
2825  *         for j in range(2):
2826  *             for k in range(2):             # <<<<<<<<<<<<<<
2827  *                 # This should rotate it into the vector plane
2828  *                 temp  = edges[i][0] * image.x_vec[0]
2829  */
2830       for (__pyx_t_4 = 0; __pyx_t_4 < 2; __pyx_t_4+=1) {
2831         __pyx_v_k = __pyx_t_4;
2832 
2833         /* "yt/utilities/lib/lenses.pyx":37
2834  *             for k in range(2):
2835  *                 # This should rotate it into the vector plane
2836  *                 temp  = edges[i][0] * image.x_vec[0]             # <<<<<<<<<<<<<<
2837  *                 temp += edges[j][1] * image.x_vec[1]
2838  *                 temp += edges[k][2] * image.x_vec[2]
2839  */
2840         __pyx_v_temp = (((__pyx_v_edges[__pyx_v_i])[0]) * (__pyx_v_image->x_vec[0]));
2841 
2842         /* "yt/utilities/lib/lenses.pyx":38
2843  *                 # This should rotate it into the vector plane
2844  *                 temp  = edges[i][0] * image.x_vec[0]
2845  *                 temp += edges[j][1] * image.x_vec[1]             # <<<<<<<<<<<<<<
2846  *                 temp += edges[k][2] * image.x_vec[2]
2847  *                 if temp < extrema[0]: extrema[0] = temp
2848  */
2849         __pyx_v_temp = (__pyx_v_temp + (((__pyx_v_edges[__pyx_v_j])[1]) * (__pyx_v_image->x_vec[1])));
2850 
2851         /* "yt/utilities/lib/lenses.pyx":39
2852  *                 temp  = edges[i][0] * image.x_vec[0]
2853  *                 temp += edges[j][1] * image.x_vec[1]
2854  *                 temp += edges[k][2] * image.x_vec[2]             # <<<<<<<<<<<<<<
2855  *                 if temp < extrema[0]: extrema[0] = temp
2856  *                 if temp > extrema[1]: extrema[1] = temp
2857  */
2858         __pyx_v_temp = (__pyx_v_temp + (((__pyx_v_edges[__pyx_v_k])[2]) * (__pyx_v_image->x_vec[2])));
2859 
2860         /* "yt/utilities/lib/lenses.pyx":40
2861  *                 temp += edges[j][1] * image.x_vec[1]
2862  *                 temp += edges[k][2] * image.x_vec[2]
2863  *                 if temp < extrema[0]: extrema[0] = temp             # <<<<<<<<<<<<<<
2864  *                 if temp > extrema[1]: extrema[1] = temp
2865  *                 temp  = edges[i][0] * image.y_vec[0]
2866  */
2867         __pyx_t_5 = ((__pyx_v_temp < (__pyx_v_extrema[0])) != 0);
2868         if (__pyx_t_5) {
2869           (__pyx_v_extrema[0]) = __pyx_v_temp;
2870         }
2871 
2872         /* "yt/utilities/lib/lenses.pyx":41
2873  *                 temp += edges[k][2] * image.x_vec[2]
2874  *                 if temp < extrema[0]: extrema[0] = temp
2875  *                 if temp > extrema[1]: extrema[1] = temp             # <<<<<<<<<<<<<<
2876  *                 temp  = edges[i][0] * image.y_vec[0]
2877  *                 temp += edges[j][1] * image.y_vec[1]
2878  */
2879         __pyx_t_5 = ((__pyx_v_temp > (__pyx_v_extrema[1])) != 0);
2880         if (__pyx_t_5) {
2881           (__pyx_v_extrema[1]) = __pyx_v_temp;
2882         }
2883 
2884         /* "yt/utilities/lib/lenses.pyx":42
2885  *                 if temp < extrema[0]: extrema[0] = temp
2886  *                 if temp > extrema[1]: extrema[1] = temp
2887  *                 temp  = edges[i][0] * image.y_vec[0]             # <<<<<<<<<<<<<<
2888  *                 temp += edges[j][1] * image.y_vec[1]
2889  *                 temp += edges[k][2] * image.y_vec[2]
2890  */
2891         __pyx_v_temp = (((__pyx_v_edges[__pyx_v_i])[0]) * (__pyx_v_image->y_vec[0]));
2892 
2893         /* "yt/utilities/lib/lenses.pyx":43
2894  *                 if temp > extrema[1]: extrema[1] = temp
2895  *                 temp  = edges[i][0] * image.y_vec[0]
2896  *                 temp += edges[j][1] * image.y_vec[1]             # <<<<<<<<<<<<<<
2897  *                 temp += edges[k][2] * image.y_vec[2]
2898  *                 if temp < extrema[2]: extrema[2] = temp
2899  */
2900         __pyx_v_temp = (__pyx_v_temp + (((__pyx_v_edges[__pyx_v_j])[1]) * (__pyx_v_image->y_vec[1])));
2901 
2902         /* "yt/utilities/lib/lenses.pyx":44
2903  *                 temp  = edges[i][0] * image.y_vec[0]
2904  *                 temp += edges[j][1] * image.y_vec[1]
2905  *                 temp += edges[k][2] * image.y_vec[2]             # <<<<<<<<<<<<<<
2906  *                 if temp < extrema[2]: extrema[2] = temp
2907  *                 if temp > extrema[3]: extrema[3] = temp
2908  */
2909         __pyx_v_temp = (__pyx_v_temp + (((__pyx_v_edges[__pyx_v_k])[2]) * (__pyx_v_image->y_vec[2])));
2910 
2911         /* "yt/utilities/lib/lenses.pyx":45
2912  *                 temp += edges[j][1] * image.y_vec[1]
2913  *                 temp += edges[k][2] * image.y_vec[2]
2914  *                 if temp < extrema[2]: extrema[2] = temp             # <<<<<<<<<<<<<<
2915  *                 if temp > extrema[3]: extrema[3] = temp
2916  *     cx = cy = 0.0
2917  */
2918         __pyx_t_5 = ((__pyx_v_temp < (__pyx_v_extrema[2])) != 0);
2919         if (__pyx_t_5) {
2920           (__pyx_v_extrema[2]) = __pyx_v_temp;
2921         }
2922 
2923         /* "yt/utilities/lib/lenses.pyx":46
2924  *                 temp += edges[k][2] * image.y_vec[2]
2925  *                 if temp < extrema[2]: extrema[2] = temp
2926  *                 if temp > extrema[3]: extrema[3] = temp             # <<<<<<<<<<<<<<
2927  *     cx = cy = 0.0
2928  *     for i in range(3):
2929  */
2930         __pyx_t_5 = ((__pyx_v_temp > (__pyx_v_extrema[3])) != 0);
2931         if (__pyx_t_5) {
2932           (__pyx_v_extrema[3]) = __pyx_v_temp;
2933         }
2934       }
2935     }
2936   }
2937 
2938   /* "yt/utilities/lib/lenses.pyx":47
2939  *                 if temp < extrema[2]: extrema[2] = temp
2940  *                 if temp > extrema[3]: extrema[3] = temp
2941  *     cx = cy = 0.0             # <<<<<<<<<<<<<<
2942  *     for i in range(3):
2943  *         cx += image.center[i] * image.x_vec[i]
2944  */
2945   __pyx_v_cx = 0.0;
2946   __pyx_v_cy = 0.0;
2947 
2948   /* "yt/utilities/lib/lenses.pyx":48
2949  *                 if temp > extrema[3]: extrema[3] = temp
2950  *     cx = cy = 0.0
2951  *     for i in range(3):             # <<<<<<<<<<<<<<
2952  *         cx += image.center[i] * image.x_vec[i]
2953  *         cy += image.center[i] * image.y_vec[i]
2954  */
2955   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
2956     __pyx_v_i = __pyx_t_2;
2957 
2958     /* "yt/utilities/lib/lenses.pyx":49
2959  *     cx = cy = 0.0
2960  *     for i in range(3):
2961  *         cx += image.center[i] * image.x_vec[i]             # <<<<<<<<<<<<<<
2962  *         cy += image.center[i] * image.y_vec[i]
2963  *     rv[0] = lrint((extrema[0] - cx - image.bounds[0])/image.pdx)
2964  */
2965     __pyx_v_cx = (__pyx_v_cx + ((__pyx_v_image->center[__pyx_v_i]) * (__pyx_v_image->x_vec[__pyx_v_i])));
2966 
2967     /* "yt/utilities/lib/lenses.pyx":50
2968  *     for i in range(3):
2969  *         cx += image.center[i] * image.x_vec[i]
2970  *         cy += image.center[i] * image.y_vec[i]             # <<<<<<<<<<<<<<
2971  *     rv[0] = lrint((extrema[0] - cx - image.bounds[0])/image.pdx)
2972  *     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
2973  */
2974     __pyx_v_cy = (__pyx_v_cy + ((__pyx_v_image->center[__pyx_v_i]) * (__pyx_v_image->y_vec[__pyx_v_i])));
2975   }
2976 
2977   /* "yt/utilities/lib/lenses.pyx":51
2978  *         cx += image.center[i] * image.x_vec[i]
2979  *         cy += image.center[i] * image.y_vec[i]
2980  *     rv[0] = lrint((extrema[0] - cx - image.bounds[0])/image.pdx)             # <<<<<<<<<<<<<<
2981  *     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
2982  *     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
2983  */
2984   (__pyx_v_rv[0]) = lrint(((((__pyx_v_extrema[0]) - __pyx_v_cx) - (__pyx_v_image->bounds[0])) / __pyx_v_image->pdx));
2985 
2986   /* "yt/utilities/lib/lenses.pyx":52
2987  *         cy += image.center[i] * image.y_vec[i]
2988  *     rv[0] = lrint((extrema[0] - cx - image.bounds[0])/image.pdx)
2989  *     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)             # <<<<<<<<<<<<<<
2990  *     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
2991  *     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)
2992  */
2993   (__pyx_v_rv[1]) = ((__pyx_v_rv[0]) + lrint((((__pyx_v_extrema[1]) - (__pyx_v_extrema[0])) / __pyx_v_image->pdx)));
2994 
2995   /* "yt/utilities/lib/lenses.pyx":53
2996  *     rv[0] = lrint((extrema[0] - cx - image.bounds[0])/image.pdx)
2997  *     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
2998  *     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)             # <<<<<<<<<<<<<<
2999  *     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)
3000  *     return 0
3001  */
3002   (__pyx_v_rv[2]) = lrint(((((__pyx_v_extrema[2]) - __pyx_v_cy) - (__pyx_v_image->bounds[2])) / __pyx_v_image->pdy));
3003 
3004   /* "yt/utilities/lib/lenses.pyx":54
3005  *     rv[1] = rv[0] + lrint((extrema[1] - extrema[0])/image.pdx)
3006  *     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
3007  *     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)             # <<<<<<<<<<<<<<
3008  *     return 0
3009  *
3010  */
3011   (__pyx_v_rv[3]) = ((__pyx_v_rv[2]) + lrint((((__pyx_v_extrema[3]) - (__pyx_v_extrema[2])) / __pyx_v_image->pdy)));
3012 
3013   /* "yt/utilities/lib/lenses.pyx":55
3014  *     rv[2] = lrint((extrema[2] - cy - image.bounds[2])/image.pdy)
3015  *     rv[3] = rv[2] + lrint((extrema[3] - extrema[2])/image.pdy)
3016  *     return 0             # <<<<<<<<<<<<<<
3017  *
3018  * @cython.boundscheck(False)
3019  */
3020   __pyx_r = 0;
3021   goto __pyx_L0;
3022 
3023   /* "yt/utilities/lib/lenses.pyx":22
3024  * @cython.wraparound(False)
3025  * @cython.cdivision(True)
3026  * cdef int calculate_extent_plane_parallel(ImageSampler image,             # <<<<<<<<<<<<<<
3027  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3028  *     # We do this for all eight corners
3029  */
3030 
3031   /* function exit code */
3032   __pyx_L0:;
3033   return __pyx_r;
3034 }
3035 
3036 /* "yt/utilities/lib/lenses.pyx":60
3037  * @cython.wraparound(False)
3038  * @cython.cdivision(True)
3039  * cdef int calculate_extent_perspective(ImageSampler image,             # <<<<<<<<<<<<<<
3040  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3041  *
3042  */
3043 
__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler * __pyx_v_image,struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,__pyx_t_5numpy_int64_t * __pyx_v_rv)3044 static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) {
3045   __pyx_t_5numpy_float64_t __pyx_v_cam_pos[3];
3046   __pyx_t_5numpy_float64_t __pyx_v_cam_width[3];
3047   __pyx_t_5numpy_float64_t __pyx_v_north_vector[3];
3048   __pyx_t_5numpy_float64_t __pyx_v_east_vector[3];
3049   __pyx_t_5numpy_float64_t __pyx_v_normal_vector[3];
3050   __pyx_t_5numpy_float64_t __pyx_v_vertex[3];
3051   __pyx_t_5numpy_float64_t __pyx_v_pos1[3];
3052   __pyx_t_5numpy_float64_t __pyx_v_sight_vector[3];
3053   __pyx_t_5numpy_float64_t __pyx_v_sight_center[3];
3054   __pyx_t_5numpy_float64_t __pyx_v_corners[3][8];
3055   float __pyx_v_sight_vector_norm;
3056   float __pyx_v_sight_angle_cos;
3057   float __pyx_v_sight_length;
3058   float __pyx_v_dx;
3059   float __pyx_v_dy;
3060   int __pyx_v_i;
3061   int __pyx_v_iv;
3062   int __pyx_v_px;
3063   int __pyx_v_py;
3064   int __pyx_v_min_px;
3065   int __pyx_v_min_py;
3066   int __pyx_v_max_px;
3067   int __pyx_v_max_py;
3068   int __pyx_r;
3069   int __pyx_t_1;
3070   Py_ssize_t __pyx_t_2;
3071   Py_ssize_t __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   int __pyx_t_12;
3081   int __pyx_t_13;
3082   int __pyx_t_14;
3083   int __pyx_t_15;
3084   int __pyx_t_16;
3085   long __pyx_t_17;
3086   long __pyx_t_18;
3087 
3088   /* "yt/utilities/lib/lenses.pyx":77
3089  *     cdef int min_px, min_py, max_px, max_py
3090  *
3091  *     min_px = SHRT_MAX             # <<<<<<<<<<<<<<
3092  *     min_py = SHRT_MAX
3093  *     max_px = -SHRT_MAX
3094  */
3095   __pyx_v_min_px = SHRT_MAX;
3096 
3097   /* "yt/utilities/lib/lenses.pyx":78
3098  *
3099  *     min_px = SHRT_MAX
3100  *     min_py = SHRT_MAX             # <<<<<<<<<<<<<<
3101  *     max_px = -SHRT_MAX
3102  *     max_py = -SHRT_MAX
3103  */
3104   __pyx_v_min_py = SHRT_MAX;
3105 
3106   /* "yt/utilities/lib/lenses.pyx":79
3107  *     min_px = SHRT_MAX
3108  *     min_py = SHRT_MAX
3109  *     max_px = -SHRT_MAX             # <<<<<<<<<<<<<<
3110  *     max_py = -SHRT_MAX
3111  *
3112  */
3113   __pyx_v_max_px = (-SHRT_MAX);
3114 
3115   /* "yt/utilities/lib/lenses.pyx":80
3116  *     min_py = SHRT_MAX
3117  *     max_px = -SHRT_MAX
3118  *     max_py = -SHRT_MAX             # <<<<<<<<<<<<<<
3119  *
3120  *     # calculate vertices for 8 corners of vc
3121  */
3122   __pyx_v_max_py = (-SHRT_MAX);
3123 
3124   /* "yt/utilities/lib/lenses.pyx":83
3125  *
3126  *     # calculate vertices for 8 corners of vc
3127  *     corners[0][0] = vc.left_edge[0]             # <<<<<<<<<<<<<<
3128  *     corners[0][1] = vc.right_edge[0]
3129  *     corners[0][2] = vc.right_edge[0]
3130  */
3131   ((__pyx_v_corners[0])[0]) = (__pyx_v_vc->left_edge[0]);
3132 
3133   /* "yt/utilities/lib/lenses.pyx":84
3134  *     # calculate vertices for 8 corners of vc
3135  *     corners[0][0] = vc.left_edge[0]
3136  *     corners[0][1] = vc.right_edge[0]             # <<<<<<<<<<<<<<
3137  *     corners[0][2] = vc.right_edge[0]
3138  *     corners[0][3] = vc.left_edge[0]
3139  */
3140   ((__pyx_v_corners[0])[1]) = (__pyx_v_vc->right_edge[0]);
3141 
3142   /* "yt/utilities/lib/lenses.pyx":85
3143  *     corners[0][0] = vc.left_edge[0]
3144  *     corners[0][1] = vc.right_edge[0]
3145  *     corners[0][2] = vc.right_edge[0]             # <<<<<<<<<<<<<<
3146  *     corners[0][3] = vc.left_edge[0]
3147  *     corners[0][4] = vc.left_edge[0]
3148  */
3149   ((__pyx_v_corners[0])[2]) = (__pyx_v_vc->right_edge[0]);
3150 
3151   /* "yt/utilities/lib/lenses.pyx":86
3152  *     corners[0][1] = vc.right_edge[0]
3153  *     corners[0][2] = vc.right_edge[0]
3154  *     corners[0][3] = vc.left_edge[0]             # <<<<<<<<<<<<<<
3155  *     corners[0][4] = vc.left_edge[0]
3156  *     corners[0][5] = vc.right_edge[0]
3157  */
3158   ((__pyx_v_corners[0])[3]) = (__pyx_v_vc->left_edge[0]);
3159 
3160   /* "yt/utilities/lib/lenses.pyx":87
3161  *     corners[0][2] = vc.right_edge[0]
3162  *     corners[0][3] = vc.left_edge[0]
3163  *     corners[0][4] = vc.left_edge[0]             # <<<<<<<<<<<<<<
3164  *     corners[0][5] = vc.right_edge[0]
3165  *     corners[0][6] = vc.right_edge[0]
3166  */
3167   ((__pyx_v_corners[0])[4]) = (__pyx_v_vc->left_edge[0]);
3168 
3169   /* "yt/utilities/lib/lenses.pyx":88
3170  *     corners[0][3] = vc.left_edge[0]
3171  *     corners[0][4] = vc.left_edge[0]
3172  *     corners[0][5] = vc.right_edge[0]             # <<<<<<<<<<<<<<
3173  *     corners[0][6] = vc.right_edge[0]
3174  *     corners[0][7] = vc.left_edge[0]
3175  */
3176   ((__pyx_v_corners[0])[5]) = (__pyx_v_vc->right_edge[0]);
3177 
3178   /* "yt/utilities/lib/lenses.pyx":89
3179  *     corners[0][4] = vc.left_edge[0]
3180  *     corners[0][5] = vc.right_edge[0]
3181  *     corners[0][6] = vc.right_edge[0]             # <<<<<<<<<<<<<<
3182  *     corners[0][7] = vc.left_edge[0]
3183  *
3184  */
3185   ((__pyx_v_corners[0])[6]) = (__pyx_v_vc->right_edge[0]);
3186 
3187   /* "yt/utilities/lib/lenses.pyx":90
3188  *     corners[0][5] = vc.right_edge[0]
3189  *     corners[0][6] = vc.right_edge[0]
3190  *     corners[0][7] = vc.left_edge[0]             # <<<<<<<<<<<<<<
3191  *
3192  *     corners[1][0] = vc.left_edge[1]
3193  */
3194   ((__pyx_v_corners[0])[7]) = (__pyx_v_vc->left_edge[0]);
3195 
3196   /* "yt/utilities/lib/lenses.pyx":92
3197  *     corners[0][7] = vc.left_edge[0]
3198  *
3199  *     corners[1][0] = vc.left_edge[1]             # <<<<<<<<<<<<<<
3200  *     corners[1][1] = vc.left_edge[1]
3201  *     corners[1][2] = vc.right_edge[1]
3202  */
3203   ((__pyx_v_corners[1])[0]) = (__pyx_v_vc->left_edge[1]);
3204 
3205   /* "yt/utilities/lib/lenses.pyx":93
3206  *
3207  *     corners[1][0] = vc.left_edge[1]
3208  *     corners[1][1] = vc.left_edge[1]             # <<<<<<<<<<<<<<
3209  *     corners[1][2] = vc.right_edge[1]
3210  *     corners[1][3] = vc.right_edge[1]
3211  */
3212   ((__pyx_v_corners[1])[1]) = (__pyx_v_vc->left_edge[1]);
3213 
3214   /* "yt/utilities/lib/lenses.pyx":94
3215  *     corners[1][0] = vc.left_edge[1]
3216  *     corners[1][1] = vc.left_edge[1]
3217  *     corners[1][2] = vc.right_edge[1]             # <<<<<<<<<<<<<<
3218  *     corners[1][3] = vc.right_edge[1]
3219  *     corners[1][4] = vc.left_edge[1]
3220  */
3221   ((__pyx_v_corners[1])[2]) = (__pyx_v_vc->right_edge[1]);
3222 
3223   /* "yt/utilities/lib/lenses.pyx":95
3224  *     corners[1][1] = vc.left_edge[1]
3225  *     corners[1][2] = vc.right_edge[1]
3226  *     corners[1][3] = vc.right_edge[1]             # <<<<<<<<<<<<<<
3227  *     corners[1][4] = vc.left_edge[1]
3228  *     corners[1][5] = vc.left_edge[1]
3229  */
3230   ((__pyx_v_corners[1])[3]) = (__pyx_v_vc->right_edge[1]);
3231 
3232   /* "yt/utilities/lib/lenses.pyx":96
3233  *     corners[1][2] = vc.right_edge[1]
3234  *     corners[1][3] = vc.right_edge[1]
3235  *     corners[1][4] = vc.left_edge[1]             # <<<<<<<<<<<<<<
3236  *     corners[1][5] = vc.left_edge[1]
3237  *     corners[1][6] = vc.right_edge[1]
3238  */
3239   ((__pyx_v_corners[1])[4]) = (__pyx_v_vc->left_edge[1]);
3240 
3241   /* "yt/utilities/lib/lenses.pyx":97
3242  *     corners[1][3] = vc.right_edge[1]
3243  *     corners[1][4] = vc.left_edge[1]
3244  *     corners[1][5] = vc.left_edge[1]             # <<<<<<<<<<<<<<
3245  *     corners[1][6] = vc.right_edge[1]
3246  *     corners[1][7] = vc.right_edge[1]
3247  */
3248   ((__pyx_v_corners[1])[5]) = (__pyx_v_vc->left_edge[1]);
3249 
3250   /* "yt/utilities/lib/lenses.pyx":98
3251  *     corners[1][4] = vc.left_edge[1]
3252  *     corners[1][5] = vc.left_edge[1]
3253  *     corners[1][6] = vc.right_edge[1]             # <<<<<<<<<<<<<<
3254  *     corners[1][7] = vc.right_edge[1]
3255  *
3256  */
3257   ((__pyx_v_corners[1])[6]) = (__pyx_v_vc->right_edge[1]);
3258 
3259   /* "yt/utilities/lib/lenses.pyx":99
3260  *     corners[1][5] = vc.left_edge[1]
3261  *     corners[1][6] = vc.right_edge[1]
3262  *     corners[1][7] = vc.right_edge[1]             # <<<<<<<<<<<<<<
3263  *
3264  *     corners[2][0] = vc.left_edge[2]
3265  */
3266   ((__pyx_v_corners[1])[7]) = (__pyx_v_vc->right_edge[1]);
3267 
3268   /* "yt/utilities/lib/lenses.pyx":101
3269  *     corners[1][7] = vc.right_edge[1]
3270  *
3271  *     corners[2][0] = vc.left_edge[2]             # <<<<<<<<<<<<<<
3272  *     corners[2][1] = vc.left_edge[2]
3273  *     corners[2][2] = vc.left_edge[2]
3274  */
3275   ((__pyx_v_corners[2])[0]) = (__pyx_v_vc->left_edge[2]);
3276 
3277   /* "yt/utilities/lib/lenses.pyx":102
3278  *
3279  *     corners[2][0] = vc.left_edge[2]
3280  *     corners[2][1] = vc.left_edge[2]             # <<<<<<<<<<<<<<
3281  *     corners[2][2] = vc.left_edge[2]
3282  *     corners[2][3] = vc.left_edge[2]
3283  */
3284   ((__pyx_v_corners[2])[1]) = (__pyx_v_vc->left_edge[2]);
3285 
3286   /* "yt/utilities/lib/lenses.pyx":103
3287  *     corners[2][0] = vc.left_edge[2]
3288  *     corners[2][1] = vc.left_edge[2]
3289  *     corners[2][2] = vc.left_edge[2]             # <<<<<<<<<<<<<<
3290  *     corners[2][3] = vc.left_edge[2]
3291  *     corners[2][4] = vc.right_edge[2]
3292  */
3293   ((__pyx_v_corners[2])[2]) = (__pyx_v_vc->left_edge[2]);
3294 
3295   /* "yt/utilities/lib/lenses.pyx":104
3296  *     corners[2][1] = vc.left_edge[2]
3297  *     corners[2][2] = vc.left_edge[2]
3298  *     corners[2][3] = vc.left_edge[2]             # <<<<<<<<<<<<<<
3299  *     corners[2][4] = vc.right_edge[2]
3300  *     corners[2][5] = vc.right_edge[2]
3301  */
3302   ((__pyx_v_corners[2])[3]) = (__pyx_v_vc->left_edge[2]);
3303 
3304   /* "yt/utilities/lib/lenses.pyx":105
3305  *     corners[2][2] = vc.left_edge[2]
3306  *     corners[2][3] = vc.left_edge[2]
3307  *     corners[2][4] = vc.right_edge[2]             # <<<<<<<<<<<<<<
3308  *     corners[2][5] = vc.right_edge[2]
3309  *     corners[2][6] = vc.right_edge[2]
3310  */
3311   ((__pyx_v_corners[2])[4]) = (__pyx_v_vc->right_edge[2]);
3312 
3313   /* "yt/utilities/lib/lenses.pyx":106
3314  *     corners[2][3] = vc.left_edge[2]
3315  *     corners[2][4] = vc.right_edge[2]
3316  *     corners[2][5] = vc.right_edge[2]             # <<<<<<<<<<<<<<
3317  *     corners[2][6] = vc.right_edge[2]
3318  *     corners[2][7] = vc.right_edge[2]
3319  */
3320   ((__pyx_v_corners[2])[5]) = (__pyx_v_vc->right_edge[2]);
3321 
3322   /* "yt/utilities/lib/lenses.pyx":107
3323  *     corners[2][4] = vc.right_edge[2]
3324  *     corners[2][5] = vc.right_edge[2]
3325  *     corners[2][6] = vc.right_edge[2]             # <<<<<<<<<<<<<<
3326  *     corners[2][7] = vc.right_edge[2]
3327  *
3328  */
3329   ((__pyx_v_corners[2])[6]) = (__pyx_v_vc->right_edge[2]);
3330 
3331   /* "yt/utilities/lib/lenses.pyx":108
3332  *     corners[2][5] = vc.right_edge[2]
3333  *     corners[2][6] = vc.right_edge[2]
3334  *     corners[2][7] = vc.right_edge[2]             # <<<<<<<<<<<<<<
3335  *
3336  *     # This code was ported from
3337  */
3338   ((__pyx_v_corners[2])[7]) = (__pyx_v_vc->right_edge[2]);
3339 
3340   /* "yt/utilities/lib/lenses.pyx":112
3341  *     # This code was ported from
3342  *     #   yt.visualization.volume_rendering.lens.PerspectiveLens.project_to_plane()
3343  *     for i in range(3):             # <<<<<<<<<<<<<<
3344  *         cam_pos[i] = image.camera_data[0, i]
3345  *         cam_width[i] = image.camera_data[1, i]
3346  */
3347   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
3348     __pyx_v_i = __pyx_t_1;
3349 
3350     /* "yt/utilities/lib/lenses.pyx":113
3351  *     #   yt.visualization.volume_rendering.lens.PerspectiveLens.project_to_plane()
3352  *     for i in range(3):
3353  *         cam_pos[i] = image.camera_data[0, i]             # <<<<<<<<<<<<<<
3354  *         cam_width[i] = image.camera_data[1, i]
3355  *         east_vector[i] = image.camera_data[2, i]
3356  */
3357     if (unlikely(!__pyx_v_image->camera_data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 113, __pyx_L1_error)}
3358     __pyx_t_2 = 0;
3359     __pyx_t_3 = __pyx_v_i;
3360     (__pyx_v_cam_pos[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image->camera_data.data + __pyx_t_2 * __pyx_v_image->camera_data.strides[0]) ) + __pyx_t_3 * __pyx_v_image->camera_data.strides[1]) )));
3361 
3362     /* "yt/utilities/lib/lenses.pyx":114
3363  *     for i in range(3):
3364  *         cam_pos[i] = image.camera_data[0, i]
3365  *         cam_width[i] = image.camera_data[1, i]             # <<<<<<<<<<<<<<
3366  *         east_vector[i] = image.camera_data[2, i]
3367  *         north_vector[i] = image.camera_data[3, i]
3368  */
3369     if (unlikely(!__pyx_v_image->camera_data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 114, __pyx_L1_error)}
3370     __pyx_t_4 = 1;
3371     __pyx_t_5 = __pyx_v_i;
3372     (__pyx_v_cam_width[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image->camera_data.data + __pyx_t_4 * __pyx_v_image->camera_data.strides[0]) ) + __pyx_t_5 * __pyx_v_image->camera_data.strides[1]) )));
3373 
3374     /* "yt/utilities/lib/lenses.pyx":115
3375  *         cam_pos[i] = image.camera_data[0, i]
3376  *         cam_width[i] = image.camera_data[1, i]
3377  *         east_vector[i] = image.camera_data[2, i]             # <<<<<<<<<<<<<<
3378  *         north_vector[i] = image.camera_data[3, i]
3379  *         normal_vector[i] = image.camera_data[4, i]
3380  */
3381     if (unlikely(!__pyx_v_image->camera_data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 115, __pyx_L1_error)}
3382     __pyx_t_6 = 2;
3383     __pyx_t_7 = __pyx_v_i;
3384     (__pyx_v_east_vector[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image->camera_data.data + __pyx_t_6 * __pyx_v_image->camera_data.strides[0]) ) + __pyx_t_7 * __pyx_v_image->camera_data.strides[1]) )));
3385 
3386     /* "yt/utilities/lib/lenses.pyx":116
3387  *         cam_width[i] = image.camera_data[1, i]
3388  *         east_vector[i] = image.camera_data[2, i]
3389  *         north_vector[i] = image.camera_data[3, i]             # <<<<<<<<<<<<<<
3390  *         normal_vector[i] = image.camera_data[4, i]
3391  *
3392  */
3393     if (unlikely(!__pyx_v_image->camera_data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 116, __pyx_L1_error)}
3394     __pyx_t_8 = 3;
3395     __pyx_t_9 = __pyx_v_i;
3396     (__pyx_v_north_vector[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image->camera_data.data + __pyx_t_8 * __pyx_v_image->camera_data.strides[0]) ) + __pyx_t_9 * __pyx_v_image->camera_data.strides[1]) )));
3397 
3398     /* "yt/utilities/lib/lenses.pyx":117
3399  *         east_vector[i] = image.camera_data[2, i]
3400  *         north_vector[i] = image.camera_data[3, i]
3401  *         normal_vector[i] = image.camera_data[4, i]             # <<<<<<<<<<<<<<
3402  *
3403  *     for iv in range(8):
3404  */
3405     if (unlikely(!__pyx_v_image->camera_data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 117, __pyx_L1_error)}
3406     __pyx_t_10 = 4;
3407     __pyx_t_11 = __pyx_v_i;
3408     (__pyx_v_normal_vector[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_image->camera_data.data + __pyx_t_10 * __pyx_v_image->camera_data.strides[0]) ) + __pyx_t_11 * __pyx_v_image->camera_data.strides[1]) )));
3409   }
3410 
3411   /* "yt/utilities/lib/lenses.pyx":119
3412  *         normal_vector[i] = image.camera_data[4, i]
3413  *
3414  *     for iv in range(8):             # <<<<<<<<<<<<<<
3415  *         vertex[0] = corners[0][iv]
3416  *         vertex[1] = corners[1][iv]
3417  */
3418   for (__pyx_t_1 = 0; __pyx_t_1 < 8; __pyx_t_1+=1) {
3419     __pyx_v_iv = __pyx_t_1;
3420 
3421     /* "yt/utilities/lib/lenses.pyx":120
3422  *
3423  *     for iv in range(8):
3424  *         vertex[0] = corners[0][iv]             # <<<<<<<<<<<<<<
3425  *         vertex[1] = corners[1][iv]
3426  *         vertex[2] = corners[2][iv]
3427  */
3428     (__pyx_v_vertex[0]) = ((__pyx_v_corners[0])[__pyx_v_iv]);
3429 
3430     /* "yt/utilities/lib/lenses.pyx":121
3431  *     for iv in range(8):
3432  *         vertex[0] = corners[0][iv]
3433  *         vertex[1] = corners[1][iv]             # <<<<<<<<<<<<<<
3434  *         vertex[2] = corners[2][iv]
3435  *
3436  */
3437     (__pyx_v_vertex[1]) = ((__pyx_v_corners[1])[__pyx_v_iv]);
3438 
3439     /* "yt/utilities/lib/lenses.pyx":122
3440  *         vertex[0] = corners[0][iv]
3441  *         vertex[1] = corners[1][iv]
3442  *         vertex[2] = corners[2][iv]             # <<<<<<<<<<<<<<
3443  *
3444  *         cam_width[1] = cam_width[0] * image.nv[1] / image.nv[0]
3445  */
3446     (__pyx_v_vertex[2]) = ((__pyx_v_corners[2])[__pyx_v_iv]);
3447 
3448     /* "yt/utilities/lib/lenses.pyx":124
3449  *         vertex[2] = corners[2][iv]
3450  *
3451  *         cam_width[1] = cam_width[0] * image.nv[1] / image.nv[0]             # <<<<<<<<<<<<<<
3452  *
3453  *         subtract(vertex, cam_pos, sight_vector)
3454  */
3455     (__pyx_v_cam_width[1]) = (((__pyx_v_cam_width[0]) * (__pyx_v_image->nv[1])) / (__pyx_v_image->nv[0]));
3456 
3457     /* "yt/utilities/lib/lenses.pyx":126
3458  *         cam_width[1] = cam_width[0] * image.nv[1] / image.nv[0]
3459  *
3460  *         subtract(vertex, cam_pos, sight_vector)             # <<<<<<<<<<<<<<
3461  *         fma(cam_width[2], normal_vector, cam_pos, sight_center)
3462  *
3463  */
3464     __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_vertex, __pyx_v_cam_pos, __pyx_v_sight_vector);
3465 
3466     /* "yt/utilities/lib/lenses.pyx":127
3467  *
3468  *         subtract(vertex, cam_pos, sight_vector)
3469  *         fma(cam_width[2], normal_vector, cam_pos, sight_center)             # <<<<<<<<<<<<<<
3470  *
3471  *         sight_vector_norm = L2_norm(sight_vector)
3472  */
3473     __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma((__pyx_v_cam_width[2]), __pyx_v_normal_vector, __pyx_v_cam_pos, __pyx_v_sight_center);
3474 
3475     /* "yt/utilities/lib/lenses.pyx":129
3476  *         fma(cam_width[2], normal_vector, cam_pos, sight_center)
3477  *
3478  *         sight_vector_norm = L2_norm(sight_vector)             # <<<<<<<<<<<<<<
3479  *
3480  *         if sight_vector_norm != 0:
3481  */
3482     __pyx_v_sight_vector_norm = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(__pyx_v_sight_vector);
3483 
3484     /* "yt/utilities/lib/lenses.pyx":131
3485  *         sight_vector_norm = L2_norm(sight_vector)
3486  *
3487  *         if sight_vector_norm != 0:             # <<<<<<<<<<<<<<
3488  *             for i in range(3):
3489  *                 sight_vector[i] /= sight_vector_norm
3490  */
3491     __pyx_t_12 = ((__pyx_v_sight_vector_norm != 0.0) != 0);
3492     if (__pyx_t_12) {
3493 
3494       /* "yt/utilities/lib/lenses.pyx":132
3495  *
3496  *         if sight_vector_norm != 0:
3497  *             for i in range(3):             # <<<<<<<<<<<<<<
3498  *                 sight_vector[i] /= sight_vector_norm
3499  *
3500  */
3501       for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) {
3502         __pyx_v_i = __pyx_t_13;
3503 
3504         /* "yt/utilities/lib/lenses.pyx":133
3505  *         if sight_vector_norm != 0:
3506  *             for i in range(3):
3507  *                 sight_vector[i] /= sight_vector_norm             # <<<<<<<<<<<<<<
3508  *
3509  *         sight_angle_cos = dot(sight_vector, normal_vector)
3510  */
3511         __pyx_t_14 = __pyx_v_i;
3512         (__pyx_v_sight_vector[__pyx_t_14]) = ((__pyx_v_sight_vector[__pyx_t_14]) / __pyx_v_sight_vector_norm);
3513       }
3514 
3515       /* "yt/utilities/lib/lenses.pyx":131
3516  *         sight_vector_norm = L2_norm(sight_vector)
3517  *
3518  *         if sight_vector_norm != 0:             # <<<<<<<<<<<<<<
3519  *             for i in range(3):
3520  *                 sight_vector[i] /= sight_vector_norm
3521  */
3522     }
3523 
3524     /* "yt/utilities/lib/lenses.pyx":135
3525  *                 sight_vector[i] /= sight_vector_norm
3526  *
3527  *         sight_angle_cos = dot(sight_vector, normal_vector)             # <<<<<<<<<<<<<<
3528  *         sight_angle_cos = fclip(sight_angle_cos, -1.0, 1.0)
3529  *
3530  */
3531     __pyx_v_sight_angle_cos = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_sight_vector, __pyx_v_normal_vector);
3532 
3533     /* "yt/utilities/lib/lenses.pyx":136
3534  *
3535  *         sight_angle_cos = dot(sight_vector, normal_vector)
3536  *         sight_angle_cos = fclip(sight_angle_cos, -1.0, 1.0)             # <<<<<<<<<<<<<<
3537  *
3538  *         if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0:
3539  */
3540     __pyx_v_sight_angle_cos = __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_v_sight_angle_cos, -1.0, 1.0);
3541 
3542     /* "yt/utilities/lib/lenses.pyx":138
3543  *         sight_angle_cos = fclip(sight_angle_cos, -1.0, 1.0)
3544  *
3545  *         if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0:             # <<<<<<<<<<<<<<
3546  *             sight_length = cam_width[2] / sight_angle_cos
3547  *         else:
3548  */
3549     __pyx_t_15 = ((acos(__pyx_v_sight_angle_cos) < (0.5 * M_PI)) != 0);
3550     if (__pyx_t_15) {
3551     } else {
3552       __pyx_t_12 = __pyx_t_15;
3553       goto __pyx_L11_bool_binop_done;
3554     }
3555     __pyx_t_15 = ((__pyx_v_sight_angle_cos != 0.0) != 0);
3556     __pyx_t_12 = __pyx_t_15;
3557     __pyx_L11_bool_binop_done:;
3558     if (__pyx_t_12) {
3559 
3560       /* "yt/utilities/lib/lenses.pyx":139
3561  *
3562  *         if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0:
3563  *             sight_length = cam_width[2] / sight_angle_cos             # <<<<<<<<<<<<<<
3564  *         else:
3565  *             sight_length = sqrt(cam_width[0] * cam_width[0] +
3566  */
3567       __pyx_v_sight_length = ((__pyx_v_cam_width[2]) / __pyx_v_sight_angle_cos);
3568 
3569       /* "yt/utilities/lib/lenses.pyx":138
3570  *         sight_angle_cos = fclip(sight_angle_cos, -1.0, 1.0)
3571  *
3572  *         if acos(sight_angle_cos) < 0.5 * M_PI and sight_angle_cos != 0.0:             # <<<<<<<<<<<<<<
3573  *             sight_length = cam_width[2] / sight_angle_cos
3574  *         else:
3575  */
3576       goto __pyx_L10;
3577     }
3578 
3579     /* "yt/utilities/lib/lenses.pyx":141
3580  *             sight_length = cam_width[2] / sight_angle_cos
3581  *         else:
3582  *             sight_length = sqrt(cam_width[0] * cam_width[0] +             # <<<<<<<<<<<<<<
3583  *                                 cam_width[1] * cam_width[1])
3584  *             sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos)
3585  */
3586     /*else*/ {
3587 
3588       /* "yt/utilities/lib/lenses.pyx":142
3589  *         else:
3590  *             sight_length = sqrt(cam_width[0] * cam_width[0] +
3591  *                                 cam_width[1] * cam_width[1])             # <<<<<<<<<<<<<<
3592  *             sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos)
3593  *
3594  */
3595       __pyx_v_sight_length = sqrt((((__pyx_v_cam_width[0]) * (__pyx_v_cam_width[0])) + ((__pyx_v_cam_width[1]) * (__pyx_v_cam_width[1]))));
3596 
3597       /* "yt/utilities/lib/lenses.pyx":143
3598  *             sight_length = sqrt(cam_width[0] * cam_width[0] +
3599  *                                 cam_width[1] * cam_width[1])
3600  *             sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos)             # <<<<<<<<<<<<<<
3601  *
3602  *         fma(sight_length, sight_vector, cam_pos, pos1)
3603  */
3604       __pyx_v_sight_length = (__pyx_v_sight_length / sqrt((1.0 - (__pyx_v_sight_angle_cos * __pyx_v_sight_angle_cos))));
3605     }
3606     __pyx_L10:;
3607 
3608     /* "yt/utilities/lib/lenses.pyx":145
3609  *             sight_length /= sqrt(1.0 - sight_angle_cos * sight_angle_cos)
3610  *
3611  *         fma(sight_length, sight_vector, cam_pos, pos1)             # <<<<<<<<<<<<<<
3612  *         subtract(pos1, sight_center, pos1)
3613  *         dx = dot(pos1, east_vector)
3614  */
3615     __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(__pyx_v_sight_length, __pyx_v_sight_vector, __pyx_v_cam_pos, __pyx_v_pos1);
3616 
3617     /* "yt/utilities/lib/lenses.pyx":146
3618  *
3619  *         fma(sight_length, sight_vector, cam_pos, pos1)
3620  *         subtract(pos1, sight_center, pos1)             # <<<<<<<<<<<<<<
3621  *         dx = dot(pos1, east_vector)
3622  *         dy = dot(pos1, north_vector)
3623  */
3624     __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(__pyx_v_pos1, __pyx_v_sight_center, __pyx_v_pos1);
3625 
3626     /* "yt/utilities/lib/lenses.pyx":147
3627  *         fma(sight_length, sight_vector, cam_pos, pos1)
3628  *         subtract(pos1, sight_center, pos1)
3629  *         dx = dot(pos1, east_vector)             # <<<<<<<<<<<<<<
3630  *         dy = dot(pos1, north_vector)
3631  *
3632  */
3633     __pyx_v_dx = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_pos1, __pyx_v_east_vector);
3634 
3635     /* "yt/utilities/lib/lenses.pyx":148
3636  *         subtract(pos1, sight_center, pos1)
3637  *         dx = dot(pos1, east_vector)
3638  *         dy = dot(pos1, north_vector)             # <<<<<<<<<<<<<<
3639  *
3640  *         px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx)
3641  */
3642     __pyx_v_dy = __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(__pyx_v_pos1, __pyx_v_north_vector);
3643 
3644     /* "yt/utilities/lib/lenses.pyx":150
3645  *         dy = dot(pos1, north_vector)
3646  *
3647  *         px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx)             # <<<<<<<<<<<<<<
3648  *         py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy)
3649  *         min_px = min(min_px, px)
3650  */
3651     __pyx_v_px = ((int)(((__pyx_v_image->nv[0]) * 0.5) + (((__pyx_v_image->nv[0]) / (__pyx_v_cam_width[0])) * __pyx_v_dx)));
3652 
3653     /* "yt/utilities/lib/lenses.pyx":151
3654  *
3655  *         px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx)
3656  *         py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy)             # <<<<<<<<<<<<<<
3657  *         min_px = min(min_px, px)
3658  *         max_px = max(max_px, px)
3659  */
3660     __pyx_v_py = ((int)(((__pyx_v_image->nv[1]) * 0.5) + (((__pyx_v_image->nv[1]) / (__pyx_v_cam_width[1])) * __pyx_v_dy)));
3661 
3662     /* "yt/utilities/lib/lenses.pyx":152
3663  *         px = int(image.nv[0] * 0.5 + image.nv[0] / cam_width[0] * dx)
3664  *         py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy)
3665  *         min_px = min(min_px, px)             # <<<<<<<<<<<<<<
3666  *         max_px = max(max_px, px)
3667  *         min_py = min(min_py, py)
3668  */
3669     __pyx_t_13 = __pyx_v_px;
3670     __pyx_t_14 = __pyx_v_min_px;
3671     if (((__pyx_t_13 < __pyx_t_14) != 0)) {
3672       __pyx_t_16 = __pyx_t_13;
3673     } else {
3674       __pyx_t_16 = __pyx_t_14;
3675     }
3676     __pyx_v_min_px = __pyx_t_16;
3677 
3678     /* "yt/utilities/lib/lenses.pyx":153
3679  *         py = int(image.nv[1] * 0.5 + image.nv[1] / cam_width[1] * dy)
3680  *         min_px = min(min_px, px)
3681  *         max_px = max(max_px, px)             # <<<<<<<<<<<<<<
3682  *         min_py = min(min_py, py)
3683  *         max_py = max(max_py, py)
3684  */
3685     __pyx_t_16 = __pyx_v_px;
3686     __pyx_t_13 = __pyx_v_max_px;
3687     if (((__pyx_t_16 > __pyx_t_13) != 0)) {
3688       __pyx_t_14 = __pyx_t_16;
3689     } else {
3690       __pyx_t_14 = __pyx_t_13;
3691     }
3692     __pyx_v_max_px = __pyx_t_14;
3693 
3694     /* "yt/utilities/lib/lenses.pyx":154
3695  *         min_px = min(min_px, px)
3696  *         max_px = max(max_px, px)
3697  *         min_py = min(min_py, py)             # <<<<<<<<<<<<<<
3698  *         max_py = max(max_py, py)
3699  *
3700  */
3701     __pyx_t_14 = __pyx_v_py;
3702     __pyx_t_16 = __pyx_v_min_py;
3703     if (((__pyx_t_14 < __pyx_t_16) != 0)) {
3704       __pyx_t_13 = __pyx_t_14;
3705     } else {
3706       __pyx_t_13 = __pyx_t_16;
3707     }
3708     __pyx_v_min_py = __pyx_t_13;
3709 
3710     /* "yt/utilities/lib/lenses.pyx":155
3711  *         max_px = max(max_px, px)
3712  *         min_py = min(min_py, py)
3713  *         max_py = max(max_py, py)             # <<<<<<<<<<<<<<
3714  *
3715  *     rv[0] = max(min_px, 0)
3716  */
3717     __pyx_t_13 = __pyx_v_py;
3718     __pyx_t_14 = __pyx_v_max_py;
3719     if (((__pyx_t_13 > __pyx_t_14) != 0)) {
3720       __pyx_t_16 = __pyx_t_13;
3721     } else {
3722       __pyx_t_16 = __pyx_t_14;
3723     }
3724     __pyx_v_max_py = __pyx_t_16;
3725   }
3726 
3727   /* "yt/utilities/lib/lenses.pyx":157
3728  *         max_py = max(max_py, py)
3729  *
3730  *     rv[0] = max(min_px, 0)             # <<<<<<<<<<<<<<
3731  *     rv[1] = min(max_px, image.nv[0])
3732  *     rv[2] = max(min_py, 0)
3733  */
3734   __pyx_t_17 = 0;
3735   __pyx_t_1 = __pyx_v_min_px;
3736   if (((__pyx_t_17 > __pyx_t_1) != 0)) {
3737     __pyx_t_18 = __pyx_t_17;
3738   } else {
3739     __pyx_t_18 = __pyx_t_1;
3740   }
3741   (__pyx_v_rv[0]) = __pyx_t_18;
3742 
3743   /* "yt/utilities/lib/lenses.pyx":158
3744  *
3745  *     rv[0] = max(min_px, 0)
3746  *     rv[1] = min(max_px, image.nv[0])             # <<<<<<<<<<<<<<
3747  *     rv[2] = max(min_py, 0)
3748  *     rv[3] = min(max_py, image.nv[1])
3749  */
3750   __pyx_t_1 = (__pyx_v_image->nv[0]);
3751   __pyx_t_16 = __pyx_v_max_px;
3752   if (((__pyx_t_1 < __pyx_t_16) != 0)) {
3753     __pyx_t_13 = __pyx_t_1;
3754   } else {
3755     __pyx_t_13 = __pyx_t_16;
3756   }
3757   (__pyx_v_rv[1]) = __pyx_t_13;
3758 
3759   /* "yt/utilities/lib/lenses.pyx":159
3760  *     rv[0] = max(min_px, 0)
3761  *     rv[1] = min(max_px, image.nv[0])
3762  *     rv[2] = max(min_py, 0)             # <<<<<<<<<<<<<<
3763  *     rv[3] = min(max_py, image.nv[1])
3764  *     return 0
3765  */
3766   __pyx_t_18 = 0;
3767   __pyx_t_13 = __pyx_v_min_py;
3768   if (((__pyx_t_18 > __pyx_t_13) != 0)) {
3769     __pyx_t_17 = __pyx_t_18;
3770   } else {
3771     __pyx_t_17 = __pyx_t_13;
3772   }
3773   (__pyx_v_rv[2]) = __pyx_t_17;
3774 
3775   /* "yt/utilities/lib/lenses.pyx":160
3776  *     rv[1] = min(max_px, image.nv[0])
3777  *     rv[2] = max(min_py, 0)
3778  *     rv[3] = min(max_py, image.nv[1])             # <<<<<<<<<<<<<<
3779  *     return 0
3780  *
3781  */
3782   __pyx_t_13 = (__pyx_v_image->nv[1]);
3783   __pyx_t_1 = __pyx_v_max_py;
3784   if (((__pyx_t_13 < __pyx_t_1) != 0)) {
3785     __pyx_t_16 = __pyx_t_13;
3786   } else {
3787     __pyx_t_16 = __pyx_t_1;
3788   }
3789   (__pyx_v_rv[3]) = __pyx_t_16;
3790 
3791   /* "yt/utilities/lib/lenses.pyx":161
3792  *     rv[2] = max(min_py, 0)
3793  *     rv[3] = min(max_py, image.nv[1])
3794  *     return 0             # <<<<<<<<<<<<<<
3795  *
3796  * # We do this for a bunch of lenses.  Fallback is to grab them from the vector
3797  */
3798   __pyx_r = 0;
3799   goto __pyx_L0;
3800 
3801   /* "yt/utilities/lib/lenses.pyx":60
3802  * @cython.wraparound(False)
3803  * @cython.cdivision(True)
3804  * cdef int calculate_extent_perspective(ImageSampler image,             # <<<<<<<<<<<<<<
3805  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3806  *
3807  */
3808 
3809   /* function exit code */
3810   __pyx_L1_error:;
3811   {
3812     #ifdef WITH_THREAD
3813     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
3814     #endif
3815     __Pyx_AddTraceback("yt.utilities.lib.lenses.calculate_extent_perspective", __pyx_clineno, __pyx_lineno, __pyx_filename);
3816     #ifdef WITH_THREAD
3817     __Pyx_PyGILState_Release(__pyx_gilstate_save);
3818     #endif
3819   }
3820   __pyx_r = -1;
3821   __pyx_L0:;
3822   return __pyx_r;
3823 }
3824 
3825 /* "yt/utilities/lib/lenses.pyx":169
3826  * @cython.wraparound(False)
3827  * @cython.cdivision(True)
3828  * cdef int calculate_extent_null(ImageSampler image,             # <<<<<<<<<<<<<<
3829  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3830  *     rv[0] = 0
3831  */
3832 
__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler * __pyx_v_image,CYTHON_UNUSED struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer * __pyx_v_vc,__pyx_t_5numpy_int64_t * __pyx_v_rv)3833 static int __pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_image, CYTHON_UNUSED struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *__pyx_v_vc, __pyx_t_5numpy_int64_t *__pyx_v_rv) {
3834   int __pyx_r;
3835 
3836   /* "yt/utilities/lib/lenses.pyx":171
3837  * cdef int calculate_extent_null(ImageSampler image,
3838  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3839  *     rv[0] = 0             # <<<<<<<<<<<<<<
3840  *     rv[1] = image.nv[0]
3841  *     rv[2] = 0
3842  */
3843   (__pyx_v_rv[0]) = 0;
3844 
3845   /* "yt/utilities/lib/lenses.pyx":172
3846  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3847  *     rv[0] = 0
3848  *     rv[1] = image.nv[0]             # <<<<<<<<<<<<<<
3849  *     rv[2] = 0
3850  *     rv[3] = image.nv[1]
3851  */
3852   (__pyx_v_rv[1]) = (__pyx_v_image->nv[0]);
3853 
3854   /* "yt/utilities/lib/lenses.pyx":173
3855  *     rv[0] = 0
3856  *     rv[1] = image.nv[0]
3857  *     rv[2] = 0             # <<<<<<<<<<<<<<
3858  *     rv[3] = image.nv[1]
3859  *     return 0
3860  */
3861   (__pyx_v_rv[2]) = 0;
3862 
3863   /* "yt/utilities/lib/lenses.pyx":174
3864  *     rv[1] = image.nv[0]
3865  *     rv[2] = 0
3866  *     rv[3] = image.nv[1]             # <<<<<<<<<<<<<<
3867  *     return 0
3868  *
3869  */
3870   (__pyx_v_rv[3]) = (__pyx_v_image->nv[1]);
3871 
3872   /* "yt/utilities/lib/lenses.pyx":175
3873  *     rv[2] = 0
3874  *     rv[3] = image.nv[1]
3875  *     return 0             # <<<<<<<<<<<<<<
3876  *
3877  * @cython.boundscheck(False)
3878  */
3879   __pyx_r = 0;
3880   goto __pyx_L0;
3881 
3882   /* "yt/utilities/lib/lenses.pyx":169
3883  * @cython.wraparound(False)
3884  * @cython.cdivision(True)
3885  * cdef int calculate_extent_null(ImageSampler image,             # <<<<<<<<<<<<<<
3886  *             VolumeContainer *vc, np.int64_t rv[4]) nogil except -1:
3887  *     rv[0] = 0
3888  */
3889 
3890   /* function exit code */
3891   __pyx_L0:;
3892   return __pyx_r;
3893 }
3894 
3895 /* "yt/utilities/lib/lenses.pyx":179
3896  * @cython.boundscheck(False)
3897  * @cython.wraparound(False)
3898  * cdef void generate_vector_info_plane_parallel(ImageSampler im,             # <<<<<<<<<<<<<<
3899  *             np.int64_t vi, np.int64_t vj,
3900  *             np.float64_t width[2],
3901  */
3902 
__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler * __pyx_v_im,__pyx_t_5numpy_int64_t __pyx_v_vi,__pyx_t_5numpy_int64_t __pyx_v_vj,__pyx_t_5numpy_float64_t * __pyx_v_width,__pyx_t_5numpy_float64_t * __pyx_v_v_dir,__pyx_t_5numpy_float64_t * __pyx_v_v_pos)3903 static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) {
3904   int __pyx_v_i;
3905   __pyx_t_5numpy_float64_t __pyx_v_px;
3906   __pyx_t_5numpy_float64_t __pyx_v_py;
3907   __pyx_t_5numpy_float64_t __pyx_t_1;
3908   __pyx_t_5numpy_float64_t __pyx_t_2;
3909   Py_ssize_t __pyx_t_3;
3910   Py_ssize_t __pyx_t_4;
3911   Py_ssize_t __pyx_t_5;
3912   Py_ssize_t __pyx_t_6;
3913   Py_ssize_t __pyx_t_7;
3914   Py_ssize_t __pyx_t_8;
3915   Py_ssize_t __pyx_t_9;
3916   Py_ssize_t __pyx_t_10;
3917   Py_ssize_t __pyx_t_11;
3918   Py_ssize_t __pyx_t_12;
3919   Py_ssize_t __pyx_t_13;
3920   Py_ssize_t __pyx_t_14;
3921   Py_ssize_t __pyx_t_15;
3922   Py_ssize_t __pyx_t_16;
3923   Py_ssize_t __pyx_t_17;
3924   Py_ssize_t __pyx_t_18;
3925   Py_ssize_t __pyx_t_19;
3926   Py_ssize_t __pyx_t_20;
3927   Py_ssize_t __pyx_t_21;
3928   Py_ssize_t __pyx_t_22;
3929   Py_ssize_t __pyx_t_23;
3930   Py_ssize_t __pyx_t_24;
3931   Py_ssize_t __pyx_t_25;
3932   Py_ssize_t __pyx_t_26;
3933   Py_ssize_t __pyx_t_27;
3934   Py_ssize_t __pyx_t_28;
3935   Py_ssize_t __pyx_t_29;
3936   int __pyx_t_30;
3937   Py_ssize_t __pyx_t_31;
3938   Py_ssize_t __pyx_t_32;
3939   Py_ssize_t __pyx_t_33;
3940 
3941   /* "yt/utilities/lib/lenses.pyx":186
3942  *     cdef int i
3943  *     cdef np.float64_t px, py
3944  *     px = width[0] * (<np.float64_t>vi)/(<np.float64_t>im.nv[0]-1) - width[0]/2.0             # <<<<<<<<<<<<<<
3945  *     py = width[1] * (<np.float64_t>vj)/(<np.float64_t>im.nv[1]-1) - width[1]/2.0
3946  *     # atleast_3d will add to beginning and end
3947  */
3948   __pyx_t_1 = ((__pyx_v_width[0]) * ((__pyx_t_5numpy_float64_t)__pyx_v_vi));
3949   __pyx_t_2 = (((__pyx_t_5numpy_float64_t)(__pyx_v_im->nv[0])) - 1.0);
3950   if (unlikely(__pyx_t_2 == 0)) {
3951     #ifdef WITH_THREAD
3952     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
3953     #endif
3954     PyErr_SetString(PyExc_ZeroDivisionError, "float division");
3955     #ifdef WITH_THREAD
3956     __Pyx_PyGILState_Release(__pyx_gilstate_save);
3957     #endif
3958     __PYX_ERR(0, 186, __pyx_L1_error)
3959   }
3960   __pyx_v_px = ((__pyx_t_1 / __pyx_t_2) - ((__pyx_v_width[0]) / 2.0));
3961 
3962   /* "yt/utilities/lib/lenses.pyx":187
3963  *     cdef np.float64_t px, py
3964  *     px = width[0] * (<np.float64_t>vi)/(<np.float64_t>im.nv[0]-1) - width[0]/2.0
3965  *     py = width[1] * (<np.float64_t>vj)/(<np.float64_t>im.nv[1]-1) - width[1]/2.0             # <<<<<<<<<<<<<<
3966  *     # atleast_3d will add to beginning and end
3967  *     v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0]
3968  */
3969   __pyx_t_2 = ((__pyx_v_width[1]) * ((__pyx_t_5numpy_float64_t)__pyx_v_vj));
3970   __pyx_t_1 = (((__pyx_t_5numpy_float64_t)(__pyx_v_im->nv[1])) - 1.0);
3971   if (unlikely(__pyx_t_1 == 0)) {
3972     #ifdef WITH_THREAD
3973     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
3974     #endif
3975     PyErr_SetString(PyExc_ZeroDivisionError, "float division");
3976     #ifdef WITH_THREAD
3977     __Pyx_PyGILState_Release(__pyx_gilstate_save);
3978     #endif
3979     __PYX_ERR(0, 187, __pyx_L1_error)
3980   }
3981   __pyx_v_py = ((__pyx_t_2 / __pyx_t_1) - ((__pyx_v_width[1]) / 2.0));
3982 
3983   /* "yt/utilities/lib/lenses.pyx":189
3984  *     py = width[1] * (<np.float64_t>vj)/(<np.float64_t>im.nv[1]-1) - width[1]/2.0
3985  *     # atleast_3d will add to beginning and end
3986  *     v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0]             # <<<<<<<<<<<<<<
3987  *     v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0]
3988  *     v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0]
3989  */
3990   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 189, __pyx_L1_error)}
3991   __pyx_t_3 = 0;
3992   __pyx_t_4 = 0;
3993   __pyx_t_5 = 0;
3994   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 189, __pyx_L1_error)}
3995   __pyx_t_6 = 0;
3996   __pyx_t_7 = 3;
3997   __pyx_t_8 = 0;
3998   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 189, __pyx_L1_error)}
3999   __pyx_t_9 = 0;
4000   __pyx_t_10 = 9;
4001   __pyx_t_11 = 0;
4002   (__pyx_v_v_pos[0]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_3 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_4 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_5 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_6 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_7 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_8 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_9 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_10 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_11 * __pyx_v_im->vp_pos.strides[2]) ))));
4003 
4004   /* "yt/utilities/lib/lenses.pyx":190
4005  *     # atleast_3d will add to beginning and end
4006  *     v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0]
4007  *     v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0]             # <<<<<<<<<<<<<<
4008  *     v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0]
4009  *     for i in range(3): v_dir[i] = im.vp_dir[0,i,0]
4010  */
4011   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)}
4012   __pyx_t_12 = 0;
4013   __pyx_t_13 = 1;
4014   __pyx_t_14 = 0;
4015   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)}
4016   __pyx_t_15 = 0;
4017   __pyx_t_16 = 4;
4018   __pyx_t_17 = 0;
4019   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 190, __pyx_L1_error)}
4020   __pyx_t_18 = 0;
4021   __pyx_t_19 = 10;
4022   __pyx_t_20 = 0;
4023   (__pyx_v_v_pos[1]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_12 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_13 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_14 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_15 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_16 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_17 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_18 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_19 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_20 * __pyx_v_im->vp_pos.strides[2]) ))));
4024 
4025   /* "yt/utilities/lib/lenses.pyx":191
4026  *     v_pos[0] = im.vp_pos[0,0,0]*px + im.vp_pos[0,3,0]*py + im.vp_pos[0,9,0]
4027  *     v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0]
4028  *     v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0]             # <<<<<<<<<<<<<<
4029  *     for i in range(3): v_dir[i] = im.vp_dir[0,i,0]
4030  *
4031  */
4032   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)}
4033   __pyx_t_21 = 0;
4034   __pyx_t_22 = 2;
4035   __pyx_t_23 = 0;
4036   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)}
4037   __pyx_t_24 = 0;
4038   __pyx_t_25 = 5;
4039   __pyx_t_26 = 0;
4040   if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 191, __pyx_L1_error)}
4041   __pyx_t_27 = 0;
4042   __pyx_t_28 = 11;
4043   __pyx_t_29 = 0;
4044   (__pyx_v_v_pos[2]) = ((((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_21 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_22 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_23 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_px) + ((*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_24 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_25 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_26 * __pyx_v_im->vp_pos.strides[2]) ))) * __pyx_v_py)) + (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_27 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_28 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_29 * __pyx_v_im->vp_pos.strides[2]) ))));
4045 
4046   /* "yt/utilities/lib/lenses.pyx":192
4047  *     v_pos[1] = im.vp_pos[0,1,0]*px + im.vp_pos[0,4,0]*py + im.vp_pos[0,10,0]
4048  *     v_pos[2] = im.vp_pos[0,2,0]*px + im.vp_pos[0,5,0]*py + im.vp_pos[0,11,0]
4049  *     for i in range(3): v_dir[i] = im.vp_dir[0,i,0]             # <<<<<<<<<<<<<<
4050  *
4051  * @cython.boundscheck(False)
4052  */
4053   for (__pyx_t_30 = 0; __pyx_t_30 < 3; __pyx_t_30+=1) {
4054     __pyx_v_i = __pyx_t_30;
4055     if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 192, __pyx_L1_error)}
4056     __pyx_t_31 = 0;
4057     __pyx_t_32 = __pyx_v_i;
4058     __pyx_t_33 = 0;
4059     (__pyx_v_v_dir[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_dir.data + __pyx_t_31 * __pyx_v_im->vp_dir.strides[0]) ) + __pyx_t_32 * __pyx_v_im->vp_dir.strides[1]) ) + __pyx_t_33 * __pyx_v_im->vp_dir.strides[2]) )));
4060   }
4061 
4062   /* "yt/utilities/lib/lenses.pyx":179
4063  * @cython.boundscheck(False)
4064  * @cython.wraparound(False)
4065  * cdef void generate_vector_info_plane_parallel(ImageSampler im,             # <<<<<<<<<<<<<<
4066  *             np.int64_t vi, np.int64_t vj,
4067  *             np.float64_t width[2],
4068  */
4069 
4070   /* function exit code */
4071   goto __pyx_L0;
4072   __pyx_L1_error:;
4073   __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_plane_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
4074   __pyx_L0:;
4075 }
4076 
4077 /* "yt/utilities/lib/lenses.pyx":196
4078  * @cython.boundscheck(False)
4079  * @cython.wraparound(False)
4080  * cdef void generate_vector_info_null(ImageSampler im,             # <<<<<<<<<<<<<<
4081  *             np.int64_t vi, np.int64_t vj,
4082  *             np.float64_t width[2],
4083  */
4084 
__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler * __pyx_v_im,__pyx_t_5numpy_int64_t __pyx_v_vi,__pyx_t_5numpy_int64_t __pyx_v_vj,CYTHON_UNUSED __pyx_t_5numpy_float64_t * __pyx_v_width,__pyx_t_5numpy_float64_t * __pyx_v_v_dir,__pyx_t_5numpy_float64_t * __pyx_v_v_pos)4085 static void __pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null(struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *__pyx_v_im, __pyx_t_5numpy_int64_t __pyx_v_vi, __pyx_t_5numpy_int64_t __pyx_v_vj, CYTHON_UNUSED __pyx_t_5numpy_float64_t *__pyx_v_width, __pyx_t_5numpy_float64_t *__pyx_v_v_dir, __pyx_t_5numpy_float64_t *__pyx_v_v_pos) {
4086   int __pyx_v_i;
4087   int __pyx_t_1;
4088   __pyx_t_5numpy_int64_t __pyx_t_2;
4089   __pyx_t_5numpy_int64_t __pyx_t_3;
4090   Py_ssize_t __pyx_t_4;
4091   __pyx_t_5numpy_int64_t __pyx_t_5;
4092   __pyx_t_5numpy_int64_t __pyx_t_6;
4093   Py_ssize_t __pyx_t_7;
4094 
4095   /* "yt/utilities/lib/lenses.pyx":202
4096  *             np.float64_t v_dir[3], np.float64_t v_pos[3]) nogil:
4097  *     cdef int i
4098  *     for i in range(3):             # <<<<<<<<<<<<<<
4099  *         # Here's a funny thing: we use vi here because our *image* will be
4100  *         # flattened.  That means that im.nv will be a better one-d offset,
4101  */
4102   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
4103     __pyx_v_i = __pyx_t_1;
4104 
4105     /* "yt/utilities/lib/lenses.pyx":206
4106  *         # flattened.  That means that im.nv will be a better one-d offset,
4107  *         # since vp_pos has funny strides.
4108  *         v_pos[i] = im.vp_pos[vi, vj, i]             # <<<<<<<<<<<<<<
4109  *         v_dir[i] = im.vp_dir[vi, vj, i]
4110  */
4111     if (unlikely(!__pyx_v_im->vp_pos.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 206, __pyx_L1_error)}
4112     __pyx_t_2 = __pyx_v_vi;
4113     __pyx_t_3 = __pyx_v_vj;
4114     __pyx_t_4 = __pyx_v_i;
4115     (__pyx_v_v_pos[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_pos.data + __pyx_t_2 * __pyx_v_im->vp_pos.strides[0]) ) + __pyx_t_3 * __pyx_v_im->vp_pos.strides[1]) ) + __pyx_t_4 * __pyx_v_im->vp_pos.strides[2]) )));
4116 
4117     /* "yt/utilities/lib/lenses.pyx":207
4118  *         # since vp_pos has funny strides.
4119  *         v_pos[i] = im.vp_pos[vi, vj, i]
4120  *         v_dir[i] = im.vp_dir[vi, vj, i]             # <<<<<<<<<<<<<<
4121  */
4122     if (unlikely(!__pyx_v_im->vp_dir.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 207, __pyx_L1_error)}
4123     __pyx_t_5 = __pyx_v_vi;
4124     __pyx_t_6 = __pyx_v_vj;
4125     __pyx_t_7 = __pyx_v_i;
4126     (__pyx_v_v_dir[__pyx_v_i]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_im->vp_dir.data + __pyx_t_5 * __pyx_v_im->vp_dir.strides[0]) ) + __pyx_t_6 * __pyx_v_im->vp_dir.strides[1]) ) + __pyx_t_7 * __pyx_v_im->vp_dir.strides[2]) )));
4127   }
4128 
4129   /* "yt/utilities/lib/lenses.pyx":196
4130  * @cython.boundscheck(False)
4131  * @cython.wraparound(False)
4132  * cdef void generate_vector_info_null(ImageSampler im,             # <<<<<<<<<<<<<<
4133  *             np.int64_t vi, np.int64_t vj,
4134  *             np.float64_t width[2],
4135  */
4136 
4137   /* function exit code */
4138   goto __pyx_L0;
4139   __pyx_L1_error:;
4140   __Pyx_WriteUnraisable("yt.utilities.lib.lenses.generate_vector_info_null", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
4141   __pyx_L0:;
4142 }
4143 
4144 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
4145  *         # experimental exception made for __getbuffer__ and __releasebuffer__
4146  *         # -- the details of this may change.
4147  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
4148  *             # This implementation of getbuffer is geared towards Cython
4149  *             # requirements, and does not yet fulfill the PEP.
4150  */
4151 
4152 /* Python wrapper */
4153 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)4154 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
4155   int __pyx_r;
4156   __Pyx_RefNannyDeclarations
4157   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
4158   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
4159 
4160   /* function exit code */
4161   __Pyx_RefNannyFinishContext();
4162   return __pyx_r;
4163 }
4164 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)4165 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
4166   int __pyx_v_i;
4167   int __pyx_v_ndim;
4168   int __pyx_v_endian_detector;
4169   int __pyx_v_little_endian;
4170   int __pyx_v_t;
4171   char *__pyx_v_f;
4172   PyArray_Descr *__pyx_v_descr = 0;
4173   int __pyx_v_offset;
4174   int __pyx_r;
4175   __Pyx_RefNannyDeclarations
4176   int __pyx_t_1;
4177   int __pyx_t_2;
4178   PyObject *__pyx_t_3 = NULL;
4179   int __pyx_t_4;
4180   int __pyx_t_5;
4181   int __pyx_t_6;
4182   PyArray_Descr *__pyx_t_7;
4183   PyObject *__pyx_t_8 = NULL;
4184   char *__pyx_t_9;
4185   if (__pyx_v_info == NULL) {
4186     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
4187     return -1;
4188   }
4189   __Pyx_RefNannySetupContext("__getbuffer__", 0);
4190   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
4191   __Pyx_GIVEREF(__pyx_v_info->obj);
4192 
4193   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
4194  *
4195  *             cdef int i, ndim
4196  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
4197  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4198  *
4199  */
4200   __pyx_v_endian_detector = 1;
4201 
4202   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
4203  *             cdef int i, ndim
4204  *             cdef int endian_detector = 1
4205  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
4206  *
4207  *             ndim = PyArray_NDIM(self)
4208  */
4209   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4210 
4211   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
4212  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4213  *
4214  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
4215  *
4216  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4217  */
4218   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
4219 
4220   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4221  *             ndim = PyArray_NDIM(self)
4222  *
4223  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
4224  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4225  *                 raise ValueError(u"ndarray is not C contiguous")
4226  */
4227   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
4228   if (__pyx_t_2) {
4229   } else {
4230     __pyx_t_1 = __pyx_t_2;
4231     goto __pyx_L4_bool_binop_done;
4232   }
4233 
4234   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
4235  *
4236  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4237  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
4238  *                 raise ValueError(u"ndarray is not C contiguous")
4239  *
4240  */
4241   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
4242   __pyx_t_1 = __pyx_t_2;
4243   __pyx_L4_bool_binop_done:;
4244 
4245   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4246  *             ndim = PyArray_NDIM(self)
4247  *
4248  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
4249  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4250  *                 raise ValueError(u"ndarray is not C contiguous")
4251  */
4252   if (unlikely(__pyx_t_1)) {
4253 
4254     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
4255  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4256  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4257  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
4258  *
4259  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4260  */
4261     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
4262     __Pyx_GOTREF(__pyx_t_3);
4263     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4264     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4265     __PYX_ERR(1, 272, __pyx_L1_error)
4266 
4267     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
4268  *             ndim = PyArray_NDIM(self)
4269  *
4270  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
4271  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4272  *                 raise ValueError(u"ndarray is not C contiguous")
4273  */
4274   }
4275 
4276   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4277  *                 raise ValueError(u"ndarray is not C contiguous")
4278  *
4279  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
4280  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4281  *                 raise ValueError(u"ndarray is not Fortran contiguous")
4282  */
4283   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
4284   if (__pyx_t_2) {
4285   } else {
4286     __pyx_t_1 = __pyx_t_2;
4287     goto __pyx_L7_bool_binop_done;
4288   }
4289 
4290   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
4291  *
4292  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4293  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
4294  *                 raise ValueError(u"ndarray is not Fortran contiguous")
4295  *
4296  */
4297   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
4298   __pyx_t_1 = __pyx_t_2;
4299   __pyx_L7_bool_binop_done:;
4300 
4301   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4302  *                 raise ValueError(u"ndarray is not C contiguous")
4303  *
4304  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
4305  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4306  *                 raise ValueError(u"ndarray is not Fortran contiguous")
4307  */
4308   if (unlikely(__pyx_t_1)) {
4309 
4310     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
4311  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4312  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4313  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
4314  *
4315  *             info.buf = PyArray_DATA(self)
4316  */
4317     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
4318     __Pyx_GOTREF(__pyx_t_3);
4319     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4320     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4321     __PYX_ERR(1, 276, __pyx_L1_error)
4322 
4323     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
4324  *                 raise ValueError(u"ndarray is not C contiguous")
4325  *
4326  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
4327  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4328  *                 raise ValueError(u"ndarray is not Fortran contiguous")
4329  */
4330   }
4331 
4332   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
4333  *                 raise ValueError(u"ndarray is not Fortran contiguous")
4334  *
4335  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
4336  *             info.ndim = ndim
4337  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4338  */
4339   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
4340 
4341   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
4342  *
4343  *             info.buf = PyArray_DATA(self)
4344  *             info.ndim = ndim             # <<<<<<<<<<<<<<
4345  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4346  *                 # Allocate new buffer for strides and shape info.
4347  */
4348   __pyx_v_info->ndim = __pyx_v_ndim;
4349 
4350   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
4351  *             info.buf = PyArray_DATA(self)
4352  *             info.ndim = ndim
4353  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4354  *                 # Allocate new buffer for strides and shape info.
4355  *                 # This is allocated as one block, strides first.
4356  */
4357   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4358   if (__pyx_t_1) {
4359 
4360     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
4361  *                 # Allocate new buffer for strides and shape info.
4362  *                 # This is allocated as one block, strides first.
4363  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
4364  *                 info.shape = info.strides + ndim
4365  *                 for i in range(ndim):
4366  */
4367     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
4368 
4369     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
4370  *                 # This is allocated as one block, strides first.
4371  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4372  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
4373  *                 for i in range(ndim):
4374  *                     info.strides[i] = PyArray_STRIDES(self)[i]
4375  */
4376     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
4377 
4378     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
4379  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
4380  *                 info.shape = info.strides + ndim
4381  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
4382  *                     info.strides[i] = PyArray_STRIDES(self)[i]
4383  *                     info.shape[i] = PyArray_DIMS(self)[i]
4384  */
4385     __pyx_t_4 = __pyx_v_ndim;
4386     __pyx_t_5 = __pyx_t_4;
4387     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4388       __pyx_v_i = __pyx_t_6;
4389 
4390       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
4391  *                 info.shape = info.strides + ndim
4392  *                 for i in range(ndim):
4393  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
4394  *                     info.shape[i] = PyArray_DIMS(self)[i]
4395  *             else:
4396  */
4397       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
4398 
4399       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
4400  *                 for i in range(ndim):
4401  *                     info.strides[i] = PyArray_STRIDES(self)[i]
4402  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
4403  *             else:
4404  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4405  */
4406       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
4407     }
4408 
4409     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
4410  *             info.buf = PyArray_DATA(self)
4411  *             info.ndim = ndim
4412  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4413  *                 # Allocate new buffer for strides and shape info.
4414  *                 # This is allocated as one block, strides first.
4415  */
4416     goto __pyx_L9;
4417   }
4418 
4419   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
4420  *                     info.shape[i] = PyArray_DIMS(self)[i]
4421  *             else:
4422  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
4423  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4424  *             info.suboffsets = NULL
4425  */
4426   /*else*/ {
4427     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
4428 
4429     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
4430  *             else:
4431  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4432  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
4433  *             info.suboffsets = NULL
4434  *             info.itemsize = PyArray_ITEMSIZE(self)
4435  */
4436     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
4437   }
4438   __pyx_L9:;
4439 
4440   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
4441  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
4442  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4443  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
4444  *             info.itemsize = PyArray_ITEMSIZE(self)
4445  *             info.readonly = not PyArray_ISWRITEABLE(self)
4446  */
4447   __pyx_v_info->suboffsets = NULL;
4448 
4449   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
4450  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
4451  *             info.suboffsets = NULL
4452  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
4453  *             info.readonly = not PyArray_ISWRITEABLE(self)
4454  *
4455  */
4456   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
4457 
4458   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
4459  *             info.suboffsets = NULL
4460  *             info.itemsize = PyArray_ITEMSIZE(self)
4461  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
4462  *
4463  *             cdef int t
4464  */
4465   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
4466 
4467   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
4468  *
4469  *             cdef int t
4470  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
4471  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
4472  *             cdef int offset
4473  */
4474   __pyx_v_f = NULL;
4475 
4476   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
4477  *             cdef int t
4478  *             cdef char* f = NULL
4479  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
4480  *             cdef int offset
4481  *
4482  */
4483   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
4484   __pyx_t_3 = ((PyObject *)__pyx_t_7);
4485   __Pyx_INCREF(__pyx_t_3);
4486   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
4487   __pyx_t_3 = 0;
4488 
4489   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
4490  *             cdef int offset
4491  *
4492  *             info.obj = self             # <<<<<<<<<<<<<<
4493  *
4494  *             if not PyDataType_HASFIELDS(descr):
4495  */
4496   __Pyx_INCREF(((PyObject *)__pyx_v_self));
4497   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4498   __Pyx_GOTREF(__pyx_v_info->obj);
4499   __Pyx_DECREF(__pyx_v_info->obj);
4500   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
4501 
4502   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
4503  *             info.obj = self
4504  *
4505  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
4506  *                 t = descr.type_num
4507  *                 if ((descr.byteorder == c'>' and little_endian) or
4508  */
4509   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
4510   if (__pyx_t_1) {
4511 
4512     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
4513  *
4514  *             if not PyDataType_HASFIELDS(descr):
4515  *                 t = descr.type_num             # <<<<<<<<<<<<<<
4516  *                 if ((descr.byteorder == c'>' and little_endian) or
4517  *                     (descr.byteorder == c'<' and not little_endian)):
4518  */
4519     __pyx_t_4 = __pyx_v_descr->type_num;
4520     __pyx_v_t = __pyx_t_4;
4521 
4522     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4523  *             if not PyDataType_HASFIELDS(descr):
4524  *                 t = descr.type_num
4525  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4526  *                     (descr.byteorder == c'<' and not little_endian)):
4527  *                     raise ValueError(u"Non-native byte order not supported")
4528  */
4529     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
4530     if (!__pyx_t_2) {
4531       goto __pyx_L15_next_or;
4532     } else {
4533     }
4534     __pyx_t_2 = (__pyx_v_little_endian != 0);
4535     if (!__pyx_t_2) {
4536     } else {
4537       __pyx_t_1 = __pyx_t_2;
4538       goto __pyx_L14_bool_binop_done;
4539     }
4540     __pyx_L15_next_or:;
4541 
4542     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
4543  *                 t = descr.type_num
4544  *                 if ((descr.byteorder == c'>' and little_endian) or
4545  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
4546  *                     raise ValueError(u"Non-native byte order not supported")
4547  *                 if   t == NPY_BYTE:        f = "b"
4548  */
4549     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
4550     if (__pyx_t_2) {
4551     } else {
4552       __pyx_t_1 = __pyx_t_2;
4553       goto __pyx_L14_bool_binop_done;
4554     }
4555     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
4556     __pyx_t_1 = __pyx_t_2;
4557     __pyx_L14_bool_binop_done:;
4558 
4559     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4560  *             if not PyDataType_HASFIELDS(descr):
4561  *                 t = descr.type_num
4562  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4563  *                     (descr.byteorder == c'<' and not little_endian)):
4564  *                     raise ValueError(u"Non-native byte order not supported")
4565  */
4566     if (unlikely(__pyx_t_1)) {
4567 
4568       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
4569  *                 if ((descr.byteorder == c'>' and little_endian) or
4570  *                     (descr.byteorder == c'<' and not little_endian)):
4571  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
4572  *                 if   t == NPY_BYTE:        f = "b"
4573  *                 elif t == NPY_UBYTE:       f = "B"
4574  */
4575       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
4576       __Pyx_GOTREF(__pyx_t_3);
4577       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4578       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4579       __PYX_ERR(1, 306, __pyx_L1_error)
4580 
4581       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
4582  *             if not PyDataType_HASFIELDS(descr):
4583  *                 t = descr.type_num
4584  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
4585  *                     (descr.byteorder == c'<' and not little_endian)):
4586  *                     raise ValueError(u"Non-native byte order not supported")
4587  */
4588     }
4589 
4590     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
4591  *                     (descr.byteorder == c'<' and not little_endian)):
4592  *                     raise ValueError(u"Non-native byte order not supported")
4593  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
4594  *                 elif t == NPY_UBYTE:       f = "B"
4595  *                 elif t == NPY_SHORT:       f = "h"
4596  */
4597     switch (__pyx_v_t) {
4598       case NPY_BYTE:
4599       __pyx_v_f = ((char *)"b");
4600       break;
4601       case NPY_UBYTE:
4602 
4603       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
4604  *                     raise ValueError(u"Non-native byte order not supported")
4605  *                 if   t == NPY_BYTE:        f = "b"
4606  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
4607  *                 elif t == NPY_SHORT:       f = "h"
4608  *                 elif t == NPY_USHORT:      f = "H"
4609  */
4610       __pyx_v_f = ((char *)"B");
4611       break;
4612       case NPY_SHORT:
4613 
4614       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
4615  *                 if   t == NPY_BYTE:        f = "b"
4616  *                 elif t == NPY_UBYTE:       f = "B"
4617  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
4618  *                 elif t == NPY_USHORT:      f = "H"
4619  *                 elif t == NPY_INT:         f = "i"
4620  */
4621       __pyx_v_f = ((char *)"h");
4622       break;
4623       case NPY_USHORT:
4624 
4625       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
4626  *                 elif t == NPY_UBYTE:       f = "B"
4627  *                 elif t == NPY_SHORT:       f = "h"
4628  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
4629  *                 elif t == NPY_INT:         f = "i"
4630  *                 elif t == NPY_UINT:        f = "I"
4631  */
4632       __pyx_v_f = ((char *)"H");
4633       break;
4634       case NPY_INT:
4635 
4636       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
4637  *                 elif t == NPY_SHORT:       f = "h"
4638  *                 elif t == NPY_USHORT:      f = "H"
4639  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
4640  *                 elif t == NPY_UINT:        f = "I"
4641  *                 elif t == NPY_LONG:        f = "l"
4642  */
4643       __pyx_v_f = ((char *)"i");
4644       break;
4645       case NPY_UINT:
4646 
4647       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
4648  *                 elif t == NPY_USHORT:      f = "H"
4649  *                 elif t == NPY_INT:         f = "i"
4650  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
4651  *                 elif t == NPY_LONG:        f = "l"
4652  *                 elif t == NPY_ULONG:       f = "L"
4653  */
4654       __pyx_v_f = ((char *)"I");
4655       break;
4656       case NPY_LONG:
4657 
4658       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
4659  *                 elif t == NPY_INT:         f = "i"
4660  *                 elif t == NPY_UINT:        f = "I"
4661  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
4662  *                 elif t == NPY_ULONG:       f = "L"
4663  *                 elif t == NPY_LONGLONG:    f = "q"
4664  */
4665       __pyx_v_f = ((char *)"l");
4666       break;
4667       case NPY_ULONG:
4668 
4669       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
4670  *                 elif t == NPY_UINT:        f = "I"
4671  *                 elif t == NPY_LONG:        f = "l"
4672  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
4673  *                 elif t == NPY_LONGLONG:    f = "q"
4674  *                 elif t == NPY_ULONGLONG:   f = "Q"
4675  */
4676       __pyx_v_f = ((char *)"L");
4677       break;
4678       case NPY_LONGLONG:
4679 
4680       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
4681  *                 elif t == NPY_LONG:        f = "l"
4682  *                 elif t == NPY_ULONG:       f = "L"
4683  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
4684  *                 elif t == NPY_ULONGLONG:   f = "Q"
4685  *                 elif t == NPY_FLOAT:       f = "f"
4686  */
4687       __pyx_v_f = ((char *)"q");
4688       break;
4689       case NPY_ULONGLONG:
4690 
4691       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
4692  *                 elif t == NPY_ULONG:       f = "L"
4693  *                 elif t == NPY_LONGLONG:    f = "q"
4694  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
4695  *                 elif t == NPY_FLOAT:       f = "f"
4696  *                 elif t == NPY_DOUBLE:      f = "d"
4697  */
4698       __pyx_v_f = ((char *)"Q");
4699       break;
4700       case NPY_FLOAT:
4701 
4702       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
4703  *                 elif t == NPY_LONGLONG:    f = "q"
4704  *                 elif t == NPY_ULONGLONG:   f = "Q"
4705  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
4706  *                 elif t == NPY_DOUBLE:      f = "d"
4707  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4708  */
4709       __pyx_v_f = ((char *)"f");
4710       break;
4711       case NPY_DOUBLE:
4712 
4713       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
4714  *                 elif t == NPY_ULONGLONG:   f = "Q"
4715  *                 elif t == NPY_FLOAT:       f = "f"
4716  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
4717  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4718  *                 elif t == NPY_CFLOAT:      f = "Zf"
4719  */
4720       __pyx_v_f = ((char *)"d");
4721       break;
4722       case NPY_LONGDOUBLE:
4723 
4724       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
4725  *                 elif t == NPY_FLOAT:       f = "f"
4726  *                 elif t == NPY_DOUBLE:      f = "d"
4727  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
4728  *                 elif t == NPY_CFLOAT:      f = "Zf"
4729  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4730  */
4731       __pyx_v_f = ((char *)"g");
4732       break;
4733       case NPY_CFLOAT:
4734 
4735       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
4736  *                 elif t == NPY_DOUBLE:      f = "d"
4737  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4738  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
4739  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4740  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4741  */
4742       __pyx_v_f = ((char *)"Zf");
4743       break;
4744       case NPY_CDOUBLE:
4745 
4746       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
4747  *                 elif t == NPY_LONGDOUBLE:  f = "g"
4748  *                 elif t == NPY_CFLOAT:      f = "Zf"
4749  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
4750  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4751  *                 elif t == NPY_OBJECT:      f = "O"
4752  */
4753       __pyx_v_f = ((char *)"Zd");
4754       break;
4755       case NPY_CLONGDOUBLE:
4756 
4757       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
4758  *                 elif t == NPY_CFLOAT:      f = "Zf"
4759  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4760  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
4761  *                 elif t == NPY_OBJECT:      f = "O"
4762  *                 else:
4763  */
4764       __pyx_v_f = ((char *)"Zg");
4765       break;
4766       case NPY_OBJECT:
4767 
4768       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
4769  *                 elif t == NPY_CDOUBLE:     f = "Zd"
4770  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
4771  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
4772  *                 else:
4773  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4774  */
4775       __pyx_v_f = ((char *)"O");
4776       break;
4777       default:
4778 
4779       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
4780  *                 elif t == NPY_OBJECT:      f = "O"
4781  *                 else:
4782  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
4783  *                 info.format = f
4784  *                 return
4785  */
4786       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
4787       __Pyx_GOTREF(__pyx_t_3);
4788       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
4789       __Pyx_GOTREF(__pyx_t_8);
4790       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4791       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
4792       __Pyx_GOTREF(__pyx_t_3);
4793       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4794       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4795       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4796       __PYX_ERR(1, 325, __pyx_L1_error)
4797       break;
4798     }
4799 
4800     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
4801  *                 else:
4802  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4803  *                 info.format = f             # <<<<<<<<<<<<<<
4804  *                 return
4805  *             else:
4806  */
4807     __pyx_v_info->format = __pyx_v_f;
4808 
4809     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
4810  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4811  *                 info.format = f
4812  *                 return             # <<<<<<<<<<<<<<
4813  *             else:
4814  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4815  */
4816     __pyx_r = 0;
4817     goto __pyx_L0;
4818 
4819     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
4820  *             info.obj = self
4821  *
4822  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
4823  *                 t = descr.type_num
4824  *                 if ((descr.byteorder == c'>' and little_endian) or
4825  */
4826   }
4827 
4828   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
4829  *                 return
4830  *             else:
4831  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
4832  *                 info.format[0] = c'^' # Native data types, manual alignment
4833  *                 offset = 0
4834  */
4835   /*else*/ {
4836     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
4837 
4838     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
4839  *             else:
4840  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4841  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
4842  *                 offset = 0
4843  *                 f = _util_dtypestring(descr, info.format + 1,
4844  */
4845     (__pyx_v_info->format[0]) = '^';
4846 
4847     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
4848  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
4849  *                 info.format[0] = c'^' # Native data types, manual alignment
4850  *                 offset = 0             # <<<<<<<<<<<<<<
4851  *                 f = _util_dtypestring(descr, info.format + 1,
4852  *                                       info.format + _buffer_format_string_len,
4853  */
4854     __pyx_v_offset = 0;
4855 
4856     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
4857  *                 info.format[0] = c'^' # Native data types, manual alignment
4858  *                 offset = 0
4859  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
4860  *                                       info.format + _buffer_format_string_len,
4861  *                                       &offset)
4862  */
4863     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
4864     __pyx_v_f = __pyx_t_9;
4865 
4866     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
4867  *                                       info.format + _buffer_format_string_len,
4868  *                                       &offset)
4869  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
4870  *
4871  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4872  */
4873     (__pyx_v_f[0]) = '\x00';
4874   }
4875 
4876   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
4877  *         # experimental exception made for __getbuffer__ and __releasebuffer__
4878  *         # -- the details of this may change.
4879  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
4880  *             # This implementation of getbuffer is geared towards Cython
4881  *             # requirements, and does not yet fulfill the PEP.
4882  */
4883 
4884   /* function exit code */
4885   __pyx_r = 0;
4886   goto __pyx_L0;
4887   __pyx_L1_error:;
4888   __Pyx_XDECREF(__pyx_t_3);
4889   __Pyx_XDECREF(__pyx_t_8);
4890   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4891   __pyx_r = -1;
4892   if (__pyx_v_info->obj != NULL) {
4893     __Pyx_GOTREF(__pyx_v_info->obj);
4894     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4895   }
4896   goto __pyx_L2;
4897   __pyx_L0:;
4898   if (__pyx_v_info->obj == Py_None) {
4899     __Pyx_GOTREF(__pyx_v_info->obj);
4900     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4901   }
4902   __pyx_L2:;
4903   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4904   __Pyx_RefNannyFinishContext();
4905   return __pyx_r;
4906 }
4907 
4908 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
4909  *                 f[0] = c'\0' # Terminate format string
4910  *
4911  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4912  *             if PyArray_HASFIELDS(self):
4913  *                 PyObject_Free(info.format)
4914  */
4915 
4916 /* Python wrapper */
4917 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)4918 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4919   __Pyx_RefNannyDeclarations
4920   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4921   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4922 
4923   /* function exit code */
4924   __Pyx_RefNannyFinishContext();
4925 }
4926 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)4927 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4928   __Pyx_RefNannyDeclarations
4929   int __pyx_t_1;
4930   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4931 
4932   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
4933  *
4934  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4935  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4936  *                 PyObject_Free(info.format)
4937  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4938  */
4939   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4940   if (__pyx_t_1) {
4941 
4942     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
4943  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4944  *             if PyArray_HASFIELDS(self):
4945  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
4946  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4947  *                 PyObject_Free(info.strides)
4948  */
4949     PyObject_Free(__pyx_v_info->format);
4950 
4951     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
4952  *
4953  *         def __releasebuffer__(ndarray self, Py_buffer* info):
4954  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
4955  *                 PyObject_Free(info.format)
4956  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4957  */
4958   }
4959 
4960   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
4961  *             if PyArray_HASFIELDS(self):
4962  *                 PyObject_Free(info.format)
4963  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4964  *                 PyObject_Free(info.strides)
4965  *                 # info.shape was stored after info.strides in the same block
4966  */
4967   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4968   if (__pyx_t_1) {
4969 
4970     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
4971  *                 PyObject_Free(info.format)
4972  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
4973  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
4974  *                 # info.shape was stored after info.strides in the same block
4975  *
4976  */
4977     PyObject_Free(__pyx_v_info->strides);
4978 
4979     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
4980  *             if PyArray_HASFIELDS(self):
4981  *                 PyObject_Free(info.format)
4982  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
4983  *                 PyObject_Free(info.strides)
4984  *                 # info.shape was stored after info.strides in the same block
4985  */
4986   }
4987 
4988   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
4989  *                 f[0] = c'\0' # Terminate format string
4990  *
4991  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
4992  *             if PyArray_HASFIELDS(self):
4993  *                 PyObject_Free(info.format)
4994  */
4995 
4996   /* function exit code */
4997   __Pyx_RefNannyFinishContext();
4998 }
4999 
5000 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
5001  * ctypedef npy_cdouble     complex_t
5002  *
5003  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
5004  *     return PyArray_MultiIterNew(1, <void*>a)
5005  *
5006  */
5007 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)5008 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5009   PyObject *__pyx_r = NULL;
5010   __Pyx_RefNannyDeclarations
5011   PyObject *__pyx_t_1 = NULL;
5012   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
5013 
5014   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
5015  *
5016  * cdef inline object PyArray_MultiIterNew1(a):
5017  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
5018  *
5019  * cdef inline object PyArray_MultiIterNew2(a, b):
5020  */
5021   __Pyx_XDECREF(__pyx_r);
5022   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
5023   __Pyx_GOTREF(__pyx_t_1);
5024   __pyx_r = __pyx_t_1;
5025   __pyx_t_1 = 0;
5026   goto __pyx_L0;
5027 
5028   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
5029  * ctypedef npy_cdouble     complex_t
5030  *
5031  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
5032  *     return PyArray_MultiIterNew(1, <void*>a)
5033  *
5034  */
5035 
5036   /* function exit code */
5037   __pyx_L1_error:;
5038   __Pyx_XDECREF(__pyx_t_1);
5039   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5040   __pyx_r = 0;
5041   __pyx_L0:;
5042   __Pyx_XGIVEREF(__pyx_r);
5043   __Pyx_RefNannyFinishContext();
5044   return __pyx_r;
5045 }
5046 
5047 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
5048  *     return PyArray_MultiIterNew(1, <void*>a)
5049  *
5050  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
5051  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5052  *
5053  */
5054 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)5055 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5056   PyObject *__pyx_r = NULL;
5057   __Pyx_RefNannyDeclarations
5058   PyObject *__pyx_t_1 = NULL;
5059   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
5060 
5061   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
5062  *
5063  * cdef inline object PyArray_MultiIterNew2(a, b):
5064  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
5065  *
5066  * cdef inline object PyArray_MultiIterNew3(a, b, c):
5067  */
5068   __Pyx_XDECREF(__pyx_r);
5069   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
5070   __Pyx_GOTREF(__pyx_t_1);
5071   __pyx_r = __pyx_t_1;
5072   __pyx_t_1 = 0;
5073   goto __pyx_L0;
5074 
5075   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
5076  *     return PyArray_MultiIterNew(1, <void*>a)
5077  *
5078  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
5079  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5080  *
5081  */
5082 
5083   /* function exit code */
5084   __pyx_L1_error:;
5085   __Pyx_XDECREF(__pyx_t_1);
5086   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5087   __pyx_r = 0;
5088   __pyx_L0:;
5089   __Pyx_XGIVEREF(__pyx_r);
5090   __Pyx_RefNannyFinishContext();
5091   return __pyx_r;
5092 }
5093 
5094 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
5095  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5096  *
5097  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
5098  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5099  *
5100  */
5101 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)5102 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5103   PyObject *__pyx_r = NULL;
5104   __Pyx_RefNannyDeclarations
5105   PyObject *__pyx_t_1 = NULL;
5106   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
5107 
5108   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
5109  *
5110  * cdef inline object PyArray_MultiIterNew3(a, b, c):
5111  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
5112  *
5113  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5114  */
5115   __Pyx_XDECREF(__pyx_r);
5116   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
5117   __Pyx_GOTREF(__pyx_t_1);
5118   __pyx_r = __pyx_t_1;
5119   __pyx_t_1 = 0;
5120   goto __pyx_L0;
5121 
5122   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
5123  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5124  *
5125  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
5126  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5127  *
5128  */
5129 
5130   /* function exit code */
5131   __pyx_L1_error:;
5132   __Pyx_XDECREF(__pyx_t_1);
5133   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
5134   __pyx_r = 0;
5135   __pyx_L0:;
5136   __Pyx_XGIVEREF(__pyx_r);
5137   __Pyx_RefNannyFinishContext();
5138   return __pyx_r;
5139 }
5140 
5141 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
5142  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5143  *
5144  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
5145  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5146  *
5147  */
5148 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)5149 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) {
5150   PyObject *__pyx_r = NULL;
5151   __Pyx_RefNannyDeclarations
5152   PyObject *__pyx_t_1 = NULL;
5153   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
5154 
5155   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
5156  *
5157  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5158  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
5159  *
5160  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5161  */
5162   __Pyx_XDECREF(__pyx_r);
5163   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
5164   __Pyx_GOTREF(__pyx_t_1);
5165   __pyx_r = __pyx_t_1;
5166   __pyx_t_1 = 0;
5167   goto __pyx_L0;
5168 
5169   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
5170  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5171  *
5172  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
5173  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5174  *
5175  */
5176 
5177   /* function exit code */
5178   __pyx_L1_error:;
5179   __Pyx_XDECREF(__pyx_t_1);
5180   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5181   __pyx_r = 0;
5182   __pyx_L0:;
5183   __Pyx_XGIVEREF(__pyx_r);
5184   __Pyx_RefNannyFinishContext();
5185   return __pyx_r;
5186 }
5187 
5188 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
5189  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5190  *
5191  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
5192  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5193  *
5194  */
5195 
__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)5196 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) {
5197   PyObject *__pyx_r = NULL;
5198   __Pyx_RefNannyDeclarations
5199   PyObject *__pyx_t_1 = NULL;
5200   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5201 
5202   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
5203  *
5204  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5205  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
5206  *
5207  * cdef inline tuple PyDataType_SHAPE(dtype d):
5208  */
5209   __Pyx_XDECREF(__pyx_r);
5210   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
5211   __Pyx_GOTREF(__pyx_t_1);
5212   __pyx_r = __pyx_t_1;
5213   __pyx_t_1 = 0;
5214   goto __pyx_L0;
5215 
5216   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
5217  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5218  *
5219  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
5220  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5221  *
5222  */
5223 
5224   /* function exit code */
5225   __pyx_L1_error:;
5226   __Pyx_XDECREF(__pyx_t_1);
5227   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5228   __pyx_r = 0;
5229   __pyx_L0:;
5230   __Pyx_XGIVEREF(__pyx_r);
5231   __Pyx_RefNannyFinishContext();
5232   return __pyx_r;
5233 }
5234 
5235 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
5236  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5237  *
5238  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
5239  *     if PyDataType_HASSUBARRAY(d):
5240  *         return <tuple>d.subarray.shape
5241  */
5242 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)5243 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5244   PyObject *__pyx_r = NULL;
5245   __Pyx_RefNannyDeclarations
5246   int __pyx_t_1;
5247   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5248 
5249   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
5250  *
5251  * cdef inline tuple PyDataType_SHAPE(dtype d):
5252  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
5253  *         return <tuple>d.subarray.shape
5254  *     else:
5255  */
5256   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
5257   if (__pyx_t_1) {
5258 
5259     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
5260  * cdef inline tuple PyDataType_SHAPE(dtype d):
5261  *     if PyDataType_HASSUBARRAY(d):
5262  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
5263  *     else:
5264  *         return ()
5265  */
5266     __Pyx_XDECREF(__pyx_r);
5267     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
5268     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
5269     goto __pyx_L0;
5270 
5271     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
5272  *
5273  * cdef inline tuple PyDataType_SHAPE(dtype d):
5274  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
5275  *         return <tuple>d.subarray.shape
5276  *     else:
5277  */
5278   }
5279 
5280   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
5281  *         return <tuple>d.subarray.shape
5282  *     else:
5283  *         return ()             # <<<<<<<<<<<<<<
5284  *
5285  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
5286  */
5287   /*else*/ {
5288     __Pyx_XDECREF(__pyx_r);
5289     __Pyx_INCREF(__pyx_empty_tuple);
5290     __pyx_r = __pyx_empty_tuple;
5291     goto __pyx_L0;
5292   }
5293 
5294   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
5295  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5296  *
5297  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
5298  *     if PyDataType_HASSUBARRAY(d):
5299  *         return <tuple>d.subarray.shape
5300  */
5301 
5302   /* function exit code */
5303   __pyx_L0:;
5304   __Pyx_XGIVEREF(__pyx_r);
5305   __Pyx_RefNannyFinishContext();
5306   return __pyx_r;
5307 }
5308 
5309 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
5310  *         return ()
5311  *
5312  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
5313  *     # Recursive utility function used in __getbuffer__ to get format
5314  *     # string. The new location in the format string is returned.
5315  */
5316 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)5317 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) {
5318   PyArray_Descr *__pyx_v_child = 0;
5319   int __pyx_v_endian_detector;
5320   int __pyx_v_little_endian;
5321   PyObject *__pyx_v_fields = 0;
5322   PyObject *__pyx_v_childname = NULL;
5323   PyObject *__pyx_v_new_offset = NULL;
5324   PyObject *__pyx_v_t = NULL;
5325   char *__pyx_r;
5326   __Pyx_RefNannyDeclarations
5327   PyObject *__pyx_t_1 = NULL;
5328   Py_ssize_t __pyx_t_2;
5329   PyObject *__pyx_t_3 = NULL;
5330   PyObject *__pyx_t_4 = NULL;
5331   int __pyx_t_5;
5332   int __pyx_t_6;
5333   int __pyx_t_7;
5334   long __pyx_t_8;
5335   char *__pyx_t_9;
5336   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
5337 
5338   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
5339  *
5340  *     cdef dtype child
5341  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
5342  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5343  *     cdef tuple fields
5344  */
5345   __pyx_v_endian_detector = 1;
5346 
5347   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
5348  *     cdef dtype child
5349  *     cdef int endian_detector = 1
5350  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
5351  *     cdef tuple fields
5352  *
5353  */
5354   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5355 
5356   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
5357  *     cdef tuple fields
5358  *
5359  *     for childname in descr.names:             # <<<<<<<<<<<<<<
5360  *         fields = descr.fields[childname]
5361  *         child, new_offset = fields
5362  */
5363   if (unlikely(__pyx_v_descr->names == Py_None)) {
5364     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
5365     __PYX_ERR(1, 851, __pyx_L1_error)
5366   }
5367   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5368   for (;;) {
5369     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5370     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5371     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
5372     #else
5373     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
5374     __Pyx_GOTREF(__pyx_t_3);
5375     #endif
5376     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
5377     __pyx_t_3 = 0;
5378 
5379     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
5380  *
5381  *     for childname in descr.names:
5382  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
5383  *         child, new_offset = fields
5384  *
5385  */
5386     if (unlikely(__pyx_v_descr->fields == Py_None)) {
5387       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5388       __PYX_ERR(1, 852, __pyx_L1_error)
5389     }
5390     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
5391     __Pyx_GOTREF(__pyx_t_3);
5392     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
5393     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
5394     __pyx_t_3 = 0;
5395 
5396     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
5397  *     for childname in descr.names:
5398  *         fields = descr.fields[childname]
5399  *         child, new_offset = fields             # <<<<<<<<<<<<<<
5400  *
5401  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
5402  */
5403     if (likely(__pyx_v_fields != Py_None)) {
5404       PyObject* sequence = __pyx_v_fields;
5405       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5406       if (unlikely(size != 2)) {
5407         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5408         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5409         __PYX_ERR(1, 853, __pyx_L1_error)
5410       }
5411       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5412       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5413       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
5414       __Pyx_INCREF(__pyx_t_3);
5415       __Pyx_INCREF(__pyx_t_4);
5416       #else
5417       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
5418       __Pyx_GOTREF(__pyx_t_3);
5419       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
5420       __Pyx_GOTREF(__pyx_t_4);
5421       #endif
5422     } else {
5423       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
5424     }
5425     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
5426     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
5427     __pyx_t_3 = 0;
5428     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
5429     __pyx_t_4 = 0;
5430 
5431     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
5432  *         child, new_offset = fields
5433  *
5434  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
5435  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5436  *
5437  */
5438     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
5439     __Pyx_GOTREF(__pyx_t_4);
5440     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
5441     __Pyx_GOTREF(__pyx_t_3);
5442     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5443     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
5444     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5445     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
5446     if (unlikely(__pyx_t_6)) {
5447 
5448       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
5449  *
5450  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
5451  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
5452  *
5453  *         if ((child.byteorder == c'>' and little_endian) or
5454  */
5455       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
5456       __Pyx_GOTREF(__pyx_t_3);
5457       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5458       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5459       __PYX_ERR(1, 856, __pyx_L1_error)
5460 
5461       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
5462  *         child, new_offset = fields
5463  *
5464  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
5465  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5466  *
5467  */
5468     }
5469 
5470     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5471  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5472  *
5473  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
5474  *             (child.byteorder == c'<' and not little_endian)):
5475  *             raise ValueError(u"Non-native byte order not supported")
5476  */
5477     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
5478     if (!__pyx_t_7) {
5479       goto __pyx_L8_next_or;
5480     } else {
5481     }
5482     __pyx_t_7 = (__pyx_v_little_endian != 0);
5483     if (!__pyx_t_7) {
5484     } else {
5485       __pyx_t_6 = __pyx_t_7;
5486       goto __pyx_L7_bool_binop_done;
5487     }
5488     __pyx_L8_next_or:;
5489 
5490     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
5491  *
5492  *         if ((child.byteorder == c'>' and little_endian) or
5493  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
5494  *             raise ValueError(u"Non-native byte order not supported")
5495  *             # One could encode it in the format string and have Cython
5496  */
5497     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
5498     if (__pyx_t_7) {
5499     } else {
5500       __pyx_t_6 = __pyx_t_7;
5501       goto __pyx_L7_bool_binop_done;
5502     }
5503     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
5504     __pyx_t_6 = __pyx_t_7;
5505     __pyx_L7_bool_binop_done:;
5506 
5507     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5508  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5509  *
5510  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
5511  *             (child.byteorder == c'<' and not little_endian)):
5512  *             raise ValueError(u"Non-native byte order not supported")
5513  */
5514     if (unlikely(__pyx_t_6)) {
5515 
5516       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
5517  *         if ((child.byteorder == c'>' and little_endian) or
5518  *             (child.byteorder == c'<' and not little_endian)):
5519  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
5520  *             # One could encode it in the format string and have Cython
5521  *             # complain instead, BUT: < and > in format strings also imply
5522  */
5523       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
5524       __Pyx_GOTREF(__pyx_t_3);
5525       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5526       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5527       __PYX_ERR(1, 860, __pyx_L1_error)
5528 
5529       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
5530  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
5531  *
5532  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
5533  *             (child.byteorder == c'<' and not little_endian)):
5534  *             raise ValueError(u"Non-native byte order not supported")
5535  */
5536     }
5537 
5538     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
5539  *
5540  *         # Output padding bytes
5541  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
5542  *             f[0] = 120 # "x"; pad byte
5543  *             f += 1
5544  */
5545     while (1) {
5546       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
5547       __Pyx_GOTREF(__pyx_t_3);
5548       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
5549       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5550       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
5551       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5552       if (!__pyx_t_6) break;
5553 
5554       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
5555  *         # Output padding bytes
5556  *         while offset[0] < new_offset:
5557  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
5558  *             f += 1
5559  *             offset[0] += 1
5560  */
5561       (__pyx_v_f[0]) = 0x78;
5562 
5563       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
5564  *         while offset[0] < new_offset:
5565  *             f[0] = 120 # "x"; pad byte
5566  *             f += 1             # <<<<<<<<<<<<<<
5567  *             offset[0] += 1
5568  *
5569  */
5570       __pyx_v_f = (__pyx_v_f + 1);
5571 
5572       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
5573  *             f[0] = 120 # "x"; pad byte
5574  *             f += 1
5575  *             offset[0] += 1             # <<<<<<<<<<<<<<
5576  *
5577  *         offset[0] += child.itemsize
5578  */
5579       __pyx_t_8 = 0;
5580       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
5581     }
5582 
5583     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
5584  *             offset[0] += 1
5585  *
5586  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
5587  *
5588  *         if not PyDataType_HASFIELDS(child):
5589  */
5590     __pyx_t_8 = 0;
5591     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
5592 
5593     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
5594  *         offset[0] += child.itemsize
5595  *
5596  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
5597  *             t = child.type_num
5598  *             if end - f < 5:
5599  */
5600     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
5601     if (__pyx_t_6) {
5602 
5603       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
5604  *
5605  *         if not PyDataType_HASFIELDS(child):
5606  *             t = child.type_num             # <<<<<<<<<<<<<<
5607  *             if end - f < 5:
5608  *                 raise RuntimeError(u"Format string allocated too short.")
5609  */
5610       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
5611       __Pyx_GOTREF(__pyx_t_4);
5612       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
5613       __pyx_t_4 = 0;
5614 
5615       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
5616  *         if not PyDataType_HASFIELDS(child):
5617  *             t = child.type_num
5618  *             if end - f < 5:             # <<<<<<<<<<<<<<
5619  *                 raise RuntimeError(u"Format string allocated too short.")
5620  *
5621  */
5622       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
5623       if (unlikely(__pyx_t_6)) {
5624 
5625         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
5626  *             t = child.type_num
5627  *             if end - f < 5:
5628  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
5629  *
5630  *             # Until ticket #99 is fixed, use integers to avoid warnings
5631  */
5632         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
5633         __Pyx_GOTREF(__pyx_t_4);
5634         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5635         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5636         __PYX_ERR(1, 880, __pyx_L1_error)
5637 
5638         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
5639  *         if not PyDataType_HASFIELDS(child):
5640  *             t = child.type_num
5641  *             if end - f < 5:             # <<<<<<<<<<<<<<
5642  *                 raise RuntimeError(u"Format string allocated too short.")
5643  *
5644  */
5645       }
5646 
5647       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
5648  *
5649  *             # Until ticket #99 is fixed, use integers to avoid warnings
5650  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
5651  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5652  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5653  */
5654       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
5655       __Pyx_GOTREF(__pyx_t_4);
5656       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
5657       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5658       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
5659       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5660       if (__pyx_t_6) {
5661         (__pyx_v_f[0]) = 98;
5662         goto __pyx_L15;
5663       }
5664 
5665       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
5666  *             # Until ticket #99 is fixed, use integers to avoid warnings
5667  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
5668  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
5669  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5670  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5671  */
5672       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
5673       __Pyx_GOTREF(__pyx_t_3);
5674       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
5675       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5676       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
5677       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5678       if (__pyx_t_6) {
5679         (__pyx_v_f[0]) = 66;
5680         goto __pyx_L15;
5681       }
5682 
5683       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
5684  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
5685  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5686  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
5687  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5688  *             elif t == NPY_INT:         f[0] = 105 #"i"
5689  */
5690       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
5691       __Pyx_GOTREF(__pyx_t_4);
5692       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
5693       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5694       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
5695       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5696       if (__pyx_t_6) {
5697         (__pyx_v_f[0]) = 0x68;
5698         goto __pyx_L15;
5699       }
5700 
5701       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
5702  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
5703  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5704  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
5705  *             elif t == NPY_INT:         f[0] = 105 #"i"
5706  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5707  */
5708       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
5709       __Pyx_GOTREF(__pyx_t_3);
5710       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
5711       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5712       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
5713       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5714       if (__pyx_t_6) {
5715         (__pyx_v_f[0]) = 72;
5716         goto __pyx_L15;
5717       }
5718 
5719       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
5720  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
5721  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5722  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
5723  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5724  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5725  */
5726       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
5727       __Pyx_GOTREF(__pyx_t_4);
5728       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
5729       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5730       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
5731       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5732       if (__pyx_t_6) {
5733         (__pyx_v_f[0]) = 0x69;
5734         goto __pyx_L15;
5735       }
5736 
5737       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
5738  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
5739  *             elif t == NPY_INT:         f[0] = 105 #"i"
5740  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
5741  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5742  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5743  */
5744       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
5745       __Pyx_GOTREF(__pyx_t_3);
5746       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
5747       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5748       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
5749       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5750       if (__pyx_t_6) {
5751         (__pyx_v_f[0]) = 73;
5752         goto __pyx_L15;
5753       }
5754 
5755       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
5756  *             elif t == NPY_INT:         f[0] = 105 #"i"
5757  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5758  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
5759  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5760  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5761  */
5762       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
5763       __Pyx_GOTREF(__pyx_t_4);
5764       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
5765       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5766       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
5767       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5768       if (__pyx_t_6) {
5769         (__pyx_v_f[0]) = 0x6C;
5770         goto __pyx_L15;
5771       }
5772 
5773       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
5774  *             elif t == NPY_UINT:        f[0] =  73 #"I"
5775  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5776  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
5777  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5778  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5779  */
5780       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
5781       __Pyx_GOTREF(__pyx_t_3);
5782       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
5783       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5784       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
5785       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5786       if (__pyx_t_6) {
5787         (__pyx_v_f[0]) = 76;
5788         goto __pyx_L15;
5789       }
5790 
5791       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
5792  *             elif t == NPY_LONG:        f[0] = 108 #"l"
5793  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5794  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
5795  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5796  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5797  */
5798       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
5799       __Pyx_GOTREF(__pyx_t_4);
5800       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
5801       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5802       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
5803       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5804       if (__pyx_t_6) {
5805         (__pyx_v_f[0]) = 0x71;
5806         goto __pyx_L15;
5807       }
5808 
5809       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
5810  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
5811  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5812  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
5813  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5814  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5815  */
5816       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
5817       __Pyx_GOTREF(__pyx_t_3);
5818       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
5819       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5820       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
5821       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5822       if (__pyx_t_6) {
5823         (__pyx_v_f[0]) = 81;
5824         goto __pyx_L15;
5825       }
5826 
5827       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
5828  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
5829  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5830  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
5831  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5832  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5833  */
5834       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
5835       __Pyx_GOTREF(__pyx_t_4);
5836       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
5837       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5838       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
5839       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5840       if (__pyx_t_6) {
5841         (__pyx_v_f[0]) = 0x66;
5842         goto __pyx_L15;
5843       }
5844 
5845       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
5846  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
5847  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5848  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
5849  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5850  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5851  */
5852       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
5853       __Pyx_GOTREF(__pyx_t_3);
5854       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
5855       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5856       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
5857       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5858       if (__pyx_t_6) {
5859         (__pyx_v_f[0]) = 0x64;
5860         goto __pyx_L15;
5861       }
5862 
5863       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
5864  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
5865  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5866  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
5867  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5868  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5869  */
5870       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
5871       __Pyx_GOTREF(__pyx_t_4);
5872       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
5873       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5874       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
5875       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5876       if (__pyx_t_6) {
5877         (__pyx_v_f[0]) = 0x67;
5878         goto __pyx_L15;
5879       }
5880 
5881       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
5882  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
5883  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5884  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
5885  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5886  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5887  */
5888       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
5889       __Pyx_GOTREF(__pyx_t_3);
5890       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
5891       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5892       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
5893       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5894       if (__pyx_t_6) {
5895         (__pyx_v_f[0]) = 90;
5896         (__pyx_v_f[1]) = 0x66;
5897         __pyx_v_f = (__pyx_v_f + 1);
5898         goto __pyx_L15;
5899       }
5900 
5901       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
5902  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
5903  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5904  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
5905  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5906  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5907  */
5908       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
5909       __Pyx_GOTREF(__pyx_t_4);
5910       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
5911       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5912       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
5913       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5914       if (__pyx_t_6) {
5915         (__pyx_v_f[0]) = 90;
5916         (__pyx_v_f[1]) = 0x64;
5917         __pyx_v_f = (__pyx_v_f + 1);
5918         goto __pyx_L15;
5919       }
5920 
5921       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
5922  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
5923  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5924  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
5925  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5926  *             else:
5927  */
5928       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
5929       __Pyx_GOTREF(__pyx_t_3);
5930       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
5931       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5932       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
5933       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5934       if (__pyx_t_6) {
5935         (__pyx_v_f[0]) = 90;
5936         (__pyx_v_f[1]) = 0x67;
5937         __pyx_v_f = (__pyx_v_f + 1);
5938         goto __pyx_L15;
5939       }
5940 
5941       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
5942  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
5943  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5944  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
5945  *             else:
5946  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5947  */
5948       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
5949       __Pyx_GOTREF(__pyx_t_4);
5950       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
5951       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5952       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
5953       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5954       if (likely(__pyx_t_6)) {
5955         (__pyx_v_f[0]) = 79;
5956         goto __pyx_L15;
5957       }
5958 
5959       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
5960  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
5961  *             else:
5962  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
5963  *             f += 1
5964  *         else:
5965  */
5966       /*else*/ {
5967         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
5968         __Pyx_GOTREF(__pyx_t_3);
5969         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
5970         __Pyx_GOTREF(__pyx_t_4);
5971         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5972         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5973         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5974         __PYX_ERR(1, 901, __pyx_L1_error)
5975       }
5976       __pyx_L15:;
5977 
5978       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
5979  *             else:
5980  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5981  *             f += 1             # <<<<<<<<<<<<<<
5982  *         else:
5983  *             # Cython ignores struct boundary information ("T{...}"),
5984  */
5985       __pyx_v_f = (__pyx_v_f + 1);
5986 
5987       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
5988  *         offset[0] += child.itemsize
5989  *
5990  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
5991  *             t = child.type_num
5992  *             if end - f < 5:
5993  */
5994       goto __pyx_L13;
5995     }
5996 
5997     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
5998  *             # Cython ignores struct boundary information ("T{...}"),
5999  *             # so don't output it
6000  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
6001  *     return f
6002  *
6003  */
6004     /*else*/ {
6005       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
6006       __pyx_v_f = __pyx_t_9;
6007     }
6008     __pyx_L13:;
6009 
6010     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
6011  *     cdef tuple fields
6012  *
6013  *     for childname in descr.names:             # <<<<<<<<<<<<<<
6014  *         fields = descr.fields[childname]
6015  *         child, new_offset = fields
6016  */
6017   }
6018   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6019 
6020   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
6021  *             # so don't output it
6022  *             f = _util_dtypestring(child, f, end, offset)
6023  *     return f             # <<<<<<<<<<<<<<
6024  *
6025  *
6026  */
6027   __pyx_r = __pyx_v_f;
6028   goto __pyx_L0;
6029 
6030   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
6031  *         return ()
6032  *
6033  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
6034  *     # Recursive utility function used in __getbuffer__ to get format
6035  *     # string. The new location in the format string is returned.
6036  */
6037 
6038   /* function exit code */
6039   __pyx_L1_error:;
6040   __Pyx_XDECREF(__pyx_t_1);
6041   __Pyx_XDECREF(__pyx_t_3);
6042   __Pyx_XDECREF(__pyx_t_4);
6043   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
6044   __pyx_r = NULL;
6045   __pyx_L0:;
6046   __Pyx_XDECREF((PyObject *)__pyx_v_child);
6047   __Pyx_XDECREF(__pyx_v_fields);
6048   __Pyx_XDECREF(__pyx_v_childname);
6049   __Pyx_XDECREF(__pyx_v_new_offset);
6050   __Pyx_XDECREF(__pyx_v_t);
6051   __Pyx_RefNannyFinishContext();
6052   return __pyx_r;
6053 }
6054 
6055 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
6056  *     int _import_umath() except -1
6057  *
6058  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
6059  *     Py_INCREF(base) # important to do this before stealing the reference below!
6060  *     PyArray_SetBaseObject(arr, base)
6061  */
6062 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)6063 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6064   __Pyx_RefNannyDeclarations
6065   __Pyx_RefNannySetupContext("set_array_base", 0);
6066 
6067   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
6068  *
6069  * cdef inline void set_array_base(ndarray arr, object base):
6070  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
6071  *     PyArray_SetBaseObject(arr, base)
6072  *
6073  */
6074   Py_INCREF(__pyx_v_base);
6075 
6076   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
6077  * cdef inline void set_array_base(ndarray arr, object base):
6078  *     Py_INCREF(base) # important to do this before stealing the reference below!
6079  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
6080  *
6081  * cdef inline object get_array_base(ndarray arr):
6082  */
6083   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6084 
6085   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
6086  *     int _import_umath() except -1
6087  *
6088  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
6089  *     Py_INCREF(base) # important to do this before stealing the reference below!
6090  *     PyArray_SetBaseObject(arr, base)
6091  */
6092 
6093   /* function exit code */
6094   __Pyx_RefNannyFinishContext();
6095 }
6096 
6097 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
6098  *     PyArray_SetBaseObject(arr, base)
6099  *
6100  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
6101  *     base = PyArray_BASE(arr)
6102  *     if base is NULL:
6103  */
6104 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)6105 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6106   PyObject *__pyx_v_base;
6107   PyObject *__pyx_r = NULL;
6108   __Pyx_RefNannyDeclarations
6109   int __pyx_t_1;
6110   __Pyx_RefNannySetupContext("get_array_base", 0);
6111 
6112   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
6113  *
6114  * cdef inline object get_array_base(ndarray arr):
6115  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
6116  *     if base is NULL:
6117  *         return None
6118  */
6119   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6120 
6121   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
6122  * cdef inline object get_array_base(ndarray arr):
6123  *     base = PyArray_BASE(arr)
6124  *     if base is NULL:             # <<<<<<<<<<<<<<
6125  *         return None
6126  *     return <object>base
6127  */
6128   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6129   if (__pyx_t_1) {
6130 
6131     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
6132  *     base = PyArray_BASE(arr)
6133  *     if base is NULL:
6134  *         return None             # <<<<<<<<<<<<<<
6135  *     return <object>base
6136  *
6137  */
6138     __Pyx_XDECREF(__pyx_r);
6139     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6140     goto __pyx_L0;
6141 
6142     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
6143  * cdef inline object get_array_base(ndarray arr):
6144  *     base = PyArray_BASE(arr)
6145  *     if base is NULL:             # <<<<<<<<<<<<<<
6146  *         return None
6147  *     return <object>base
6148  */
6149   }
6150 
6151   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
6152  *     if base is NULL:
6153  *         return None
6154  *     return <object>base             # <<<<<<<<<<<<<<
6155  *
6156  * # Versions of the import_* functions which are more suitable for
6157  */
6158   __Pyx_XDECREF(__pyx_r);
6159   __Pyx_INCREF(((PyObject *)__pyx_v_base));
6160   __pyx_r = ((PyObject *)__pyx_v_base);
6161   goto __pyx_L0;
6162 
6163   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
6164  *     PyArray_SetBaseObject(arr, base)
6165  *
6166  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
6167  *     base = PyArray_BASE(arr)
6168  *     if base is NULL:
6169  */
6170 
6171   /* function exit code */
6172   __pyx_L0:;
6173   __Pyx_XGIVEREF(__pyx_r);
6174   __Pyx_RefNannyFinishContext();
6175   return __pyx_r;
6176 }
6177 
6178 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
6179  * # Versions of the import_* functions which are more suitable for
6180  * # Cython code.
6181  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
6182  *     try:
6183  *         _import_array()
6184  */
6185 
__pyx_f_5numpy_import_array(void)6186 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
6187   int __pyx_r;
6188   __Pyx_RefNannyDeclarations
6189   PyObject *__pyx_t_1 = NULL;
6190   PyObject *__pyx_t_2 = NULL;
6191   PyObject *__pyx_t_3 = NULL;
6192   int __pyx_t_4;
6193   PyObject *__pyx_t_5 = NULL;
6194   PyObject *__pyx_t_6 = NULL;
6195   PyObject *__pyx_t_7 = NULL;
6196   PyObject *__pyx_t_8 = NULL;
6197   __Pyx_RefNannySetupContext("import_array", 0);
6198 
6199   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6200  * # Cython code.
6201  * cdef inline int import_array() except -1:
6202  *     try:             # <<<<<<<<<<<<<<
6203  *         _import_array()
6204  *     except Exception:
6205  */
6206   {
6207     __Pyx_PyThreadState_declare
6208     __Pyx_PyThreadState_assign
6209     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6210     __Pyx_XGOTREF(__pyx_t_1);
6211     __Pyx_XGOTREF(__pyx_t_2);
6212     __Pyx_XGOTREF(__pyx_t_3);
6213     /*try:*/ {
6214 
6215       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
6216  * cdef inline int import_array() except -1:
6217  *     try:
6218  *         _import_array()             # <<<<<<<<<<<<<<
6219  *     except Exception:
6220  *         raise ImportError("numpy.core.multiarray failed to import")
6221  */
6222       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
6223 
6224       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6225  * # Cython code.
6226  * cdef inline int import_array() except -1:
6227  *     try:             # <<<<<<<<<<<<<<
6228  *         _import_array()
6229  *     except Exception:
6230  */
6231     }
6232     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6233     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6234     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6235     goto __pyx_L8_try_end;
6236     __pyx_L3_error:;
6237 
6238     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
6239  *     try:
6240  *         _import_array()
6241  *     except Exception:             # <<<<<<<<<<<<<<
6242  *         raise ImportError("numpy.core.multiarray failed to import")
6243  *
6244  */
6245     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6246     if (__pyx_t_4) {
6247       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6248       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
6249       __Pyx_GOTREF(__pyx_t_5);
6250       __Pyx_GOTREF(__pyx_t_6);
6251       __Pyx_GOTREF(__pyx_t_7);
6252 
6253       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
6254  *         _import_array()
6255  *     except Exception:
6256  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
6257  *
6258  * cdef inline int import_umath() except -1:
6259  */
6260       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
6261       __Pyx_GOTREF(__pyx_t_8);
6262       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6263       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6264       __PYX_ERR(1, 1038, __pyx_L5_except_error)
6265     }
6266     goto __pyx_L5_except_error;
6267     __pyx_L5_except_error:;
6268 
6269     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
6270  * # Cython code.
6271  * cdef inline int import_array() except -1:
6272  *     try:             # <<<<<<<<<<<<<<
6273  *         _import_array()
6274  *     except Exception:
6275  */
6276     __Pyx_XGIVEREF(__pyx_t_1);
6277     __Pyx_XGIVEREF(__pyx_t_2);
6278     __Pyx_XGIVEREF(__pyx_t_3);
6279     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6280     goto __pyx_L1_error;
6281     __pyx_L8_try_end:;
6282   }
6283 
6284   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
6285  * # Versions of the import_* functions which are more suitable for
6286  * # Cython code.
6287  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
6288  *     try:
6289  *         _import_array()
6290  */
6291 
6292   /* function exit code */
6293   __pyx_r = 0;
6294   goto __pyx_L0;
6295   __pyx_L1_error:;
6296   __Pyx_XDECREF(__pyx_t_5);
6297   __Pyx_XDECREF(__pyx_t_6);
6298   __Pyx_XDECREF(__pyx_t_7);
6299   __Pyx_XDECREF(__pyx_t_8);
6300   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6301   __pyx_r = -1;
6302   __pyx_L0:;
6303   __Pyx_RefNannyFinishContext();
6304   return __pyx_r;
6305 }
6306 
6307 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6308  *         raise ImportError("numpy.core.multiarray failed to import")
6309  *
6310  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
6311  *     try:
6312  *         _import_umath()
6313  */
6314 
__pyx_f_5numpy_import_umath(void)6315 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6316   int __pyx_r;
6317   __Pyx_RefNannyDeclarations
6318   PyObject *__pyx_t_1 = NULL;
6319   PyObject *__pyx_t_2 = NULL;
6320   PyObject *__pyx_t_3 = NULL;
6321   int __pyx_t_4;
6322   PyObject *__pyx_t_5 = NULL;
6323   PyObject *__pyx_t_6 = NULL;
6324   PyObject *__pyx_t_7 = NULL;
6325   PyObject *__pyx_t_8 = NULL;
6326   __Pyx_RefNannySetupContext("import_umath", 0);
6327 
6328   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6329  *
6330  * cdef inline int import_umath() except -1:
6331  *     try:             # <<<<<<<<<<<<<<
6332  *         _import_umath()
6333  *     except Exception:
6334  */
6335   {
6336     __Pyx_PyThreadState_declare
6337     __Pyx_PyThreadState_assign
6338     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6339     __Pyx_XGOTREF(__pyx_t_1);
6340     __Pyx_XGOTREF(__pyx_t_2);
6341     __Pyx_XGOTREF(__pyx_t_3);
6342     /*try:*/ {
6343 
6344       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
6345  * cdef inline int import_umath() except -1:
6346  *     try:
6347  *         _import_umath()             # <<<<<<<<<<<<<<
6348  *     except Exception:
6349  *         raise ImportError("numpy.core.umath failed to import")
6350  */
6351       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
6352 
6353       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6354  *
6355  * cdef inline int import_umath() except -1:
6356  *     try:             # <<<<<<<<<<<<<<
6357  *         _import_umath()
6358  *     except Exception:
6359  */
6360     }
6361     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6362     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6363     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6364     goto __pyx_L8_try_end;
6365     __pyx_L3_error:;
6366 
6367     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
6368  *     try:
6369  *         _import_umath()
6370  *     except Exception:             # <<<<<<<<<<<<<<
6371  *         raise ImportError("numpy.core.umath failed to import")
6372  *
6373  */
6374     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6375     if (__pyx_t_4) {
6376       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6377       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
6378       __Pyx_GOTREF(__pyx_t_5);
6379       __Pyx_GOTREF(__pyx_t_6);
6380       __Pyx_GOTREF(__pyx_t_7);
6381 
6382       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
6383  *         _import_umath()
6384  *     except Exception:
6385  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
6386  *
6387  * cdef inline int import_ufunc() except -1:
6388  */
6389       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
6390       __Pyx_GOTREF(__pyx_t_8);
6391       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6392       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6393       __PYX_ERR(1, 1044, __pyx_L5_except_error)
6394     }
6395     goto __pyx_L5_except_error;
6396     __pyx_L5_except_error:;
6397 
6398     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
6399  *
6400  * cdef inline int import_umath() except -1:
6401  *     try:             # <<<<<<<<<<<<<<
6402  *         _import_umath()
6403  *     except Exception:
6404  */
6405     __Pyx_XGIVEREF(__pyx_t_1);
6406     __Pyx_XGIVEREF(__pyx_t_2);
6407     __Pyx_XGIVEREF(__pyx_t_3);
6408     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6409     goto __pyx_L1_error;
6410     __pyx_L8_try_end:;
6411   }
6412 
6413   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
6414  *         raise ImportError("numpy.core.multiarray failed to import")
6415  *
6416  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
6417  *     try:
6418  *         _import_umath()
6419  */
6420 
6421   /* function exit code */
6422   __pyx_r = 0;
6423   goto __pyx_L0;
6424   __pyx_L1_error:;
6425   __Pyx_XDECREF(__pyx_t_5);
6426   __Pyx_XDECREF(__pyx_t_6);
6427   __Pyx_XDECREF(__pyx_t_7);
6428   __Pyx_XDECREF(__pyx_t_8);
6429   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6430   __pyx_r = -1;
6431   __pyx_L0:;
6432   __Pyx_RefNannyFinishContext();
6433   return __pyx_r;
6434 }
6435 
6436 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6437  *         raise ImportError("numpy.core.umath failed to import")
6438  *
6439  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
6440  *     try:
6441  *         _import_umath()
6442  */
6443 
__pyx_f_5numpy_import_ufunc(void)6444 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6445   int __pyx_r;
6446   __Pyx_RefNannyDeclarations
6447   PyObject *__pyx_t_1 = NULL;
6448   PyObject *__pyx_t_2 = NULL;
6449   PyObject *__pyx_t_3 = NULL;
6450   int __pyx_t_4;
6451   PyObject *__pyx_t_5 = NULL;
6452   PyObject *__pyx_t_6 = NULL;
6453   PyObject *__pyx_t_7 = NULL;
6454   PyObject *__pyx_t_8 = NULL;
6455   __Pyx_RefNannySetupContext("import_ufunc", 0);
6456 
6457   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6458  *
6459  * cdef inline int import_ufunc() except -1:
6460  *     try:             # <<<<<<<<<<<<<<
6461  *         _import_umath()
6462  *     except Exception:
6463  */
6464   {
6465     __Pyx_PyThreadState_declare
6466     __Pyx_PyThreadState_assign
6467     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6468     __Pyx_XGOTREF(__pyx_t_1);
6469     __Pyx_XGOTREF(__pyx_t_2);
6470     __Pyx_XGOTREF(__pyx_t_3);
6471     /*try:*/ {
6472 
6473       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
6474  * cdef inline int import_ufunc() except -1:
6475  *     try:
6476  *         _import_umath()             # <<<<<<<<<<<<<<
6477  *     except Exception:
6478  *         raise ImportError("numpy.core.umath failed to import")
6479  */
6480       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
6481 
6482       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6483  *
6484  * cdef inline int import_ufunc() except -1:
6485  *     try:             # <<<<<<<<<<<<<<
6486  *         _import_umath()
6487  *     except Exception:
6488  */
6489     }
6490     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6491     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6492     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6493     goto __pyx_L8_try_end;
6494     __pyx_L3_error:;
6495 
6496     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
6497  *     try:
6498  *         _import_umath()
6499  *     except Exception:             # <<<<<<<<<<<<<<
6500  *         raise ImportError("numpy.core.umath failed to import")
6501  */
6502     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6503     if (__pyx_t_4) {
6504       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6505       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
6506       __Pyx_GOTREF(__pyx_t_5);
6507       __Pyx_GOTREF(__pyx_t_6);
6508       __Pyx_GOTREF(__pyx_t_7);
6509 
6510       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
6511  *         _import_umath()
6512  *     except Exception:
6513  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
6514  */
6515       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
6516       __Pyx_GOTREF(__pyx_t_8);
6517       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6518       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6519       __PYX_ERR(1, 1050, __pyx_L5_except_error)
6520     }
6521     goto __pyx_L5_except_error;
6522     __pyx_L5_except_error:;
6523 
6524     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
6525  *
6526  * cdef inline int import_ufunc() except -1:
6527  *     try:             # <<<<<<<<<<<<<<
6528  *         _import_umath()
6529  *     except Exception:
6530  */
6531     __Pyx_XGIVEREF(__pyx_t_1);
6532     __Pyx_XGIVEREF(__pyx_t_2);
6533     __Pyx_XGIVEREF(__pyx_t_3);
6534     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6535     goto __pyx_L1_error;
6536     __pyx_L8_try_end:;
6537   }
6538 
6539   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
6540  *         raise ImportError("numpy.core.umath failed to import")
6541  *
6542  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
6543  *     try:
6544  *         _import_umath()
6545  */
6546 
6547   /* function exit code */
6548   __pyx_r = 0;
6549   goto __pyx_L0;
6550   __pyx_L1_error:;
6551   __Pyx_XDECREF(__pyx_t_5);
6552   __Pyx_XDECREF(__pyx_t_6);
6553   __Pyx_XDECREF(__pyx_t_7);
6554   __Pyx_XDECREF(__pyx_t_8);
6555   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6556   __pyx_r = -1;
6557   __pyx_L0:;
6558   __Pyx_RefNannyFinishContext();
6559   return __pyx_r;
6560 }
6561 
6562 /* "vec3_ops.pxd":9
6563  * @cython.wraparound(False)
6564  * @cython.cdivision(True)
6565  * cdef inline cython.floating dot(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6566  *                                 const cython.floating[3] b) nogil:
6567  *     return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
6568  */
6569 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float * __pyx_v_a,float * __pyx_v_b)6570 static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(float *__pyx_v_a, float *__pyx_v_b) {
6571   float __pyx_r;
6572 
6573   /* "vec3_ops.pxd":11
6574  * cdef inline cython.floating dot(const cython.floating[3] a,
6575  *                                 const cython.floating[3] b) nogil:
6576  *     return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]             # <<<<<<<<<<<<<<
6577  *
6578  *
6579  */
6580   __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2])));
6581   goto __pyx_L0;
6582 
6583   /* "vec3_ops.pxd":9
6584  * @cython.wraparound(False)
6585  * @cython.cdivision(True)
6586  * cdef inline cython.floating dot(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6587  *                                 const cython.floating[3] b) nogil:
6588  *     return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
6589  */
6590 
6591   /* function exit code */
6592   __pyx_L0:;
6593   return __pyx_r;
6594 }
6595 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double * __pyx_v_a,double * __pyx_v_b)6596 static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_dot(double *__pyx_v_a, double *__pyx_v_b) {
6597   double __pyx_r;
6598 
6599   /* "vec3_ops.pxd":11
6600  * cdef inline cython.floating dot(const cython.floating[3] a,
6601  *                                 const cython.floating[3] b) nogil:
6602  *     return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]             # <<<<<<<<<<<<<<
6603  *
6604  *
6605  */
6606   __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_b[0])) + ((__pyx_v_a[1]) * (__pyx_v_b[1]))) + ((__pyx_v_a[2]) * (__pyx_v_b[2])));
6607   goto __pyx_L0;
6608 
6609   /* "vec3_ops.pxd":9
6610  * @cython.wraparound(False)
6611  * @cython.cdivision(True)
6612  * cdef inline cython.floating dot(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6613  *                                 const cython.floating[3] b) nogil:
6614  *     return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
6615  */
6616 
6617   /* function exit code */
6618   __pyx_L0:;
6619   return __pyx_r;
6620 }
6621 
6622 /* "vec3_ops.pxd":17
6623  * @cython.wraparound(False)
6624  * @cython.cdivision(True)
6625  * cdef inline void cross(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6626  *                        const cython.floating[3] b,
6627  *                        cython.floating c[3]) nogil:
6628  */
6629 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float * __pyx_v_a,float * __pyx_v_b,float * __pyx_v_c)6630 static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) {
6631 
6632   /* "vec3_ops.pxd":20
6633  *                        const cython.floating[3] b,
6634  *                        cython.floating c[3]) nogil:
6635  *     c[0] = a[1]*b[2] - a[2]*b[1]             # <<<<<<<<<<<<<<
6636  *     c[1] = a[2]*b[0] - a[0]*b[2]
6637  *     c[2] = a[0]*b[1] - a[1]*b[0]
6638  */
6639   (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1])));
6640 
6641   /* "vec3_ops.pxd":21
6642  *                        cython.floating c[3]) nogil:
6643  *     c[0] = a[1]*b[2] - a[2]*b[1]
6644  *     c[1] = a[2]*b[0] - a[0]*b[2]             # <<<<<<<<<<<<<<
6645  *     c[2] = a[0]*b[1] - a[1]*b[0]
6646  *
6647  */
6648   (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2])));
6649 
6650   /* "vec3_ops.pxd":22
6651  *     c[0] = a[1]*b[2] - a[2]*b[1]
6652  *     c[1] = a[2]*b[0] - a[0]*b[2]
6653  *     c[2] = a[0]*b[1] - a[1]*b[0]             # <<<<<<<<<<<<<<
6654  *
6655  *
6656  */
6657   (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0])));
6658 
6659   /* "vec3_ops.pxd":17
6660  * @cython.wraparound(False)
6661  * @cython.cdivision(True)
6662  * cdef inline void cross(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6663  *                        const cython.floating[3] b,
6664  *                        cython.floating c[3]) nogil:
6665  */
6666 
6667   /* function exit code */
6668 }
6669 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double * __pyx_v_a,double * __pyx_v_b,double * __pyx_v_c)6670 static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_cross(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) {
6671 
6672   /* "vec3_ops.pxd":20
6673  *                        const cython.floating[3] b,
6674  *                        cython.floating c[3]) nogil:
6675  *     c[0] = a[1]*b[2] - a[2]*b[1]             # <<<<<<<<<<<<<<
6676  *     c[1] = a[2]*b[0] - a[0]*b[2]
6677  *     c[2] = a[0]*b[1] - a[1]*b[0]
6678  */
6679   (__pyx_v_c[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1])));
6680 
6681   /* "vec3_ops.pxd":21
6682  *                        cython.floating c[3]) nogil:
6683  *     c[0] = a[1]*b[2] - a[2]*b[1]
6684  *     c[1] = a[2]*b[0] - a[0]*b[2]             # <<<<<<<<<<<<<<
6685  *     c[2] = a[0]*b[1] - a[1]*b[0]
6686  *
6687  */
6688   (__pyx_v_c[1]) = (((__pyx_v_a[2]) * (__pyx_v_b[0])) - ((__pyx_v_a[0]) * (__pyx_v_b[2])));
6689 
6690   /* "vec3_ops.pxd":22
6691  *     c[0] = a[1]*b[2] - a[2]*b[1]
6692  *     c[1] = a[2]*b[0] - a[0]*b[2]
6693  *     c[2] = a[0]*b[1] - a[1]*b[0]             # <<<<<<<<<<<<<<
6694  *
6695  *
6696  */
6697   (__pyx_v_c[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0])));
6698 
6699   /* "vec3_ops.pxd":17
6700  * @cython.wraparound(False)
6701  * @cython.cdivision(True)
6702  * cdef inline void cross(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6703  *                        const cython.floating[3] b,
6704  *                        cython.floating c[3]) nogil:
6705  */
6706 
6707   /* function exit code */
6708 }
6709 
6710 /* "vec3_ops.pxd":28
6711  * @cython.wraparound(False)
6712  * @cython.cdivision(True)
6713  * cdef inline void subtract(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6714  *                           const cython.floating[3] b,
6715  *                           cython.floating c[3]) nogil:
6716  */
6717 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float * __pyx_v_a,float * __pyx_v_b,float * __pyx_v_c)6718 static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) {
6719 
6720   /* "vec3_ops.pxd":31
6721  *                           const cython.floating[3] b,
6722  *                           cython.floating c[3]) nogil:
6723  *     c[0] = a[0] - b[0]             # <<<<<<<<<<<<<<
6724  *     c[1] = a[1] - b[1]
6725  *     c[2] = a[2] - b[2]
6726  */
6727   (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0]));
6728 
6729   /* "vec3_ops.pxd":32
6730  *                           cython.floating c[3]) nogil:
6731  *     c[0] = a[0] - b[0]
6732  *     c[1] = a[1] - b[1]             # <<<<<<<<<<<<<<
6733  *     c[2] = a[2] - b[2]
6734  *
6735  */
6736   (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1]));
6737 
6738   /* "vec3_ops.pxd":33
6739  *     c[0] = a[0] - b[0]
6740  *     c[1] = a[1] - b[1]
6741  *     c[2] = a[2] - b[2]             # <<<<<<<<<<<<<<
6742  *
6743  *
6744  */
6745   (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2]));
6746 
6747   /* "vec3_ops.pxd":28
6748  * @cython.wraparound(False)
6749  * @cython.cdivision(True)
6750  * cdef inline void subtract(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6751  *                           const cython.floating[3] b,
6752  *                           cython.floating c[3]) nogil:
6753  */
6754 
6755   /* function exit code */
6756 }
6757 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double * __pyx_v_a,double * __pyx_v_b,double * __pyx_v_c)6758 static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_subtract(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) {
6759 
6760   /* "vec3_ops.pxd":31
6761  *                           const cython.floating[3] b,
6762  *                           cython.floating c[3]) nogil:
6763  *     c[0] = a[0] - b[0]             # <<<<<<<<<<<<<<
6764  *     c[1] = a[1] - b[1]
6765  *     c[2] = a[2] - b[2]
6766  */
6767   (__pyx_v_c[0]) = ((__pyx_v_a[0]) - (__pyx_v_b[0]));
6768 
6769   /* "vec3_ops.pxd":32
6770  *                           cython.floating c[3]) nogil:
6771  *     c[0] = a[0] - b[0]
6772  *     c[1] = a[1] - b[1]             # <<<<<<<<<<<<<<
6773  *     c[2] = a[2] - b[2]
6774  *
6775  */
6776   (__pyx_v_c[1]) = ((__pyx_v_a[1]) - (__pyx_v_b[1]));
6777 
6778   /* "vec3_ops.pxd":33
6779  *     c[0] = a[0] - b[0]
6780  *     c[1] = a[1] - b[1]
6781  *     c[2] = a[2] - b[2]             # <<<<<<<<<<<<<<
6782  *
6783  *
6784  */
6785   (__pyx_v_c[2]) = ((__pyx_v_a[2]) - (__pyx_v_b[2]));
6786 
6787   /* "vec3_ops.pxd":28
6788  * @cython.wraparound(False)
6789  * @cython.cdivision(True)
6790  * cdef inline void subtract(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6791  *                           const cython.floating[3] b,
6792  *                           cython.floating c[3]) nogil:
6793  */
6794 
6795   /* function exit code */
6796 }
6797 
6798 /* "vec3_ops.pxd":39
6799  * @cython.wraparound(False)
6800  * @cython.cdivision(True)
6801  * cdef inline cython.floating distance(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6802  *                                      const cython.floating[3] b) nogil:
6803  *     return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2)
6804  */
6805 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float * __pyx_v_a,float * __pyx_v_b)6806 static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(float *__pyx_v_a, float *__pyx_v_b) {
6807   float __pyx_r;
6808 
6809   /* "vec3_ops.pxd":41
6810  * cdef inline cython.floating distance(const cython.floating[3] a,
6811  *                                      const cython.floating[3] b) nogil:
6812  *     return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2)             # <<<<<<<<<<<<<<
6813  *
6814  *
6815  */
6816   __pyx_r = sqrt(((powf(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + powf(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + powf(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0)));
6817   goto __pyx_L0;
6818 
6819   /* "vec3_ops.pxd":39
6820  * @cython.wraparound(False)
6821  * @cython.cdivision(True)
6822  * cdef inline cython.floating distance(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6823  *                                      const cython.floating[3] b) nogil:
6824  *     return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2)
6825  */
6826 
6827   /* function exit code */
6828   __pyx_L0:;
6829   return __pyx_r;
6830 }
6831 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double * __pyx_v_a,double * __pyx_v_b)6832 static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_distance(double *__pyx_v_a, double *__pyx_v_b) {
6833   double __pyx_r;
6834 
6835   /* "vec3_ops.pxd":41
6836  * cdef inline cython.floating distance(const cython.floating[3] a,
6837  *                                      const cython.floating[3] b) nogil:
6838  *     return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2)             # <<<<<<<<<<<<<<
6839  *
6840  *
6841  */
6842   __pyx_r = sqrt(((pow(((__pyx_v_a[0]) - (__pyx_v_b[0])), 2.0) + pow(((__pyx_v_a[1]) - (__pyx_v_b[1])), 2.0)) + pow(((__pyx_v_a[2]) - (__pyx_v_b[2])), 2.0)));
6843   goto __pyx_L0;
6844 
6845   /* "vec3_ops.pxd":39
6846  * @cython.wraparound(False)
6847  * @cython.cdivision(True)
6848  * cdef inline cython.floating distance(const cython.floating[3] a,             # <<<<<<<<<<<<<<
6849  *                                      const cython.floating[3] b) nogil:
6850  *     return sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 +(a[2] - b[2])**2)
6851  */
6852 
6853   /* function exit code */
6854   __pyx_L0:;
6855   return __pyx_r;
6856 }
6857 
6858 /* "vec3_ops.pxd":47
6859  * @cython.wraparound(False)
6860  * @cython.cdivision(True)
6861  * cdef inline void fma(const cython.floating f,             # <<<<<<<<<<<<<<
6862  *                      const cython.floating[3] a,
6863  *                      const cython.floating[3] b,
6864  */
6865 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f,float * __pyx_v_a,float * __pyx_v_b,float * __pyx_v_c)6866 static CYTHON_INLINE void __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(float const __pyx_v_f, float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c) {
6867 
6868   /* "vec3_ops.pxd":51
6869  *                      const cython.floating[3] b,
6870  *                      cython.floating[3] c) nogil:
6871  *     c[0] = f * a[0] + b[0]             # <<<<<<<<<<<<<<
6872  *     c[1] = f * a[1] + b[1]
6873  *     c[2] = f * a[2] + b[2]
6874  */
6875   (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0]));
6876 
6877   /* "vec3_ops.pxd":52
6878  *                      cython.floating[3] c) nogil:
6879  *     c[0] = f * a[0] + b[0]
6880  *     c[1] = f * a[1] + b[1]             # <<<<<<<<<<<<<<
6881  *     c[2] = f * a[2] + b[2]
6882  *
6883  */
6884   (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1]));
6885 
6886   /* "vec3_ops.pxd":53
6887  *     c[0] = f * a[0] + b[0]
6888  *     c[1] = f * a[1] + b[1]
6889  *     c[2] = f * a[2] + b[2]             # <<<<<<<<<<<<<<
6890  *
6891  *
6892  */
6893   (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2]));
6894 
6895   /* "vec3_ops.pxd":47
6896  * @cython.wraparound(False)
6897  * @cython.cdivision(True)
6898  * cdef inline void fma(const cython.floating f,             # <<<<<<<<<<<<<<
6899  *                      const cython.floating[3] a,
6900  *                      const cython.floating[3] b,
6901  */
6902 
6903   /* function exit code */
6904 }
6905 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f,double * __pyx_v_a,double * __pyx_v_b,double * __pyx_v_c)6906 static CYTHON_INLINE void __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_fma(double const __pyx_v_f, double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c) {
6907 
6908   /* "vec3_ops.pxd":51
6909  *                      const cython.floating[3] b,
6910  *                      cython.floating[3] c) nogil:
6911  *     c[0] = f * a[0] + b[0]             # <<<<<<<<<<<<<<
6912  *     c[1] = f * a[1] + b[1]
6913  *     c[2] = f * a[2] + b[2]
6914  */
6915   (__pyx_v_c[0]) = ((__pyx_v_f * (__pyx_v_a[0])) + (__pyx_v_b[0]));
6916 
6917   /* "vec3_ops.pxd":52
6918  *                      cython.floating[3] c) nogil:
6919  *     c[0] = f * a[0] + b[0]
6920  *     c[1] = f * a[1] + b[1]             # <<<<<<<<<<<<<<
6921  *     c[2] = f * a[2] + b[2]
6922  *
6923  */
6924   (__pyx_v_c[1]) = ((__pyx_v_f * (__pyx_v_a[1])) + (__pyx_v_b[1]));
6925 
6926   /* "vec3_ops.pxd":53
6927  *     c[0] = f * a[0] + b[0]
6928  *     c[1] = f * a[1] + b[1]
6929  *     c[2] = f * a[2] + b[2]             # <<<<<<<<<<<<<<
6930  *
6931  *
6932  */
6933   (__pyx_v_c[2]) = ((__pyx_v_f * (__pyx_v_a[2])) + (__pyx_v_b[2]));
6934 
6935   /* "vec3_ops.pxd":47
6936  * @cython.wraparound(False)
6937  * @cython.cdivision(True)
6938  * cdef inline void fma(const cython.floating f,             # <<<<<<<<<<<<<<
6939  *                      const cython.floating[3] a,
6940  *                      const cython.floating[3] b,
6941  */
6942 
6943   /* function exit code */
6944 }
6945 
6946 /* "vec3_ops.pxd":59
6947  * @cython.wraparound(False)
6948  * @cython.cdivision(True)
6949  * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil:             # <<<<<<<<<<<<<<
6950  *     return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2])
6951  */
6952 
__pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float * __pyx_v_a)6953 static CYTHON_INLINE float __pyx_fuse_0__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(float *__pyx_v_a) {
6954   float __pyx_r;
6955 
6956   /* "vec3_ops.pxd":60
6957  * @cython.cdivision(True)
6958  * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil:
6959  *     return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2])             # <<<<<<<<<<<<<<
6960  */
6961   __pyx_r = sqrt(((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2]))));
6962   goto __pyx_L0;
6963 
6964   /* "vec3_ops.pxd":59
6965  * @cython.wraparound(False)
6966  * @cython.cdivision(True)
6967  * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil:             # <<<<<<<<<<<<<<
6968  *     return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2])
6969  */
6970 
6971   /* function exit code */
6972   __pyx_L0:;
6973   return __pyx_r;
6974 }
6975 
__pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double * __pyx_v_a)6976 static CYTHON_INLINE double __pyx_fuse_1__pyx_f_2yt_9utilities_3lib_8vec3_ops_L2_norm(double *__pyx_v_a) {
6977   double __pyx_r;
6978 
6979   /* "vec3_ops.pxd":60
6980  * @cython.cdivision(True)
6981  * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil:
6982  *     return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2])             # <<<<<<<<<<<<<<
6983  */
6984   __pyx_r = sqrt(((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2]))));
6985   goto __pyx_L0;
6986 
6987   /* "vec3_ops.pxd":59
6988  * @cython.wraparound(False)
6989  * @cython.cdivision(True)
6990  * cdef inline cython.floating L2_norm(const cython.floating[3] a) nogil:             # <<<<<<<<<<<<<<
6991  *     return sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2])
6992  */
6993 
6994   /* function exit code */
6995   __pyx_L0:;
6996   return __pyx_r;
6997 }
6998 
6999 /* "yt/utilities/lib/fp_utils.pxd":13
7000  *
7001  *
7002  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7003  *     if i0 > i1: return i0
7004  *     return i1
7005  */
7006 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)7007 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
7008   __pyx_t_5numpy_int64_t __pyx_r;
7009   int __pyx_t_1;
7010 
7011   /* "yt/utilities/lib/fp_utils.pxd":14
7012  *
7013  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
7014  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
7015  *     return i1
7016  *
7017  */
7018   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
7019   if (__pyx_t_1) {
7020     __pyx_r = __pyx_v_i0;
7021     goto __pyx_L0;
7022   }
7023 
7024   /* "yt/utilities/lib/fp_utils.pxd":15
7025  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
7026  *     if i0 > i1: return i0
7027  *     return i1             # <<<<<<<<<<<<<<
7028  *
7029  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
7030  */
7031   __pyx_r = __pyx_v_i1;
7032   goto __pyx_L0;
7033 
7034   /* "yt/utilities/lib/fp_utils.pxd":13
7035  *
7036  *
7037  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7038  *     if i0 > i1: return i0
7039  *     return i1
7040  */
7041 
7042   /* function exit code */
7043   __pyx_L0:;
7044   return __pyx_r;
7045 }
7046 
7047 /* "yt/utilities/lib/fp_utils.pxd":17
7048  *     return i1
7049  *
7050  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
7051  *     if f0 > f1: return f0
7052  *     return f1
7053  */
7054 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)7055 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
7056   __pyx_t_5numpy_float64_t __pyx_r;
7057   int __pyx_t_1;
7058 
7059   /* "yt/utilities/lib/fp_utils.pxd":18
7060  *
7061  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
7062  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
7063  *     return f1
7064  *
7065  */
7066   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
7067   if (__pyx_t_1) {
7068     __pyx_r = __pyx_v_f0;
7069     goto __pyx_L0;
7070   }
7071 
7072   /* "yt/utilities/lib/fp_utils.pxd":19
7073  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
7074  *     if f0 > f1: return f0
7075  *     return f1             # <<<<<<<<<<<<<<
7076  *
7077  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
7078  */
7079   __pyx_r = __pyx_v_f1;
7080   goto __pyx_L0;
7081 
7082   /* "yt/utilities/lib/fp_utils.pxd":17
7083  *     return i1
7084  *
7085  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
7086  *     if f0 > f1: return f0
7087  *     return f1
7088  */
7089 
7090   /* function exit code */
7091   __pyx_L0:;
7092   return __pyx_r;
7093 }
7094 
7095 /* "yt/utilities/lib/fp_utils.pxd":21
7096  *     return f1
7097  *
7098  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7099  *     if i0 < i1: return i0
7100  *     return i1
7101  */
7102 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)7103 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
7104   __pyx_t_5numpy_int64_t __pyx_r;
7105   int __pyx_t_1;
7106 
7107   /* "yt/utilities/lib/fp_utils.pxd":22
7108  *
7109  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
7110  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
7111  *     return i1
7112  *
7113  */
7114   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
7115   if (__pyx_t_1) {
7116     __pyx_r = __pyx_v_i0;
7117     goto __pyx_L0;
7118   }
7119 
7120   /* "yt/utilities/lib/fp_utils.pxd":23
7121  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
7122  *     if i0 < i1: return i0
7123  *     return i1             # <<<<<<<<<<<<<<
7124  *
7125  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
7126  */
7127   __pyx_r = __pyx_v_i1;
7128   goto __pyx_L0;
7129 
7130   /* "yt/utilities/lib/fp_utils.pxd":21
7131  *     return f1
7132  *
7133  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7134  *     if i0 < i1: return i0
7135  *     return i1
7136  */
7137 
7138   /* function exit code */
7139   __pyx_L0:;
7140   return __pyx_r;
7141 }
7142 
7143 /* "yt/utilities/lib/fp_utils.pxd":25
7144  *     return i1
7145  *
7146  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
7147  *     if f0 < f1: return f0
7148  *     return f1
7149  */
7150 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)7151 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
7152   __pyx_t_5numpy_float64_t __pyx_r;
7153   int __pyx_t_1;
7154 
7155   /* "yt/utilities/lib/fp_utils.pxd":26
7156  *
7157  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
7158  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
7159  *     return f1
7160  *
7161  */
7162   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
7163   if (__pyx_t_1) {
7164     __pyx_r = __pyx_v_f0;
7165     goto __pyx_L0;
7166   }
7167 
7168   /* "yt/utilities/lib/fp_utils.pxd":27
7169  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
7170  *     if f0 < f1: return f0
7171  *     return f1             # <<<<<<<<<<<<<<
7172  *
7173  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
7174  */
7175   __pyx_r = __pyx_v_f1;
7176   goto __pyx_L0;
7177 
7178   /* "yt/utilities/lib/fp_utils.pxd":25
7179  *     return i1
7180  *
7181  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
7182  *     if f0 < f1: return f0
7183  *     return f1
7184  */
7185 
7186   /* function exit code */
7187   __pyx_L0:;
7188   return __pyx_r;
7189 }
7190 
7191 /* "yt/utilities/lib/fp_utils.pxd":29
7192  *     return f1
7193  *
7194  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
7195  *     if f0 < 0.0: return -f0
7196  *     return f0
7197  */
7198 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)7199 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
7200   __pyx_t_5numpy_float64_t __pyx_r;
7201   int __pyx_t_1;
7202 
7203   /* "yt/utilities/lib/fp_utils.pxd":30
7204  *
7205  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
7206  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
7207  *     return f0
7208  *
7209  */
7210   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
7211   if (__pyx_t_1) {
7212     __pyx_r = (-__pyx_v_f0);
7213     goto __pyx_L0;
7214   }
7215 
7216   /* "yt/utilities/lib/fp_utils.pxd":31
7217  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
7218  *     if f0 < 0.0: return -f0
7219  *     return f0             # <<<<<<<<<<<<<<
7220  *
7221  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7222  */
7223   __pyx_r = __pyx_v_f0;
7224   goto __pyx_L0;
7225 
7226   /* "yt/utilities/lib/fp_utils.pxd":29
7227  *     return f1
7228  *
7229  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
7230  *     if f0 < 0.0: return -f0
7231  *     return f0
7232  */
7233 
7234   /* function exit code */
7235   __pyx_L0:;
7236   return __pyx_r;
7237 }
7238 
7239 /* "yt/utilities/lib/fp_utils.pxd":33
7240  *     return f0
7241  *
7242  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
7243  *     if i < a: return a
7244  *     if i > b: return b
7245  */
7246 
__pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)7247 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
7248   __pyx_t_5numpy_int64_t __pyx_r;
7249   int __pyx_t_1;
7250 
7251   /* "yt/utilities/lib/fp_utils.pxd":34
7252  *
7253  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7254  *     if i < a: return a             # <<<<<<<<<<<<<<
7255  *     if i > b: return b
7256  *     return i
7257  */
7258   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
7259   if (__pyx_t_1) {
7260     __pyx_r = __pyx_v_a;
7261     goto __pyx_L0;
7262   }
7263 
7264   /* "yt/utilities/lib/fp_utils.pxd":35
7265  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7266  *     if i < a: return a
7267  *     if i > b: return b             # <<<<<<<<<<<<<<
7268  *     return i
7269  *
7270  */
7271   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
7272   if (__pyx_t_1) {
7273     __pyx_r = __pyx_v_b;
7274     goto __pyx_L0;
7275   }
7276 
7277   /* "yt/utilities/lib/fp_utils.pxd":36
7278  *     if i < a: return a
7279  *     if i > b: return b
7280  *     return i             # <<<<<<<<<<<<<<
7281  *
7282  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7283  */
7284   __pyx_r = __pyx_v_i;
7285   goto __pyx_L0;
7286 
7287   /* "yt/utilities/lib/fp_utils.pxd":33
7288  *     return f0
7289  *
7290  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
7291  *     if i < a: return a
7292  *     if i > b: return b
7293  */
7294 
7295   /* function exit code */
7296   __pyx_L0:;
7297   return __pyx_r;
7298 }
7299 
7300 /* "yt/utilities/lib/fp_utils.pxd":38
7301  *     return i
7302  *
7303  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
7304  *     if i < a: return a
7305  *     if i > b: return b
7306  */
7307 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)7308 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
7309   __pyx_t_5numpy_int64_t __pyx_r;
7310   int __pyx_t_1;
7311 
7312   /* "yt/utilities/lib/fp_utils.pxd":39
7313  *
7314  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7315  *     if i < a: return a             # <<<<<<<<<<<<<<
7316  *     if i > b: return b
7317  *     return i
7318  */
7319   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
7320   if (__pyx_t_1) {
7321     __pyx_r = __pyx_v_a;
7322     goto __pyx_L0;
7323   }
7324 
7325   /* "yt/utilities/lib/fp_utils.pxd":40
7326  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
7327  *     if i < a: return a
7328  *     if i > b: return b             # <<<<<<<<<<<<<<
7329  *     return i
7330  *
7331  */
7332   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
7333   if (__pyx_t_1) {
7334     __pyx_r = __pyx_v_b;
7335     goto __pyx_L0;
7336   }
7337 
7338   /* "yt/utilities/lib/fp_utils.pxd":41
7339  *     if i < a: return a
7340  *     if i > b: return b
7341  *     return i             # <<<<<<<<<<<<<<
7342  *
7343  * cdef inline np.float64_t fclip(np.float64_t f,
7344  */
7345   __pyx_r = __pyx_v_i;
7346   goto __pyx_L0;
7347 
7348   /* "yt/utilities/lib/fp_utils.pxd":38
7349  *     return i
7350  *
7351  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
7352  *     if i < a: return a
7353  *     if i > b: return b
7354  */
7355 
7356   /* function exit code */
7357   __pyx_L0:;
7358   return __pyx_r;
7359 }
7360 
7361 /* "yt/utilities/lib/fp_utils.pxd":43
7362  *     return i
7363  *
7364  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
7365  *                       np.float64_t a, np.float64_t b) nogil:
7366  *     return fmin(fmax(f, a), b)
7367  */
7368 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f,__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)7369 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
7370   __pyx_t_5numpy_float64_t __pyx_r;
7371 
7372   /* "yt/utilities/lib/fp_utils.pxd":45
7373  * cdef inline np.float64_t fclip(np.float64_t f,
7374  *                       np.float64_t a, np.float64_t b) nogil:
7375  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
7376  *
7377  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
7378  */
7379   __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b);
7380   goto __pyx_L0;
7381 
7382   /* "yt/utilities/lib/fp_utils.pxd":43
7383  *     return i
7384  *
7385  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
7386  *                       np.float64_t a, np.float64_t b) nogil:
7387  *     return fmin(fmax(f, a), b)
7388  */
7389 
7390   /* function exit code */
7391   __pyx_L0:;
7392   return __pyx_r;
7393 }
7394 
7395 /* "yt/utilities/lib/fp_utils.pxd":47
7396  *     return fmin(fmax(f, a), b)
7397  *
7398  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7399  *     if i0 > i1: return i0
7400  *     return i1
7401  */
7402 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)7403 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
7404   __pyx_t_5numpy_int64_t __pyx_r;
7405   int __pyx_t_1;
7406 
7407   /* "yt/utilities/lib/fp_utils.pxd":48
7408  *
7409  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
7410  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
7411  *     return i1
7412  *
7413  */
7414   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
7415   if (__pyx_t_1) {
7416     __pyx_r = __pyx_v_i0;
7417     goto __pyx_L0;
7418   }
7419 
7420   /* "yt/utilities/lib/fp_utils.pxd":49
7421  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
7422  *     if i0 > i1: return i0
7423  *     return i1             # <<<<<<<<<<<<<<
7424  *
7425  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
7426  */
7427   __pyx_r = __pyx_v_i1;
7428   goto __pyx_L0;
7429 
7430   /* "yt/utilities/lib/fp_utils.pxd":47
7431  *     return fmin(fmax(f, a), b)
7432  *
7433  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7434  *     if i0 > i1: return i0
7435  *     return i1
7436  */
7437 
7438   /* function exit code */
7439   __pyx_L0:;
7440   return __pyx_r;
7441 }
7442 
7443 /* "yt/utilities/lib/fp_utils.pxd":51
7444  *     return i1
7445  *
7446  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7447  *     if i0 < i1: return i0
7448  *     return i1
7449  */
7450 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)7451 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
7452   __pyx_t_5numpy_int64_t __pyx_r;
7453   int __pyx_t_1;
7454 
7455   /* "yt/utilities/lib/fp_utils.pxd":52
7456  *
7457  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
7458  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
7459  *     return i1
7460  *
7461  */
7462   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
7463   if (__pyx_t_1) {
7464     __pyx_r = __pyx_v_i0;
7465     goto __pyx_L0;
7466   }
7467 
7468   /* "yt/utilities/lib/fp_utils.pxd":53
7469  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
7470  *     if i0 < i1: return i0
7471  *     return i1             # <<<<<<<<<<<<<<
7472  *
7473  * cdef inline _ensure_code(arr):
7474  */
7475   __pyx_r = __pyx_v_i1;
7476   goto __pyx_L0;
7477 
7478   /* "yt/utilities/lib/fp_utils.pxd":51
7479  *     return i1
7480  *
7481  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
7482  *     if i0 < i1: return i0
7483  *     return i1
7484  */
7485 
7486   /* function exit code */
7487   __pyx_L0:;
7488   return __pyx_r;
7489 }
7490 
7491 /* "yt/utilities/lib/fp_utils.pxd":55
7492  *     return i1
7493  *
7494  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
7495  *     if hasattr(arr, "units"):
7496  *         if "code_length" == str(arr.units):
7497  */
7498 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)7499 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
7500   PyObject *__pyx_r = NULL;
7501   __Pyx_RefNannyDeclarations
7502   int __pyx_t_1;
7503   int __pyx_t_2;
7504   PyObject *__pyx_t_3 = NULL;
7505   PyObject *__pyx_t_4 = NULL;
7506   PyObject *__pyx_t_5 = NULL;
7507   __Pyx_RefNannySetupContext("_ensure_code", 0);
7508 
7509   /* "yt/utilities/lib/fp_utils.pxd":56
7510  *
7511  * cdef inline _ensure_code(arr):
7512  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
7513  *         if "code_length" == str(arr.units):
7514  *             return arr
7515  */
7516   __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 56, __pyx_L1_error)
7517   __pyx_t_2 = (__pyx_t_1 != 0);
7518   if (__pyx_t_2) {
7519 
7520     /* "yt/utilities/lib/fp_utils.pxd":57
7521  * cdef inline _ensure_code(arr):
7522  *     if hasattr(arr, "units"):
7523  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
7524  *             return arr
7525  *         arr.convert_to_units("code_length")
7526  */
7527     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 57, __pyx_L1_error)
7528     __Pyx_GOTREF(__pyx_t_3);
7529     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 57, __pyx_L1_error)
7530     __Pyx_GOTREF(__pyx_t_4);
7531     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7532     __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 57, __pyx_L1_error)
7533     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7534     if (__pyx_t_2) {
7535 
7536       /* "yt/utilities/lib/fp_utils.pxd":58
7537  *     if hasattr(arr, "units"):
7538  *         if "code_length" == str(arr.units):
7539  *             return arr             # <<<<<<<<<<<<<<
7540  *         arr.convert_to_units("code_length")
7541  *     return arr
7542  */
7543       __Pyx_XDECREF(__pyx_r);
7544       __Pyx_INCREF(__pyx_v_arr);
7545       __pyx_r = __pyx_v_arr;
7546       goto __pyx_L0;
7547 
7548       /* "yt/utilities/lib/fp_utils.pxd":57
7549  * cdef inline _ensure_code(arr):
7550  *     if hasattr(arr, "units"):
7551  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
7552  *             return arr
7553  *         arr.convert_to_units("code_length")
7554  */
7555     }
7556 
7557     /* "yt/utilities/lib/fp_utils.pxd":59
7558  *         if "code_length" == str(arr.units):
7559  *             return arr
7560  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
7561  *     return arr
7562  */
7563     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 59, __pyx_L1_error)
7564     __Pyx_GOTREF(__pyx_t_3);
7565     __pyx_t_5 = NULL;
7566     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7567       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
7568       if (likely(__pyx_t_5)) {
7569         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7570         __Pyx_INCREF(__pyx_t_5);
7571         __Pyx_INCREF(function);
7572         __Pyx_DECREF_SET(__pyx_t_3, function);
7573       }
7574     }
7575     __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_n_s_code_length) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_code_length);
7576     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7577     if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 59, __pyx_L1_error)
7578     __Pyx_GOTREF(__pyx_t_4);
7579     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7580     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7581 
7582     /* "yt/utilities/lib/fp_utils.pxd":56
7583  *
7584  * cdef inline _ensure_code(arr):
7585  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
7586  *         if "code_length" == str(arr.units):
7587  *             return arr
7588  */
7589   }
7590 
7591   /* "yt/utilities/lib/fp_utils.pxd":60
7592  *             return arr
7593  *         arr.convert_to_units("code_length")
7594  *     return arr             # <<<<<<<<<<<<<<
7595  */
7596   __Pyx_XDECREF(__pyx_r);
7597   __Pyx_INCREF(__pyx_v_arr);
7598   __pyx_r = __pyx_v_arr;
7599   goto __pyx_L0;
7600 
7601   /* "yt/utilities/lib/fp_utils.pxd":55
7602  *     return i1
7603  *
7604  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
7605  *     if hasattr(arr, "units"):
7606  *         if "code_length" == str(arr.units):
7607  */
7608 
7609   /* function exit code */
7610   __pyx_L1_error:;
7611   __Pyx_XDECREF(__pyx_t_3);
7612   __Pyx_XDECREF(__pyx_t_4);
7613   __Pyx_XDECREF(__pyx_t_5);
7614   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
7615   __pyx_r = 0;
7616   __pyx_L0:;
7617   __Pyx_XGIVEREF(__pyx_r);
7618   __Pyx_RefNannyFinishContext();
7619   return __pyx_r;
7620 }
7621 
7622 /* "volume_container.pxd":35
7623  *     int dims[3]
7624  *
7625  * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k):             # <<<<<<<<<<<<<<
7626  *     #-----------------------------------------------------------------------------
7627  *     # vc_index(VolumeContainer *vc, int i, int j, int k)
7628  */
7629 
__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)7630 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) {
7631   int __pyx_r;
7632   __Pyx_RefNannyDeclarations
7633   __Pyx_RefNannySetupContext("vc_index", 0);
7634 
7635   /* "volume_container.pxd":63
7636  *     # The 3-dimensional case (presented below) is similar.
7637  *     #-----------------------------------------------------------------------------
7638  *     return (i*vc.dims[1]+j)*vc.dims[2]+k             # <<<<<<<<<<<<<<
7639  *
7640  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):
7641  */
7642   __pyx_r = ((((__pyx_v_i * (__pyx_v_vc->dims[1])) + __pyx_v_j) * (__pyx_v_vc->dims[2])) + __pyx_v_k);
7643   goto __pyx_L0;
7644 
7645   /* "volume_container.pxd":35
7646  *     int dims[3]
7647  *
7648  * cdef inline int vc_index(VolumeContainer *vc, int i, int j, int k):             # <<<<<<<<<<<<<<
7649  *     #-----------------------------------------------------------------------------
7650  *     # vc_index(VolumeContainer *vc, int i, int j, int k)
7651  */
7652 
7653   /* function exit code */
7654   __pyx_L0:;
7655   __Pyx_RefNannyFinishContext();
7656   return __pyx_r;
7657 }
7658 
7659 /* "volume_container.pxd":65
7660  *     return (i*vc.dims[1]+j)*vc.dims[2]+k
7661  *
7662  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):             # <<<<<<<<<<<<<<
7663  *     cdef int index[3]
7664  *     cdef int i
7665  */
7666 
__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)7667 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) {
7668   int __pyx_v_index[3];
7669   int __pyx_v_i;
7670   int __pyx_r;
7671   __Pyx_RefNannyDeclarations
7672   int __pyx_t_1;
7673   __Pyx_RefNannySetupContext("vc_pos_index", 0);
7674 
7675   /* "volume_container.pxd":68
7676  *     cdef int index[3]
7677  *     cdef int i
7678  *     for i in range(3):             # <<<<<<<<<<<<<<
7679  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
7680  *     return vc_index(vc, index[0], index[1], index[2])
7681  */
7682   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
7683     __pyx_v_i = __pyx_t_1;
7684 
7685     /* "volume_container.pxd":69
7686  *     cdef int i
7687  *     for i in range(3):
7688  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])             # <<<<<<<<<<<<<<
7689  *     return vc_index(vc, index[0], index[1], index[2])
7690  */
7691     (__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])));
7692   }
7693 
7694   /* "volume_container.pxd":70
7695  *     for i in range(3):
7696  *         index[i] = <int> ((spos[i] - vc.left_edge[i]) * vc.idds[i])
7697  *     return vc_index(vc, index[0], index[1], index[2])             # <<<<<<<<<<<<<<
7698  */
7699   __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]));
7700   goto __pyx_L0;
7701 
7702   /* "volume_container.pxd":65
7703  *     return (i*vc.dims[1]+j)*vc.dims[2]+k
7704  *
7705  * cdef inline int vc_pos_index(VolumeContainer *vc, np.float64_t *spos):             # <<<<<<<<<<<<<<
7706  *     cdef int index[3]
7707  *     cdef int i
7708  */
7709 
7710   /* function exit code */
7711   __pyx_L0:;
7712   __Pyx_RefNannyFinishContext();
7713   return __pyx_r;
7714 }
7715 
7716 /* "View.MemoryView":122
7717  *         cdef bint dtype_is_object
7718  *
7719  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
7720  *                   mode="c", bint allocate_buffer=True):
7721  *
7722  */
7723 
7724 /* Python wrapper */
7725 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)7726 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7727   PyObject *__pyx_v_shape = 0;
7728   Py_ssize_t __pyx_v_itemsize;
7729   PyObject *__pyx_v_format = 0;
7730   PyObject *__pyx_v_mode = 0;
7731   int __pyx_v_allocate_buffer;
7732   int __pyx_r;
7733   __Pyx_RefNannyDeclarations
7734   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7735   {
7736     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};
7737     PyObject* values[5] = {0,0,0,0,0};
7738     values[3] = ((PyObject *)__pyx_n_s_c);
7739     if (unlikely(__pyx_kwds)) {
7740       Py_ssize_t kw_args;
7741       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7742       switch (pos_args) {
7743         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7744         CYTHON_FALLTHROUGH;
7745         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7746         CYTHON_FALLTHROUGH;
7747         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7748         CYTHON_FALLTHROUGH;
7749         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7750         CYTHON_FALLTHROUGH;
7751         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7752         CYTHON_FALLTHROUGH;
7753         case  0: break;
7754         default: goto __pyx_L5_argtuple_error;
7755       }
7756       kw_args = PyDict_Size(__pyx_kwds);
7757       switch (pos_args) {
7758         case  0:
7759         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7760         else goto __pyx_L5_argtuple_error;
7761         CYTHON_FALLTHROUGH;
7762         case  1:
7763         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7764         else {
7765           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(3, 122, __pyx_L3_error)
7766         }
7767         CYTHON_FALLTHROUGH;
7768         case  2:
7769         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7770         else {
7771           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(3, 122, __pyx_L3_error)
7772         }
7773         CYTHON_FALLTHROUGH;
7774         case  3:
7775         if (kw_args > 0) {
7776           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7777           if (value) { values[3] = value; kw_args--; }
7778         }
7779         CYTHON_FALLTHROUGH;
7780         case  4:
7781         if (kw_args > 0) {
7782           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7783           if (value) { values[4] = value; kw_args--; }
7784         }
7785       }
7786       if (unlikely(kw_args > 0)) {
7787         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 122, __pyx_L3_error)
7788       }
7789     } else {
7790       switch (PyTuple_GET_SIZE(__pyx_args)) {
7791         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7792         CYTHON_FALLTHROUGH;
7793         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7794         CYTHON_FALLTHROUGH;
7795         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7796         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7797         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7798         break;
7799         default: goto __pyx_L5_argtuple_error;
7800       }
7801     }
7802     __pyx_v_shape = ((PyObject*)values[0]);
7803     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 122, __pyx_L3_error)
7804     __pyx_v_format = values[2];
7805     __pyx_v_mode = values[3];
7806     if (values[4]) {
7807       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L3_error)
7808     } else {
7809 
7810       /* "View.MemoryView":123
7811  *
7812  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7813  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
7814  *
7815  *         cdef int idx
7816  */
7817       __pyx_v_allocate_buffer = ((int)1);
7818     }
7819   }
7820   goto __pyx_L4_argument_unpacking_done;
7821   __pyx_L5_argtuple_error:;
7822   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 122, __pyx_L3_error)
7823   __pyx_L3_error:;
7824   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7825   __Pyx_RefNannyFinishContext();
7826   return -1;
7827   __pyx_L4_argument_unpacking_done:;
7828   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(3, 122, __pyx_L1_error)
7829   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7830     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(3, 122, __pyx_L1_error)
7831   }
7832   __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);
7833 
7834   /* "View.MemoryView":122
7835  *         cdef bint dtype_is_object
7836  *
7837  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
7838  *                   mode="c", bint allocate_buffer=True):
7839  *
7840  */
7841 
7842   /* function exit code */
7843   goto __pyx_L0;
7844   __pyx_L1_error:;
7845   __pyx_r = -1;
7846   __pyx_L0:;
7847   __Pyx_RefNannyFinishContext();
7848   return __pyx_r;
7849 }
7850 
__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)7851 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) {
7852   int __pyx_v_idx;
7853   Py_ssize_t __pyx_v_i;
7854   Py_ssize_t __pyx_v_dim;
7855   PyObject **__pyx_v_p;
7856   char __pyx_v_order;
7857   int __pyx_r;
7858   __Pyx_RefNannyDeclarations
7859   Py_ssize_t __pyx_t_1;
7860   int __pyx_t_2;
7861   PyObject *__pyx_t_3 = NULL;
7862   int __pyx_t_4;
7863   PyObject *__pyx_t_5 = NULL;
7864   PyObject *__pyx_t_6 = NULL;
7865   char *__pyx_t_7;
7866   int __pyx_t_8;
7867   Py_ssize_t __pyx_t_9;
7868   PyObject *__pyx_t_10 = NULL;
7869   Py_ssize_t __pyx_t_11;
7870   __Pyx_RefNannySetupContext("__cinit__", 0);
7871   __Pyx_INCREF(__pyx_v_format);
7872 
7873   /* "View.MemoryView":129
7874  *         cdef PyObject **p
7875  *
7876  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
7877  *         self.itemsize = itemsize
7878  *
7879  */
7880   if (unlikely(__pyx_v_shape == Py_None)) {
7881     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7882     __PYX_ERR(3, 129, __pyx_L1_error)
7883   }
7884   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 129, __pyx_L1_error)
7885   __pyx_v_self->ndim = ((int)__pyx_t_1);
7886 
7887   /* "View.MemoryView":130
7888  *
7889  *         self.ndim = <int> len(shape)
7890  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
7891  *
7892  *         if not self.ndim:
7893  */
7894   __pyx_v_self->itemsize = __pyx_v_itemsize;
7895 
7896   /* "View.MemoryView":132
7897  *         self.itemsize = itemsize
7898  *
7899  *         if not self.ndim:             # <<<<<<<<<<<<<<
7900  *             raise ValueError("Empty shape tuple for cython.array")
7901  *
7902  */
7903   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7904   if (unlikely(__pyx_t_2)) {
7905 
7906     /* "View.MemoryView":133
7907  *
7908  *         if not self.ndim:
7909  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
7910  *
7911  *         if itemsize <= 0:
7912  */
7913     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 133, __pyx_L1_error)
7914     __Pyx_GOTREF(__pyx_t_3);
7915     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7916     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7917     __PYX_ERR(3, 133, __pyx_L1_error)
7918 
7919     /* "View.MemoryView":132
7920  *         self.itemsize = itemsize
7921  *
7922  *         if not self.ndim:             # <<<<<<<<<<<<<<
7923  *             raise ValueError("Empty shape tuple for cython.array")
7924  *
7925  */
7926   }
7927 
7928   /* "View.MemoryView":135
7929  *             raise ValueError("Empty shape tuple for cython.array")
7930  *
7931  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
7932  *             raise ValueError("itemsize <= 0 for cython.array")
7933  *
7934  */
7935   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7936   if (unlikely(__pyx_t_2)) {
7937 
7938     /* "View.MemoryView":136
7939  *
7940  *         if itemsize <= 0:
7941  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
7942  *
7943  *         if not isinstance(format, bytes):
7944  */
7945     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __pyx_L1_error)
7946     __Pyx_GOTREF(__pyx_t_3);
7947     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7948     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7949     __PYX_ERR(3, 136, __pyx_L1_error)
7950 
7951     /* "View.MemoryView":135
7952  *             raise ValueError("Empty shape tuple for cython.array")
7953  *
7954  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
7955  *             raise ValueError("itemsize <= 0 for cython.array")
7956  *
7957  */
7958   }
7959 
7960   /* "View.MemoryView":138
7961  *             raise ValueError("itemsize <= 0 for cython.array")
7962  *
7963  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
7964  *             format = format.encode('ASCII')
7965  *         self._format = format  # keep a reference to the byte string
7966  */
7967   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7968   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7969   if (__pyx_t_4) {
7970 
7971     /* "View.MemoryView":139
7972  *
7973  *         if not isinstance(format, bytes):
7974  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
7975  *         self._format = format  # keep a reference to the byte string
7976  *         self.format = self._format
7977  */
7978     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 139, __pyx_L1_error)
7979     __Pyx_GOTREF(__pyx_t_5);
7980     __pyx_t_6 = NULL;
7981     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7982       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7983       if (likely(__pyx_t_6)) {
7984         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7985         __Pyx_INCREF(__pyx_t_6);
7986         __Pyx_INCREF(function);
7987         __Pyx_DECREF_SET(__pyx_t_5, function);
7988       }
7989     }
7990     __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);
7991     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7992     if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 139, __pyx_L1_error)
7993     __Pyx_GOTREF(__pyx_t_3);
7994     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7995     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7996     __pyx_t_3 = 0;
7997 
7998     /* "View.MemoryView":138
7999  *             raise ValueError("itemsize <= 0 for cython.array")
8000  *
8001  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
8002  *             format = format.encode('ASCII')
8003  *         self._format = format  # keep a reference to the byte string
8004  */
8005   }
8006 
8007   /* "View.MemoryView":140
8008  *         if not isinstance(format, bytes):
8009  *             format = format.encode('ASCII')
8010  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
8011  *         self.format = self._format
8012  *
8013  */
8014   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(3, 140, __pyx_L1_error)
8015   __pyx_t_3 = __pyx_v_format;
8016   __Pyx_INCREF(__pyx_t_3);
8017   __Pyx_GIVEREF(__pyx_t_3);
8018   __Pyx_GOTREF(__pyx_v_self->_format);
8019   __Pyx_DECREF(__pyx_v_self->_format);
8020   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8021   __pyx_t_3 = 0;
8022 
8023   /* "View.MemoryView":141
8024  *             format = format.encode('ASCII')
8025  *         self._format = format  # keep a reference to the byte string
8026  *         self.format = self._format             # <<<<<<<<<<<<<<
8027  *
8028  *
8029  */
8030   if (unlikely(__pyx_v_self->_format == Py_None)) {
8031     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8032     __PYX_ERR(3, 141, __pyx_L1_error)
8033   }
8034   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(3, 141, __pyx_L1_error)
8035   __pyx_v_self->format = __pyx_t_7;
8036 
8037   /* "View.MemoryView":144
8038  *
8039  *
8040  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
8041  *         self._strides = self._shape + self.ndim
8042  *
8043  */
8044   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8045 
8046   /* "View.MemoryView":145
8047  *
8048  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8049  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
8050  *
8051  *         if not self._shape:
8052  */
8053   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8054 
8055   /* "View.MemoryView":147
8056  *         self._strides = self._shape + self.ndim
8057  *
8058  *         if not self._shape:             # <<<<<<<<<<<<<<
8059  *             raise MemoryError("unable to allocate shape and strides.")
8060  *
8061  */
8062   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8063   if (unlikely(__pyx_t_4)) {
8064 
8065     /* "View.MemoryView":148
8066  *
8067  *         if not self._shape:
8068  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
8069  *
8070  *
8071  */
8072     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 148, __pyx_L1_error)
8073     __Pyx_GOTREF(__pyx_t_3);
8074     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8075     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8076     __PYX_ERR(3, 148, __pyx_L1_error)
8077 
8078     /* "View.MemoryView":147
8079  *         self._strides = self._shape + self.ndim
8080  *
8081  *         if not self._shape:             # <<<<<<<<<<<<<<
8082  *             raise MemoryError("unable to allocate shape and strides.")
8083  *
8084  */
8085   }
8086 
8087   /* "View.MemoryView":151
8088  *
8089  *
8090  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
8091  *             if dim <= 0:
8092  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8093  */
8094   __pyx_t_8 = 0;
8095   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8096   for (;;) {
8097     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8098     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8099     __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(3, 151, __pyx_L1_error)
8100     #else
8101     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 151, __pyx_L1_error)
8102     __Pyx_GOTREF(__pyx_t_5);
8103     #endif
8104     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 151, __pyx_L1_error)
8105     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8106     __pyx_v_dim = __pyx_t_9;
8107     __pyx_v_idx = __pyx_t_8;
8108     __pyx_t_8 = (__pyx_t_8 + 1);
8109 
8110     /* "View.MemoryView":152
8111  *
8112  *         for idx, dim in enumerate(shape):
8113  *             if dim <= 0:             # <<<<<<<<<<<<<<
8114  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8115  *             self._shape[idx] = dim
8116  */
8117     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8118     if (unlikely(__pyx_t_4)) {
8119 
8120       /* "View.MemoryView":153
8121  *         for idx, dim in enumerate(shape):
8122  *             if dim <= 0:
8123  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
8124  *             self._shape[idx] = dim
8125  *
8126  */
8127       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 153, __pyx_L1_error)
8128       __Pyx_GOTREF(__pyx_t_5);
8129       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 153, __pyx_L1_error)
8130       __Pyx_GOTREF(__pyx_t_6);
8131       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 153, __pyx_L1_error)
8132       __Pyx_GOTREF(__pyx_t_10);
8133       __Pyx_GIVEREF(__pyx_t_5);
8134       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8135       __Pyx_GIVEREF(__pyx_t_6);
8136       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8137       __pyx_t_5 = 0;
8138       __pyx_t_6 = 0;
8139       __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(3, 153, __pyx_L1_error)
8140       __Pyx_GOTREF(__pyx_t_6);
8141       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8142       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 153, __pyx_L1_error)
8143       __Pyx_GOTREF(__pyx_t_10);
8144       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8145       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8146       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8147       __PYX_ERR(3, 153, __pyx_L1_error)
8148 
8149       /* "View.MemoryView":152
8150  *
8151  *         for idx, dim in enumerate(shape):
8152  *             if dim <= 0:             # <<<<<<<<<<<<<<
8153  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8154  *             self._shape[idx] = dim
8155  */
8156     }
8157 
8158     /* "View.MemoryView":154
8159  *             if dim <= 0:
8160  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8161  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
8162  *
8163  *         cdef char order
8164  */
8165     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8166 
8167     /* "View.MemoryView":151
8168  *
8169  *
8170  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
8171  *             if dim <= 0:
8172  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8173  */
8174   }
8175   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8176 
8177   /* "View.MemoryView":157
8178  *
8179  *         cdef char order
8180  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
8181  *             order = b'F'
8182  *             self.mode = u'fortran'
8183  */
8184   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 157, __pyx_L1_error)
8185   if (__pyx_t_4) {
8186 
8187     /* "View.MemoryView":158
8188  *         cdef char order
8189  *         if mode == 'fortran':
8190  *             order = b'F'             # <<<<<<<<<<<<<<
8191  *             self.mode = u'fortran'
8192  *         elif mode == 'c':
8193  */
8194     __pyx_v_order = 'F';
8195 
8196     /* "View.MemoryView":159
8197  *         if mode == 'fortran':
8198  *             order = b'F'
8199  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
8200  *         elif mode == 'c':
8201  *             order = b'C'
8202  */
8203     __Pyx_INCREF(__pyx_n_u_fortran);
8204     __Pyx_GIVEREF(__pyx_n_u_fortran);
8205     __Pyx_GOTREF(__pyx_v_self->mode);
8206     __Pyx_DECREF(__pyx_v_self->mode);
8207     __pyx_v_self->mode = __pyx_n_u_fortran;
8208 
8209     /* "View.MemoryView":157
8210  *
8211  *         cdef char order
8212  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
8213  *             order = b'F'
8214  *             self.mode = u'fortran'
8215  */
8216     goto __pyx_L10;
8217   }
8218 
8219   /* "View.MemoryView":160
8220  *             order = b'F'
8221  *             self.mode = u'fortran'
8222  *         elif mode == 'c':             # <<<<<<<<<<<<<<
8223  *             order = b'C'
8224  *             self.mode = u'c'
8225  */
8226   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 160, __pyx_L1_error)
8227   if (likely(__pyx_t_4)) {
8228 
8229     /* "View.MemoryView":161
8230  *             self.mode = u'fortran'
8231  *         elif mode == 'c':
8232  *             order = b'C'             # <<<<<<<<<<<<<<
8233  *             self.mode = u'c'
8234  *         else:
8235  */
8236     __pyx_v_order = 'C';
8237 
8238     /* "View.MemoryView":162
8239  *         elif mode == 'c':
8240  *             order = b'C'
8241  *             self.mode = u'c'             # <<<<<<<<<<<<<<
8242  *         else:
8243  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8244  */
8245     __Pyx_INCREF(__pyx_n_u_c);
8246     __Pyx_GIVEREF(__pyx_n_u_c);
8247     __Pyx_GOTREF(__pyx_v_self->mode);
8248     __Pyx_DECREF(__pyx_v_self->mode);
8249     __pyx_v_self->mode = __pyx_n_u_c;
8250 
8251     /* "View.MemoryView":160
8252  *             order = b'F'
8253  *             self.mode = u'fortran'
8254  *         elif mode == 'c':             # <<<<<<<<<<<<<<
8255  *             order = b'C'
8256  *             self.mode = u'c'
8257  */
8258     goto __pyx_L10;
8259   }
8260 
8261   /* "View.MemoryView":164
8262  *             self.mode = u'c'
8263  *         else:
8264  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
8265  *
8266  *         self.len = fill_contig_strides_array(self._shape, self._strides,
8267  */
8268   /*else*/ {
8269     __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(3, 164, __pyx_L1_error)
8270     __Pyx_GOTREF(__pyx_t_3);
8271     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 164, __pyx_L1_error)
8272     __Pyx_GOTREF(__pyx_t_10);
8273     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8274     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8275     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8276     __PYX_ERR(3, 164, __pyx_L1_error)
8277   }
8278   __pyx_L10:;
8279 
8280   /* "View.MemoryView":166
8281  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8282  *
8283  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
8284  *                                              itemsize, self.ndim, order)
8285  *
8286  */
8287   __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);
8288 
8289   /* "View.MemoryView":169
8290  *                                              itemsize, self.ndim, order)
8291  *
8292  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
8293  *         self.dtype_is_object = format == b'O'
8294  *         if allocate_buffer:
8295  */
8296   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8297 
8298   /* "View.MemoryView":170
8299  *
8300  *         self.free_data = allocate_buffer
8301  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
8302  *         if allocate_buffer:
8303  *
8304  */
8305   __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(3, 170, __pyx_L1_error)
8306   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 170, __pyx_L1_error)
8307   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8308   __pyx_v_self->dtype_is_object = __pyx_t_4;
8309 
8310   /* "View.MemoryView":171
8311  *         self.free_data = allocate_buffer
8312  *         self.dtype_is_object = format == b'O'
8313  *         if allocate_buffer:             # <<<<<<<<<<<<<<
8314  *
8315  *
8316  */
8317   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8318   if (__pyx_t_4) {
8319 
8320     /* "View.MemoryView":174
8321  *
8322  *
8323  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
8324  *             if not self.data:
8325  *                 raise MemoryError("unable to allocate array data.")
8326  */
8327     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8328 
8329     /* "View.MemoryView":175
8330  *
8331  *             self.data = <char *>malloc(self.len)
8332  *             if not self.data:             # <<<<<<<<<<<<<<
8333  *                 raise MemoryError("unable to allocate array data.")
8334  *
8335  */
8336     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8337     if (unlikely(__pyx_t_4)) {
8338 
8339       /* "View.MemoryView":176
8340  *             self.data = <char *>malloc(self.len)
8341  *             if not self.data:
8342  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
8343  *
8344  *             if self.dtype_is_object:
8345  */
8346       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 176, __pyx_L1_error)
8347       __Pyx_GOTREF(__pyx_t_10);
8348       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8349       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8350       __PYX_ERR(3, 176, __pyx_L1_error)
8351 
8352       /* "View.MemoryView":175
8353  *
8354  *             self.data = <char *>malloc(self.len)
8355  *             if not self.data:             # <<<<<<<<<<<<<<
8356  *                 raise MemoryError("unable to allocate array data.")
8357  *
8358  */
8359     }
8360 
8361     /* "View.MemoryView":178
8362  *                 raise MemoryError("unable to allocate array data.")
8363  *
8364  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
8365  *                 p = <PyObject **> self.data
8366  *                 for i in range(self.len / itemsize):
8367  */
8368     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8369     if (__pyx_t_4) {
8370 
8371       /* "View.MemoryView":179
8372  *
8373  *             if self.dtype_is_object:
8374  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
8375  *                 for i in range(self.len / itemsize):
8376  *                     p[i] = Py_None
8377  */
8378       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8379 
8380       /* "View.MemoryView":180
8381  *             if self.dtype_is_object:
8382  *                 p = <PyObject **> self.data
8383  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
8384  *                     p[i] = Py_None
8385  *                     Py_INCREF(Py_None)
8386  */
8387       if (unlikely(__pyx_v_itemsize == 0)) {
8388         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8389         __PYX_ERR(3, 180, __pyx_L1_error)
8390       }
8391       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))) {
8392         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8393         __PYX_ERR(3, 180, __pyx_L1_error)
8394       }
8395       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8396       __pyx_t_9 = __pyx_t_1;
8397       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8398         __pyx_v_i = __pyx_t_11;
8399 
8400         /* "View.MemoryView":181
8401  *                 p = <PyObject **> self.data
8402  *                 for i in range(self.len / itemsize):
8403  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
8404  *                     Py_INCREF(Py_None)
8405  *
8406  */
8407         (__pyx_v_p[__pyx_v_i]) = Py_None;
8408 
8409         /* "View.MemoryView":182
8410  *                 for i in range(self.len / itemsize):
8411  *                     p[i] = Py_None
8412  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
8413  *
8414  *     @cname('getbuffer')
8415  */
8416         Py_INCREF(Py_None);
8417       }
8418 
8419       /* "View.MemoryView":178
8420  *                 raise MemoryError("unable to allocate array data.")
8421  *
8422  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
8423  *                 p = <PyObject **> self.data
8424  *                 for i in range(self.len / itemsize):
8425  */
8426     }
8427 
8428     /* "View.MemoryView":171
8429  *         self.free_data = allocate_buffer
8430  *         self.dtype_is_object = format == b'O'
8431  *         if allocate_buffer:             # <<<<<<<<<<<<<<
8432  *
8433  *
8434  */
8435   }
8436 
8437   /* "View.MemoryView":122
8438  *         cdef bint dtype_is_object
8439  *
8440  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
8441  *                   mode="c", bint allocate_buffer=True):
8442  *
8443  */
8444 
8445   /* function exit code */
8446   __pyx_r = 0;
8447   goto __pyx_L0;
8448   __pyx_L1_error:;
8449   __Pyx_XDECREF(__pyx_t_3);
8450   __Pyx_XDECREF(__pyx_t_5);
8451   __Pyx_XDECREF(__pyx_t_6);
8452   __Pyx_XDECREF(__pyx_t_10);
8453   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8454   __pyx_r = -1;
8455   __pyx_L0:;
8456   __Pyx_XDECREF(__pyx_v_format);
8457   __Pyx_RefNannyFinishContext();
8458   return __pyx_r;
8459 }
8460 
8461 /* "View.MemoryView":185
8462  *
8463  *     @cname('getbuffer')
8464  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
8465  *         cdef int bufmode = -1
8466  *         if self.mode == u"c":
8467  */
8468 
8469 /* Python wrapper */
8470 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)8471 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8472   int __pyx_r;
8473   __Pyx_RefNannyDeclarations
8474   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8475   __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));
8476 
8477   /* function exit code */
8478   __Pyx_RefNannyFinishContext();
8479   return __pyx_r;
8480 }
8481 
__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)8482 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) {
8483   int __pyx_v_bufmode;
8484   int __pyx_r;
8485   __Pyx_RefNannyDeclarations
8486   int __pyx_t_1;
8487   int __pyx_t_2;
8488   PyObject *__pyx_t_3 = NULL;
8489   char *__pyx_t_4;
8490   Py_ssize_t __pyx_t_5;
8491   int __pyx_t_6;
8492   Py_ssize_t *__pyx_t_7;
8493   if (__pyx_v_info == NULL) {
8494     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8495     return -1;
8496   }
8497   __Pyx_RefNannySetupContext("__getbuffer__", 0);
8498   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8499   __Pyx_GIVEREF(__pyx_v_info->obj);
8500 
8501   /* "View.MemoryView":186
8502  *     @cname('getbuffer')
8503  *     def __getbuffer__(self, Py_buffer *info, int flags):
8504  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
8505  *         if self.mode == u"c":
8506  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8507  */
8508   __pyx_v_bufmode = -1;
8509 
8510   /* "View.MemoryView":187
8511  *     def __getbuffer__(self, Py_buffer *info, int flags):
8512  *         cdef int bufmode = -1
8513  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
8514  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8515  *         elif self.mode == u"fortran":
8516  */
8517   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 187, __pyx_L1_error)
8518   __pyx_t_2 = (__pyx_t_1 != 0);
8519   if (__pyx_t_2) {
8520 
8521     /* "View.MemoryView":188
8522  *         cdef int bufmode = -1
8523  *         if self.mode == u"c":
8524  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
8525  *         elif self.mode == u"fortran":
8526  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8527  */
8528     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8529 
8530     /* "View.MemoryView":187
8531  *     def __getbuffer__(self, Py_buffer *info, int flags):
8532  *         cdef int bufmode = -1
8533  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
8534  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8535  *         elif self.mode == u"fortran":
8536  */
8537     goto __pyx_L3;
8538   }
8539 
8540   /* "View.MemoryView":189
8541  *         if self.mode == u"c":
8542  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8543  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
8544  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8545  *         if not (flags & bufmode):
8546  */
8547   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 189, __pyx_L1_error)
8548   __pyx_t_1 = (__pyx_t_2 != 0);
8549   if (__pyx_t_1) {
8550 
8551     /* "View.MemoryView":190
8552  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8553  *         elif self.mode == u"fortran":
8554  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
8555  *         if not (flags & bufmode):
8556  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
8557  */
8558     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8559 
8560     /* "View.MemoryView":189
8561  *         if self.mode == u"c":
8562  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8563  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
8564  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8565  *         if not (flags & bufmode):
8566  */
8567   }
8568   __pyx_L3:;
8569 
8570   /* "View.MemoryView":191
8571  *         elif self.mode == u"fortran":
8572  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8573  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
8574  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
8575  *         info.buf = self.data
8576  */
8577   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8578   if (unlikely(__pyx_t_1)) {
8579 
8580     /* "View.MemoryView":192
8581  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8582  *         if not (flags & bufmode):
8583  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
8584  *         info.buf = self.data
8585  *         info.len = self.len
8586  */
8587     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 192, __pyx_L1_error)
8588     __Pyx_GOTREF(__pyx_t_3);
8589     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8590     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8591     __PYX_ERR(3, 192, __pyx_L1_error)
8592 
8593     /* "View.MemoryView":191
8594  *         elif self.mode == u"fortran":
8595  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8596  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
8597  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
8598  *         info.buf = self.data
8599  */
8600   }
8601 
8602   /* "View.MemoryView":193
8603  *         if not (flags & bufmode):
8604  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
8605  *         info.buf = self.data             # <<<<<<<<<<<<<<
8606  *         info.len = self.len
8607  *         info.ndim = self.ndim
8608  */
8609   __pyx_t_4 = __pyx_v_self->data;
8610   __pyx_v_info->buf = __pyx_t_4;
8611 
8612   /* "View.MemoryView":194
8613  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
8614  *         info.buf = self.data
8615  *         info.len = self.len             # <<<<<<<<<<<<<<
8616  *         info.ndim = self.ndim
8617  *         info.shape = self._shape
8618  */
8619   __pyx_t_5 = __pyx_v_self->len;
8620   __pyx_v_info->len = __pyx_t_5;
8621 
8622   /* "View.MemoryView":195
8623  *         info.buf = self.data
8624  *         info.len = self.len
8625  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
8626  *         info.shape = self._shape
8627  *         info.strides = self._strides
8628  */
8629   __pyx_t_6 = __pyx_v_self->ndim;
8630   __pyx_v_info->ndim = __pyx_t_6;
8631 
8632   /* "View.MemoryView":196
8633  *         info.len = self.len
8634  *         info.ndim = self.ndim
8635  *         info.shape = self._shape             # <<<<<<<<<<<<<<
8636  *         info.strides = self._strides
8637  *         info.suboffsets = NULL
8638  */
8639   __pyx_t_7 = __pyx_v_self->_shape;
8640   __pyx_v_info->shape = __pyx_t_7;
8641 
8642   /* "View.MemoryView":197
8643  *         info.ndim = self.ndim
8644  *         info.shape = self._shape
8645  *         info.strides = self._strides             # <<<<<<<<<<<<<<
8646  *         info.suboffsets = NULL
8647  *         info.itemsize = self.itemsize
8648  */
8649   __pyx_t_7 = __pyx_v_self->_strides;
8650   __pyx_v_info->strides = __pyx_t_7;
8651 
8652   /* "View.MemoryView":198
8653  *         info.shape = self._shape
8654  *         info.strides = self._strides
8655  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
8656  *         info.itemsize = self.itemsize
8657  *         info.readonly = 0
8658  */
8659   __pyx_v_info->suboffsets = NULL;
8660 
8661   /* "View.MemoryView":199
8662  *         info.strides = self._strides
8663  *         info.suboffsets = NULL
8664  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
8665  *         info.readonly = 0
8666  *
8667  */
8668   __pyx_t_5 = __pyx_v_self->itemsize;
8669   __pyx_v_info->itemsize = __pyx_t_5;
8670 
8671   /* "View.MemoryView":200
8672  *         info.suboffsets = NULL
8673  *         info.itemsize = self.itemsize
8674  *         info.readonly = 0             # <<<<<<<<<<<<<<
8675  *
8676  *         if flags & PyBUF_FORMAT:
8677  */
8678   __pyx_v_info->readonly = 0;
8679 
8680   /* "View.MemoryView":202
8681  *         info.readonly = 0
8682  *
8683  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8684  *             info.format = self.format
8685  *         else:
8686  */
8687   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8688   if (__pyx_t_1) {
8689 
8690     /* "View.MemoryView":203
8691  *
8692  *         if flags & PyBUF_FORMAT:
8693  *             info.format = self.format             # <<<<<<<<<<<<<<
8694  *         else:
8695  *             info.format = NULL
8696  */
8697     __pyx_t_4 = __pyx_v_self->format;
8698     __pyx_v_info->format = __pyx_t_4;
8699 
8700     /* "View.MemoryView":202
8701  *         info.readonly = 0
8702  *
8703  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
8704  *             info.format = self.format
8705  *         else:
8706  */
8707     goto __pyx_L5;
8708   }
8709 
8710   /* "View.MemoryView":205
8711  *             info.format = self.format
8712  *         else:
8713  *             info.format = NULL             # <<<<<<<<<<<<<<
8714  *
8715  *         info.obj = self
8716  */
8717   /*else*/ {
8718     __pyx_v_info->format = NULL;
8719   }
8720   __pyx_L5:;
8721 
8722   /* "View.MemoryView":207
8723  *             info.format = NULL
8724  *
8725  *         info.obj = self             # <<<<<<<<<<<<<<
8726  *
8727  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8728  */
8729   __Pyx_INCREF(((PyObject *)__pyx_v_self));
8730   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8731   __Pyx_GOTREF(__pyx_v_info->obj);
8732   __Pyx_DECREF(__pyx_v_info->obj);
8733   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8734 
8735   /* "View.MemoryView":185
8736  *
8737  *     @cname('getbuffer')
8738  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
8739  *         cdef int bufmode = -1
8740  *         if self.mode == u"c":
8741  */
8742 
8743   /* function exit code */
8744   __pyx_r = 0;
8745   goto __pyx_L0;
8746   __pyx_L1_error:;
8747   __Pyx_XDECREF(__pyx_t_3);
8748   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8749   __pyx_r = -1;
8750   if (__pyx_v_info->obj != NULL) {
8751     __Pyx_GOTREF(__pyx_v_info->obj);
8752     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8753   }
8754   goto __pyx_L2;
8755   __pyx_L0:;
8756   if (__pyx_v_info->obj == Py_None) {
8757     __Pyx_GOTREF(__pyx_v_info->obj);
8758     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8759   }
8760   __pyx_L2:;
8761   __Pyx_RefNannyFinishContext();
8762   return __pyx_r;
8763 }
8764 
8765 /* "View.MemoryView":211
8766  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8767  *
8768  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
8769  *         if self.callback_free_data != NULL:
8770  *             self.callback_free_data(self.data)
8771  */
8772 
8773 /* Python wrapper */
8774 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)8775 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8776   __Pyx_RefNannyDeclarations
8777   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8778   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8779 
8780   /* function exit code */
8781   __Pyx_RefNannyFinishContext();
8782 }
8783 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)8784 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8785   __Pyx_RefNannyDeclarations
8786   int __pyx_t_1;
8787   __Pyx_RefNannySetupContext("__dealloc__", 0);
8788 
8789   /* "View.MemoryView":212
8790  *
8791  *     def __dealloc__(array self):
8792  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
8793  *             self.callback_free_data(self.data)
8794  *         elif self.free_data:
8795  */
8796   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8797   if (__pyx_t_1) {
8798 
8799     /* "View.MemoryView":213
8800  *     def __dealloc__(array self):
8801  *         if self.callback_free_data != NULL:
8802  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
8803  *         elif self.free_data:
8804  *             if self.dtype_is_object:
8805  */
8806     __pyx_v_self->callback_free_data(__pyx_v_self->data);
8807 
8808     /* "View.MemoryView":212
8809  *
8810  *     def __dealloc__(array self):
8811  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
8812  *             self.callback_free_data(self.data)
8813  *         elif self.free_data:
8814  */
8815     goto __pyx_L3;
8816   }
8817 
8818   /* "View.MemoryView":214
8819  *         if self.callback_free_data != NULL:
8820  *             self.callback_free_data(self.data)
8821  *         elif self.free_data:             # <<<<<<<<<<<<<<
8822  *             if self.dtype_is_object:
8823  *                 refcount_objects_in_slice(self.data, self._shape,
8824  */
8825   __pyx_t_1 = (__pyx_v_self->free_data != 0);
8826   if (__pyx_t_1) {
8827 
8828     /* "View.MemoryView":215
8829  *             self.callback_free_data(self.data)
8830  *         elif self.free_data:
8831  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
8832  *                 refcount_objects_in_slice(self.data, self._shape,
8833  *                                           self._strides, self.ndim, False)
8834  */
8835     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8836     if (__pyx_t_1) {
8837 
8838       /* "View.MemoryView":216
8839  *         elif self.free_data:
8840  *             if self.dtype_is_object:
8841  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
8842  *                                           self._strides, self.ndim, False)
8843  *             free(self.data)
8844  */
8845       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8846 
8847       /* "View.MemoryView":215
8848  *             self.callback_free_data(self.data)
8849  *         elif self.free_data:
8850  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
8851  *                 refcount_objects_in_slice(self.data, self._shape,
8852  *                                           self._strides, self.ndim, False)
8853  */
8854     }
8855 
8856     /* "View.MemoryView":218
8857  *                 refcount_objects_in_slice(self.data, self._shape,
8858  *                                           self._strides, self.ndim, False)
8859  *             free(self.data)             # <<<<<<<<<<<<<<
8860  *         PyObject_Free(self._shape)
8861  *
8862  */
8863     free(__pyx_v_self->data);
8864 
8865     /* "View.MemoryView":214
8866  *         if self.callback_free_data != NULL:
8867  *             self.callback_free_data(self.data)
8868  *         elif self.free_data:             # <<<<<<<<<<<<<<
8869  *             if self.dtype_is_object:
8870  *                 refcount_objects_in_slice(self.data, self._shape,
8871  */
8872   }
8873   __pyx_L3:;
8874 
8875   /* "View.MemoryView":219
8876  *                                           self._strides, self.ndim, False)
8877  *             free(self.data)
8878  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
8879  *
8880  *     @property
8881  */
8882   PyObject_Free(__pyx_v_self->_shape);
8883 
8884   /* "View.MemoryView":211
8885  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8886  *
8887  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
8888  *         if self.callback_free_data != NULL:
8889  *             self.callback_free_data(self.data)
8890  */
8891 
8892   /* function exit code */
8893   __Pyx_RefNannyFinishContext();
8894 }
8895 
8896 /* "View.MemoryView":222
8897  *
8898  *     @property
8899  *     def memview(self):             # <<<<<<<<<<<<<<
8900  *         return self.get_memview()
8901  *
8902  */
8903 
8904 /* Python wrapper */
8905 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)8906 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8907   PyObject *__pyx_r = 0;
8908   __Pyx_RefNannyDeclarations
8909   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8910   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8911 
8912   /* function exit code */
8913   __Pyx_RefNannyFinishContext();
8914   return __pyx_r;
8915 }
8916 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)8917 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8918   PyObject *__pyx_r = NULL;
8919   __Pyx_RefNannyDeclarations
8920   PyObject *__pyx_t_1 = NULL;
8921   __Pyx_RefNannySetupContext("__get__", 0);
8922 
8923   /* "View.MemoryView":223
8924  *     @property
8925  *     def memview(self):
8926  *         return self.get_memview()             # <<<<<<<<<<<<<<
8927  *
8928  *     @cname('get_memview')
8929  */
8930   __Pyx_XDECREF(__pyx_r);
8931   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 223, __pyx_L1_error)
8932   __Pyx_GOTREF(__pyx_t_1);
8933   __pyx_r = __pyx_t_1;
8934   __pyx_t_1 = 0;
8935   goto __pyx_L0;
8936 
8937   /* "View.MemoryView":222
8938  *
8939  *     @property
8940  *     def memview(self):             # <<<<<<<<<<<<<<
8941  *         return self.get_memview()
8942  *
8943  */
8944 
8945   /* function exit code */
8946   __pyx_L1_error:;
8947   __Pyx_XDECREF(__pyx_t_1);
8948   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8949   __pyx_r = NULL;
8950   __pyx_L0:;
8951   __Pyx_XGIVEREF(__pyx_r);
8952   __Pyx_RefNannyFinishContext();
8953   return __pyx_r;
8954 }
8955 
8956 /* "View.MemoryView":226
8957  *
8958  *     @cname('get_memview')
8959  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
8960  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8961  *         return  memoryview(self, flags, self.dtype_is_object)
8962  */
8963 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)8964 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8965   int __pyx_v_flags;
8966   PyObject *__pyx_r = NULL;
8967   __Pyx_RefNannyDeclarations
8968   PyObject *__pyx_t_1 = NULL;
8969   PyObject *__pyx_t_2 = NULL;
8970   PyObject *__pyx_t_3 = NULL;
8971   __Pyx_RefNannySetupContext("get_memview", 0);
8972 
8973   /* "View.MemoryView":227
8974  *     @cname('get_memview')
8975  *     cdef get_memview(self):
8976  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
8977  *         return  memoryview(self, flags, self.dtype_is_object)
8978  *
8979  */
8980   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8981 
8982   /* "View.MemoryView":228
8983  *     cdef get_memview(self):
8984  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8985  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
8986  *
8987  *     def __len__(self):
8988  */
8989   __Pyx_XDECREF(__pyx_r);
8990   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 228, __pyx_L1_error)
8991   __Pyx_GOTREF(__pyx_t_1);
8992   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error)
8993   __Pyx_GOTREF(__pyx_t_2);
8994   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 228, __pyx_L1_error)
8995   __Pyx_GOTREF(__pyx_t_3);
8996   __Pyx_INCREF(((PyObject *)__pyx_v_self));
8997   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8998   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8999   __Pyx_GIVEREF(__pyx_t_1);
9000   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9001   __Pyx_GIVEREF(__pyx_t_2);
9002   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9003   __pyx_t_1 = 0;
9004   __pyx_t_2 = 0;
9005   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error)
9006   __Pyx_GOTREF(__pyx_t_2);
9007   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9008   __pyx_r = __pyx_t_2;
9009   __pyx_t_2 = 0;
9010   goto __pyx_L0;
9011 
9012   /* "View.MemoryView":226
9013  *
9014  *     @cname('get_memview')
9015  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
9016  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9017  *         return  memoryview(self, flags, self.dtype_is_object)
9018  */
9019 
9020   /* function exit code */
9021   __pyx_L1_error:;
9022   __Pyx_XDECREF(__pyx_t_1);
9023   __Pyx_XDECREF(__pyx_t_2);
9024   __Pyx_XDECREF(__pyx_t_3);
9025   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9026   __pyx_r = 0;
9027   __pyx_L0:;
9028   __Pyx_XGIVEREF(__pyx_r);
9029   __Pyx_RefNannyFinishContext();
9030   return __pyx_r;
9031 }
9032 
9033 /* "View.MemoryView":230
9034  *         return  memoryview(self, flags, self.dtype_is_object)
9035  *
9036  *     def __len__(self):             # <<<<<<<<<<<<<<
9037  *         return self._shape[0]
9038  *
9039  */
9040 
9041 /* Python wrapper */
9042 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)9043 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9044   Py_ssize_t __pyx_r;
9045   __Pyx_RefNannyDeclarations
9046   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9047   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9048 
9049   /* function exit code */
9050   __Pyx_RefNannyFinishContext();
9051   return __pyx_r;
9052 }
9053 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)9054 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9055   Py_ssize_t __pyx_r;
9056   __Pyx_RefNannyDeclarations
9057   __Pyx_RefNannySetupContext("__len__", 0);
9058 
9059   /* "View.MemoryView":231
9060  *
9061  *     def __len__(self):
9062  *         return self._shape[0]             # <<<<<<<<<<<<<<
9063  *
9064  *     def __getattr__(self, attr):
9065  */
9066   __pyx_r = (__pyx_v_self->_shape[0]);
9067   goto __pyx_L0;
9068 
9069   /* "View.MemoryView":230
9070  *         return  memoryview(self, flags, self.dtype_is_object)
9071  *
9072  *     def __len__(self):             # <<<<<<<<<<<<<<
9073  *         return self._shape[0]
9074  *
9075  */
9076 
9077   /* function exit code */
9078   __pyx_L0:;
9079   __Pyx_RefNannyFinishContext();
9080   return __pyx_r;
9081 }
9082 
9083 /* "View.MemoryView":233
9084  *         return self._shape[0]
9085  *
9086  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
9087  *         return getattr(self.memview, attr)
9088  *
9089  */
9090 
9091 /* Python wrapper */
9092 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)9093 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9094   PyObject *__pyx_r = 0;
9095   __Pyx_RefNannyDeclarations
9096   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9097   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9098 
9099   /* function exit code */
9100   __Pyx_RefNannyFinishContext();
9101   return __pyx_r;
9102 }
9103 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)9104 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9105   PyObject *__pyx_r = NULL;
9106   __Pyx_RefNannyDeclarations
9107   PyObject *__pyx_t_1 = NULL;
9108   PyObject *__pyx_t_2 = NULL;
9109   __Pyx_RefNannySetupContext("__getattr__", 0);
9110 
9111   /* "View.MemoryView":234
9112  *
9113  *     def __getattr__(self, attr):
9114  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
9115  *
9116  *     def __getitem__(self, item):
9117  */
9118   __Pyx_XDECREF(__pyx_r);
9119   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 234, __pyx_L1_error)
9120   __Pyx_GOTREF(__pyx_t_1);
9121   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 234, __pyx_L1_error)
9122   __Pyx_GOTREF(__pyx_t_2);
9123   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9124   __pyx_r = __pyx_t_2;
9125   __pyx_t_2 = 0;
9126   goto __pyx_L0;
9127 
9128   /* "View.MemoryView":233
9129  *         return self._shape[0]
9130  *
9131  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
9132  *         return getattr(self.memview, attr)
9133  *
9134  */
9135 
9136   /* function exit code */
9137   __pyx_L1_error:;
9138   __Pyx_XDECREF(__pyx_t_1);
9139   __Pyx_XDECREF(__pyx_t_2);
9140   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9141   __pyx_r = NULL;
9142   __pyx_L0:;
9143   __Pyx_XGIVEREF(__pyx_r);
9144   __Pyx_RefNannyFinishContext();
9145   return __pyx_r;
9146 }
9147 
9148 /* "View.MemoryView":236
9149  *         return getattr(self.memview, attr)
9150  *
9151  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
9152  *         return self.memview[item]
9153  *
9154  */
9155 
9156 /* Python wrapper */
9157 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)9158 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9159   PyObject *__pyx_r = 0;
9160   __Pyx_RefNannyDeclarations
9161   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9162   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9163 
9164   /* function exit code */
9165   __Pyx_RefNannyFinishContext();
9166   return __pyx_r;
9167 }
9168 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)9169 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9170   PyObject *__pyx_r = NULL;
9171   __Pyx_RefNannyDeclarations
9172   PyObject *__pyx_t_1 = NULL;
9173   PyObject *__pyx_t_2 = NULL;
9174   __Pyx_RefNannySetupContext("__getitem__", 0);
9175 
9176   /* "View.MemoryView":237
9177  *
9178  *     def __getitem__(self, item):
9179  *         return self.memview[item]             # <<<<<<<<<<<<<<
9180  *
9181  *     def __setitem__(self, item, value):
9182  */
9183   __Pyx_XDECREF(__pyx_r);
9184   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 237, __pyx_L1_error)
9185   __Pyx_GOTREF(__pyx_t_1);
9186   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 237, __pyx_L1_error)
9187   __Pyx_GOTREF(__pyx_t_2);
9188   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9189   __pyx_r = __pyx_t_2;
9190   __pyx_t_2 = 0;
9191   goto __pyx_L0;
9192 
9193   /* "View.MemoryView":236
9194  *         return getattr(self.memview, attr)
9195  *
9196  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
9197  *         return self.memview[item]
9198  *
9199  */
9200 
9201   /* function exit code */
9202   __pyx_L1_error:;
9203   __Pyx_XDECREF(__pyx_t_1);
9204   __Pyx_XDECREF(__pyx_t_2);
9205   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9206   __pyx_r = NULL;
9207   __pyx_L0:;
9208   __Pyx_XGIVEREF(__pyx_r);
9209   __Pyx_RefNannyFinishContext();
9210   return __pyx_r;
9211 }
9212 
9213 /* "View.MemoryView":239
9214  *         return self.memview[item]
9215  *
9216  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
9217  *         self.memview[item] = value
9218  *
9219  */
9220 
9221 /* Python wrapper */
9222 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)9223 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9224   int __pyx_r;
9225   __Pyx_RefNannyDeclarations
9226   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9227   __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));
9228 
9229   /* function exit code */
9230   __Pyx_RefNannyFinishContext();
9231   return __pyx_r;
9232 }
9233 
__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)9234 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) {
9235   int __pyx_r;
9236   __Pyx_RefNannyDeclarations
9237   PyObject *__pyx_t_1 = NULL;
9238   __Pyx_RefNannySetupContext("__setitem__", 0);
9239 
9240   /* "View.MemoryView":240
9241  *
9242  *     def __setitem__(self, item, value):
9243  *         self.memview[item] = value             # <<<<<<<<<<<<<<
9244  *
9245  *
9246  */
9247   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 240, __pyx_L1_error)
9248   __Pyx_GOTREF(__pyx_t_1);
9249   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(3, 240, __pyx_L1_error)
9250   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9251 
9252   /* "View.MemoryView":239
9253  *         return self.memview[item]
9254  *
9255  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
9256  *         self.memview[item] = value
9257  *
9258  */
9259 
9260   /* function exit code */
9261   __pyx_r = 0;
9262   goto __pyx_L0;
9263   __pyx_L1_error:;
9264   __Pyx_XDECREF(__pyx_t_1);
9265   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9266   __pyx_r = -1;
9267   __pyx_L0:;
9268   __Pyx_RefNannyFinishContext();
9269   return __pyx_r;
9270 }
9271 
9272 /* "(tree fragment)":1
9273  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9274  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9275  * def __setstate_cython__(self, __pyx_state):
9276  */
9277 
9278 /* Python wrapper */
9279 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)9280 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9281   PyObject *__pyx_r = 0;
9282   __Pyx_RefNannyDeclarations
9283   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9284   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9285 
9286   /* function exit code */
9287   __Pyx_RefNannyFinishContext();
9288   return __pyx_r;
9289 }
9290 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)9291 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9292   PyObject *__pyx_r = NULL;
9293   __Pyx_RefNannyDeclarations
9294   PyObject *__pyx_t_1 = NULL;
9295   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9296 
9297   /* "(tree fragment)":2
9298  * def __reduce_cython__(self):
9299  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
9300  * def __setstate_cython__(self, __pyx_state):
9301  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9302  */
9303   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error)
9304   __Pyx_GOTREF(__pyx_t_1);
9305   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9306   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9307   __PYX_ERR(3, 2, __pyx_L1_error)
9308 
9309   /* "(tree fragment)":1
9310  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9311  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9312  * def __setstate_cython__(self, __pyx_state):
9313  */
9314 
9315   /* function exit code */
9316   __pyx_L1_error:;
9317   __Pyx_XDECREF(__pyx_t_1);
9318   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9319   __pyx_r = NULL;
9320   __Pyx_XGIVEREF(__pyx_r);
9321   __Pyx_RefNannyFinishContext();
9322   return __pyx_r;
9323 }
9324 
9325 /* "(tree fragment)":3
9326  * def __reduce_cython__(self):
9327  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9328  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9329  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9330  */
9331 
9332 /* Python wrapper */
9333 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)9334 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9335   PyObject *__pyx_r = 0;
9336   __Pyx_RefNannyDeclarations
9337   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9338   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9339 
9340   /* function exit code */
9341   __Pyx_RefNannyFinishContext();
9342   return __pyx_r;
9343 }
9344 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)9345 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) {
9346   PyObject *__pyx_r = NULL;
9347   __Pyx_RefNannyDeclarations
9348   PyObject *__pyx_t_1 = NULL;
9349   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9350 
9351   /* "(tree fragment)":4
9352  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9353  * def __setstate_cython__(self, __pyx_state):
9354  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
9355  */
9356   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
9357   __Pyx_GOTREF(__pyx_t_1);
9358   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9359   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9360   __PYX_ERR(3, 4, __pyx_L1_error)
9361 
9362   /* "(tree fragment)":3
9363  * def __reduce_cython__(self):
9364  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9365  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9366  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9367  */
9368 
9369   /* function exit code */
9370   __pyx_L1_error:;
9371   __Pyx_XDECREF(__pyx_t_1);
9372   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9373   __pyx_r = NULL;
9374   __Pyx_XGIVEREF(__pyx_r);
9375   __Pyx_RefNannyFinishContext();
9376   return __pyx_r;
9377 }
9378 
9379 /* "View.MemoryView":244
9380  *
9381  * @cname("__pyx_array_new")
9382  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
9383  *                           char *mode, char *buf):
9384  *     cdef array result
9385  */
9386 
__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)9387 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) {
9388   struct __pyx_array_obj *__pyx_v_result = 0;
9389   struct __pyx_array_obj *__pyx_r = NULL;
9390   __Pyx_RefNannyDeclarations
9391   int __pyx_t_1;
9392   PyObject *__pyx_t_2 = NULL;
9393   PyObject *__pyx_t_3 = NULL;
9394   PyObject *__pyx_t_4 = NULL;
9395   PyObject *__pyx_t_5 = NULL;
9396   __Pyx_RefNannySetupContext("array_cwrapper", 0);
9397 
9398   /* "View.MemoryView":248
9399  *     cdef array result
9400  *
9401  *     if buf == NULL:             # <<<<<<<<<<<<<<
9402  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
9403  *     else:
9404  */
9405   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9406   if (__pyx_t_1) {
9407 
9408     /* "View.MemoryView":249
9409  *
9410  *     if buf == NULL:
9411  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
9412  *     else:
9413  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
9414  */
9415     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 249, __pyx_L1_error)
9416     __Pyx_GOTREF(__pyx_t_2);
9417     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 249, __pyx_L1_error)
9418     __Pyx_GOTREF(__pyx_t_3);
9419     __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(3, 249, __pyx_L1_error)
9420     __Pyx_GOTREF(__pyx_t_4);
9421     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 249, __pyx_L1_error)
9422     __Pyx_GOTREF(__pyx_t_5);
9423     __Pyx_INCREF(__pyx_v_shape);
9424     __Pyx_GIVEREF(__pyx_v_shape);
9425     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9426     __Pyx_GIVEREF(__pyx_t_2);
9427     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9428     __Pyx_GIVEREF(__pyx_t_3);
9429     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9430     __Pyx_GIVEREF(__pyx_t_4);
9431     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9432     __pyx_t_2 = 0;
9433     __pyx_t_3 = 0;
9434     __pyx_t_4 = 0;
9435     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 249, __pyx_L1_error)
9436     __Pyx_GOTREF(__pyx_t_4);
9437     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9438     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9439     __pyx_t_4 = 0;
9440 
9441     /* "View.MemoryView":248
9442  *     cdef array result
9443  *
9444  *     if buf == NULL:             # <<<<<<<<<<<<<<
9445  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
9446  *     else:
9447  */
9448     goto __pyx_L3;
9449   }
9450 
9451   /* "View.MemoryView":251
9452  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
9453  *     else:
9454  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
9455  *                        allocate_buffer=False)
9456  *         result.data = buf
9457  */
9458   /*else*/ {
9459     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 251, __pyx_L1_error)
9460     __Pyx_GOTREF(__pyx_t_4);
9461     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 251, __pyx_L1_error)
9462     __Pyx_GOTREF(__pyx_t_5);
9463     __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(3, 251, __pyx_L1_error)
9464     __Pyx_GOTREF(__pyx_t_3);
9465     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error)
9466     __Pyx_GOTREF(__pyx_t_2);
9467     __Pyx_INCREF(__pyx_v_shape);
9468     __Pyx_GIVEREF(__pyx_v_shape);
9469     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9470     __Pyx_GIVEREF(__pyx_t_4);
9471     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9472     __Pyx_GIVEREF(__pyx_t_5);
9473     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9474     __Pyx_GIVEREF(__pyx_t_3);
9475     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9476     __pyx_t_4 = 0;
9477     __pyx_t_5 = 0;
9478     __pyx_t_3 = 0;
9479 
9480     /* "View.MemoryView":252
9481  *     else:
9482  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
9483  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
9484  *         result.data = buf
9485  *
9486  */
9487     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 252, __pyx_L1_error)
9488     __Pyx_GOTREF(__pyx_t_3);
9489     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(3, 252, __pyx_L1_error)
9490 
9491     /* "View.MemoryView":251
9492  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
9493  *     else:
9494  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
9495  *                        allocate_buffer=False)
9496  *         result.data = buf
9497  */
9498     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 251, __pyx_L1_error)
9499     __Pyx_GOTREF(__pyx_t_5);
9500     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9501     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9502     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9503     __pyx_t_5 = 0;
9504 
9505     /* "View.MemoryView":253
9506  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
9507  *                        allocate_buffer=False)
9508  *         result.data = buf             # <<<<<<<<<<<<<<
9509  *
9510  *     return result
9511  */
9512     __pyx_v_result->data = __pyx_v_buf;
9513   }
9514   __pyx_L3:;
9515 
9516   /* "View.MemoryView":255
9517  *         result.data = buf
9518  *
9519  *     return result             # <<<<<<<<<<<<<<
9520  *
9521  *
9522  */
9523   __Pyx_XDECREF(((PyObject *)__pyx_r));
9524   __Pyx_INCREF(((PyObject *)__pyx_v_result));
9525   __pyx_r = __pyx_v_result;
9526   goto __pyx_L0;
9527 
9528   /* "View.MemoryView":244
9529  *
9530  * @cname("__pyx_array_new")
9531  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
9532  *                           char *mode, char *buf):
9533  *     cdef array result
9534  */
9535 
9536   /* function exit code */
9537   __pyx_L1_error:;
9538   __Pyx_XDECREF(__pyx_t_2);
9539   __Pyx_XDECREF(__pyx_t_3);
9540   __Pyx_XDECREF(__pyx_t_4);
9541   __Pyx_XDECREF(__pyx_t_5);
9542   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9543   __pyx_r = 0;
9544   __pyx_L0:;
9545   __Pyx_XDECREF((PyObject *)__pyx_v_result);
9546   __Pyx_XGIVEREF((PyObject *)__pyx_r);
9547   __Pyx_RefNannyFinishContext();
9548   return __pyx_r;
9549 }
9550 
9551 /* "View.MemoryView":281
9552  * cdef class Enum(object):
9553  *     cdef object name
9554  *     def __init__(self, name):             # <<<<<<<<<<<<<<
9555  *         self.name = name
9556  *     def __repr__(self):
9557  */
9558 
9559 /* Python wrapper */
9560 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)9561 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9562   PyObject *__pyx_v_name = 0;
9563   int __pyx_r;
9564   __Pyx_RefNannyDeclarations
9565   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9566   {
9567     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9568     PyObject* values[1] = {0};
9569     if (unlikely(__pyx_kwds)) {
9570       Py_ssize_t kw_args;
9571       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9572       switch (pos_args) {
9573         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9574         CYTHON_FALLTHROUGH;
9575         case  0: break;
9576         default: goto __pyx_L5_argtuple_error;
9577       }
9578       kw_args = PyDict_Size(__pyx_kwds);
9579       switch (pos_args) {
9580         case  0:
9581         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9582         else goto __pyx_L5_argtuple_error;
9583       }
9584       if (unlikely(kw_args > 0)) {
9585         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(3, 281, __pyx_L3_error)
9586       }
9587     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9588       goto __pyx_L5_argtuple_error;
9589     } else {
9590       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9591     }
9592     __pyx_v_name = values[0];
9593   }
9594   goto __pyx_L4_argument_unpacking_done;
9595   __pyx_L5_argtuple_error:;
9596   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 281, __pyx_L3_error)
9597   __pyx_L3_error:;
9598   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9599   __Pyx_RefNannyFinishContext();
9600   return -1;
9601   __pyx_L4_argument_unpacking_done:;
9602   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9603 
9604   /* function exit code */
9605   __Pyx_RefNannyFinishContext();
9606   return __pyx_r;
9607 }
9608 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)9609 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9610   int __pyx_r;
9611   __Pyx_RefNannyDeclarations
9612   __Pyx_RefNannySetupContext("__init__", 0);
9613 
9614   /* "View.MemoryView":282
9615  *     cdef object name
9616  *     def __init__(self, name):
9617  *         self.name = name             # <<<<<<<<<<<<<<
9618  *     def __repr__(self):
9619  *         return self.name
9620  */
9621   __Pyx_INCREF(__pyx_v_name);
9622   __Pyx_GIVEREF(__pyx_v_name);
9623   __Pyx_GOTREF(__pyx_v_self->name);
9624   __Pyx_DECREF(__pyx_v_self->name);
9625   __pyx_v_self->name = __pyx_v_name;
9626 
9627   /* "View.MemoryView":281
9628  * cdef class Enum(object):
9629  *     cdef object name
9630  *     def __init__(self, name):             # <<<<<<<<<<<<<<
9631  *         self.name = name
9632  *     def __repr__(self):
9633  */
9634 
9635   /* function exit code */
9636   __pyx_r = 0;
9637   __Pyx_RefNannyFinishContext();
9638   return __pyx_r;
9639 }
9640 
9641 /* "View.MemoryView":283
9642  *     def __init__(self, name):
9643  *         self.name = name
9644  *     def __repr__(self):             # <<<<<<<<<<<<<<
9645  *         return self.name
9646  *
9647  */
9648 
9649 /* Python wrapper */
9650 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)9651 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9652   PyObject *__pyx_r = 0;
9653   __Pyx_RefNannyDeclarations
9654   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9655   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9656 
9657   /* function exit code */
9658   __Pyx_RefNannyFinishContext();
9659   return __pyx_r;
9660 }
9661 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)9662 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9663   PyObject *__pyx_r = NULL;
9664   __Pyx_RefNannyDeclarations
9665   __Pyx_RefNannySetupContext("__repr__", 0);
9666 
9667   /* "View.MemoryView":284
9668  *         self.name = name
9669  *     def __repr__(self):
9670  *         return self.name             # <<<<<<<<<<<<<<
9671  *
9672  * cdef generic = Enum("<strided and direct or indirect>")
9673  */
9674   __Pyx_XDECREF(__pyx_r);
9675   __Pyx_INCREF(__pyx_v_self->name);
9676   __pyx_r = __pyx_v_self->name;
9677   goto __pyx_L0;
9678 
9679   /* "View.MemoryView":283
9680  *     def __init__(self, name):
9681  *         self.name = name
9682  *     def __repr__(self):             # <<<<<<<<<<<<<<
9683  *         return self.name
9684  *
9685  */
9686 
9687   /* function exit code */
9688   __pyx_L0:;
9689   __Pyx_XGIVEREF(__pyx_r);
9690   __Pyx_RefNannyFinishContext();
9691   return __pyx_r;
9692 }
9693 
9694 /* "(tree fragment)":1
9695  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9696  *     cdef tuple state
9697  *     cdef object _dict
9698  */
9699 
9700 /* Python wrapper */
9701 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)9702 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9703   PyObject *__pyx_r = 0;
9704   __Pyx_RefNannyDeclarations
9705   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9706   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9707 
9708   /* function exit code */
9709   __Pyx_RefNannyFinishContext();
9710   return __pyx_r;
9711 }
9712 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)9713 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9714   PyObject *__pyx_v_state = 0;
9715   PyObject *__pyx_v__dict = 0;
9716   int __pyx_v_use_setstate;
9717   PyObject *__pyx_r = NULL;
9718   __Pyx_RefNannyDeclarations
9719   PyObject *__pyx_t_1 = NULL;
9720   int __pyx_t_2;
9721   int __pyx_t_3;
9722   PyObject *__pyx_t_4 = NULL;
9723   PyObject *__pyx_t_5 = NULL;
9724   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9725 
9726   /* "(tree fragment)":5
9727  *     cdef object _dict
9728  *     cdef bint use_setstate
9729  *     state = (self.name,)             # <<<<<<<<<<<<<<
9730  *     _dict = getattr(self, '__dict__', None)
9731  *     if _dict is not None:
9732  */
9733   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
9734   __Pyx_GOTREF(__pyx_t_1);
9735   __Pyx_INCREF(__pyx_v_self->name);
9736   __Pyx_GIVEREF(__pyx_v_self->name);
9737   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9738   __pyx_v_state = ((PyObject*)__pyx_t_1);
9739   __pyx_t_1 = 0;
9740 
9741   /* "(tree fragment)":6
9742  *     cdef bint use_setstate
9743  *     state = (self.name,)
9744  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9745  *     if _dict is not None:
9746  *         state += (_dict,)
9747  */
9748   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6, __pyx_L1_error)
9749   __Pyx_GOTREF(__pyx_t_1);
9750   __pyx_v__dict = __pyx_t_1;
9751   __pyx_t_1 = 0;
9752 
9753   /* "(tree fragment)":7
9754  *     state = (self.name,)
9755  *     _dict = getattr(self, '__dict__', None)
9756  *     if _dict is not None:             # <<<<<<<<<<<<<<
9757  *         state += (_dict,)
9758  *         use_setstate = True
9759  */
9760   __pyx_t_2 = (__pyx_v__dict != Py_None);
9761   __pyx_t_3 = (__pyx_t_2 != 0);
9762   if (__pyx_t_3) {
9763 
9764     /* "(tree fragment)":8
9765  *     _dict = getattr(self, '__dict__', None)
9766  *     if _dict is not None:
9767  *         state += (_dict,)             # <<<<<<<<<<<<<<
9768  *         use_setstate = True
9769  *     else:
9770  */
9771     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
9772     __Pyx_GOTREF(__pyx_t_1);
9773     __Pyx_INCREF(__pyx_v__dict);
9774     __Pyx_GIVEREF(__pyx_v__dict);
9775     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9776     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8, __pyx_L1_error)
9777     __Pyx_GOTREF(__pyx_t_4);
9778     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9779     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9780     __pyx_t_4 = 0;
9781 
9782     /* "(tree fragment)":9
9783  *     if _dict is not None:
9784  *         state += (_dict,)
9785  *         use_setstate = True             # <<<<<<<<<<<<<<
9786  *     else:
9787  *         use_setstate = self.name is not None
9788  */
9789     __pyx_v_use_setstate = 1;
9790 
9791     /* "(tree fragment)":7
9792  *     state = (self.name,)
9793  *     _dict = getattr(self, '__dict__', None)
9794  *     if _dict is not None:             # <<<<<<<<<<<<<<
9795  *         state += (_dict,)
9796  *         use_setstate = True
9797  */
9798     goto __pyx_L3;
9799   }
9800 
9801   /* "(tree fragment)":11
9802  *         use_setstate = True
9803  *     else:
9804  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
9805  *     if use_setstate:
9806  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9807  */
9808   /*else*/ {
9809     __pyx_t_3 = (__pyx_v_self->name != Py_None);
9810     __pyx_v_use_setstate = __pyx_t_3;
9811   }
9812   __pyx_L3:;
9813 
9814   /* "(tree fragment)":12
9815  *     else:
9816  *         use_setstate = self.name is not None
9817  *     if use_setstate:             # <<<<<<<<<<<<<<
9818  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9819  *     else:
9820  */
9821   __pyx_t_3 = (__pyx_v_use_setstate != 0);
9822   if (__pyx_t_3) {
9823 
9824     /* "(tree fragment)":13
9825  *         use_setstate = self.name is not None
9826  *     if use_setstate:
9827  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
9828  *     else:
9829  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9830  */
9831     __Pyx_XDECREF(__pyx_r);
9832     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 13, __pyx_L1_error)
9833     __Pyx_GOTREF(__pyx_t_4);
9834     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
9835     __Pyx_GOTREF(__pyx_t_1);
9836     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9837     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9838     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9839     __Pyx_INCREF(__pyx_int_184977713);
9840     __Pyx_GIVEREF(__pyx_int_184977713);
9841     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9842     __Pyx_INCREF(Py_None);
9843     __Pyx_GIVEREF(Py_None);
9844     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9845     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 13, __pyx_L1_error)
9846     __Pyx_GOTREF(__pyx_t_5);
9847     __Pyx_GIVEREF(__pyx_t_4);
9848     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9849     __Pyx_GIVEREF(__pyx_t_1);
9850     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9851     __Pyx_INCREF(__pyx_v_state);
9852     __Pyx_GIVEREF(__pyx_v_state);
9853     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9854     __pyx_t_4 = 0;
9855     __pyx_t_1 = 0;
9856     __pyx_r = __pyx_t_5;
9857     __pyx_t_5 = 0;
9858     goto __pyx_L0;
9859 
9860     /* "(tree fragment)":12
9861  *     else:
9862  *         use_setstate = self.name is not None
9863  *     if use_setstate:             # <<<<<<<<<<<<<<
9864  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9865  *     else:
9866  */
9867   }
9868 
9869   /* "(tree fragment)":15
9870  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9871  *     else:
9872  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
9873  * def __setstate_cython__(self, __pyx_state):
9874  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
9875  */
9876   /*else*/ {
9877     __Pyx_XDECREF(__pyx_r);
9878     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 15, __pyx_L1_error)
9879     __Pyx_GOTREF(__pyx_t_5);
9880     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
9881     __Pyx_GOTREF(__pyx_t_1);
9882     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9883     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9884     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9885     __Pyx_INCREF(__pyx_int_184977713);
9886     __Pyx_GIVEREF(__pyx_int_184977713);
9887     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9888     __Pyx_INCREF(__pyx_v_state);
9889     __Pyx_GIVEREF(__pyx_v_state);
9890     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9891     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 15, __pyx_L1_error)
9892     __Pyx_GOTREF(__pyx_t_4);
9893     __Pyx_GIVEREF(__pyx_t_5);
9894     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9895     __Pyx_GIVEREF(__pyx_t_1);
9896     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9897     __pyx_t_5 = 0;
9898     __pyx_t_1 = 0;
9899     __pyx_r = __pyx_t_4;
9900     __pyx_t_4 = 0;
9901     goto __pyx_L0;
9902   }
9903 
9904   /* "(tree fragment)":1
9905  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9906  *     cdef tuple state
9907  *     cdef object _dict
9908  */
9909 
9910   /* function exit code */
9911   __pyx_L1_error:;
9912   __Pyx_XDECREF(__pyx_t_1);
9913   __Pyx_XDECREF(__pyx_t_4);
9914   __Pyx_XDECREF(__pyx_t_5);
9915   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9916   __pyx_r = NULL;
9917   __pyx_L0:;
9918   __Pyx_XDECREF(__pyx_v_state);
9919   __Pyx_XDECREF(__pyx_v__dict);
9920   __Pyx_XGIVEREF(__pyx_r);
9921   __Pyx_RefNannyFinishContext();
9922   return __pyx_r;
9923 }
9924 
9925 /* "(tree fragment)":16
9926  *     else:
9927  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9928  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9929  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
9930  */
9931 
9932 /* Python wrapper */
9933 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)9934 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9935   PyObject *__pyx_r = 0;
9936   __Pyx_RefNannyDeclarations
9937   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9938   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9939 
9940   /* function exit code */
9941   __Pyx_RefNannyFinishContext();
9942   return __pyx_r;
9943 }
9944 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)9945 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9946   PyObject *__pyx_r = NULL;
9947   __Pyx_RefNannyDeclarations
9948   PyObject *__pyx_t_1 = NULL;
9949   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9950 
9951   /* "(tree fragment)":17
9952  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9953  * def __setstate_cython__(self, __pyx_state):
9954  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
9955  */
9956   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(3, 17, __pyx_L1_error)
9957   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 17, __pyx_L1_error)
9958   __Pyx_GOTREF(__pyx_t_1);
9959   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9960 
9961   /* "(tree fragment)":16
9962  *     else:
9963  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9964  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9965  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
9966  */
9967 
9968   /* function exit code */
9969   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9970   goto __pyx_L0;
9971   __pyx_L1_error:;
9972   __Pyx_XDECREF(__pyx_t_1);
9973   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9974   __pyx_r = NULL;
9975   __pyx_L0:;
9976   __Pyx_XGIVEREF(__pyx_r);
9977   __Pyx_RefNannyFinishContext();
9978   return __pyx_r;
9979 }
9980 
9981 /* "View.MemoryView":298
9982  *
9983  * @cname('__pyx_align_pointer')
9984  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
9985  *     "Align pointer memory on a given boundary"
9986  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9987  */
9988 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)9989 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9990   Py_intptr_t __pyx_v_aligned_p;
9991   size_t __pyx_v_offset;
9992   void *__pyx_r;
9993   int __pyx_t_1;
9994 
9995   /* "View.MemoryView":300
9996  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9997  *     "Align pointer memory on a given boundary"
9998  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
9999  *     cdef size_t offset
10000  *
10001  */
10002   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10003 
10004   /* "View.MemoryView":304
10005  *
10006  *     with cython.cdivision(True):
10007  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
10008  *
10009  *     if offset > 0:
10010  */
10011   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10012 
10013   /* "View.MemoryView":306
10014  *         offset = aligned_p % alignment
10015  *
10016  *     if offset > 0:             # <<<<<<<<<<<<<<
10017  *         aligned_p += alignment - offset
10018  *
10019  */
10020   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10021   if (__pyx_t_1) {
10022 
10023     /* "View.MemoryView":307
10024  *
10025  *     if offset > 0:
10026  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
10027  *
10028  *     return <void *> aligned_p
10029  */
10030     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10031 
10032     /* "View.MemoryView":306
10033  *         offset = aligned_p % alignment
10034  *
10035  *     if offset > 0:             # <<<<<<<<<<<<<<
10036  *         aligned_p += alignment - offset
10037  *
10038  */
10039   }
10040 
10041   /* "View.MemoryView":309
10042  *         aligned_p += alignment - offset
10043  *
10044  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
10045  *
10046  *
10047  */
10048   __pyx_r = ((void *)__pyx_v_aligned_p);
10049   goto __pyx_L0;
10050 
10051   /* "View.MemoryView":298
10052  *
10053  * @cname('__pyx_align_pointer')
10054  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
10055  *     "Align pointer memory on a given boundary"
10056  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10057  */
10058 
10059   /* function exit code */
10060   __pyx_L0:;
10061   return __pyx_r;
10062 }
10063 
10064 /* "View.MemoryView":345
10065  *     cdef __Pyx_TypeInfo *typeinfo
10066  *
10067  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
10068  *         self.obj = obj
10069  *         self.flags = flags
10070  */
10071 
10072 /* Python wrapper */
10073 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)10074 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10075   PyObject *__pyx_v_obj = 0;
10076   int __pyx_v_flags;
10077   int __pyx_v_dtype_is_object;
10078   int __pyx_r;
10079   __Pyx_RefNannyDeclarations
10080   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10081   {
10082     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10083     PyObject* values[3] = {0,0,0};
10084     if (unlikely(__pyx_kwds)) {
10085       Py_ssize_t kw_args;
10086       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10087       switch (pos_args) {
10088         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10089         CYTHON_FALLTHROUGH;
10090         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10091         CYTHON_FALLTHROUGH;
10092         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10093         CYTHON_FALLTHROUGH;
10094         case  0: break;
10095         default: goto __pyx_L5_argtuple_error;
10096       }
10097       kw_args = PyDict_Size(__pyx_kwds);
10098       switch (pos_args) {
10099         case  0:
10100         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10101         else goto __pyx_L5_argtuple_error;
10102         CYTHON_FALLTHROUGH;
10103         case  1:
10104         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10105         else {
10106           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(3, 345, __pyx_L3_error)
10107         }
10108         CYTHON_FALLTHROUGH;
10109         case  2:
10110         if (kw_args > 0) {
10111           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10112           if (value) { values[2] = value; kw_args--; }
10113         }
10114       }
10115       if (unlikely(kw_args > 0)) {
10116         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 345, __pyx_L3_error)
10117       }
10118     } else {
10119       switch (PyTuple_GET_SIZE(__pyx_args)) {
10120         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10121         CYTHON_FALLTHROUGH;
10122         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10123         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10124         break;
10125         default: goto __pyx_L5_argtuple_error;
10126       }
10127     }
10128     __pyx_v_obj = values[0];
10129     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 345, __pyx_L3_error)
10130     if (values[2]) {
10131       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 345, __pyx_L3_error)
10132     } else {
10133       __pyx_v_dtype_is_object = ((int)0);
10134     }
10135   }
10136   goto __pyx_L4_argument_unpacking_done;
10137   __pyx_L5_argtuple_error:;
10138   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 345, __pyx_L3_error)
10139   __pyx_L3_error:;
10140   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10141   __Pyx_RefNannyFinishContext();
10142   return -1;
10143   __pyx_L4_argument_unpacking_done:;
10144   __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);
10145 
10146   /* function exit code */
10147   __Pyx_RefNannyFinishContext();
10148   return __pyx_r;
10149 }
10150 
__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)10151 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) {
10152   int __pyx_r;
10153   __Pyx_RefNannyDeclarations
10154   int __pyx_t_1;
10155   int __pyx_t_2;
10156   int __pyx_t_3;
10157   int __pyx_t_4;
10158   __Pyx_RefNannySetupContext("__cinit__", 0);
10159 
10160   /* "View.MemoryView":346
10161  *
10162  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10163  *         self.obj = obj             # <<<<<<<<<<<<<<
10164  *         self.flags = flags
10165  *         if type(self) is memoryview or obj is not None:
10166  */
10167   __Pyx_INCREF(__pyx_v_obj);
10168   __Pyx_GIVEREF(__pyx_v_obj);
10169   __Pyx_GOTREF(__pyx_v_self->obj);
10170   __Pyx_DECREF(__pyx_v_self->obj);
10171   __pyx_v_self->obj = __pyx_v_obj;
10172 
10173   /* "View.MemoryView":347
10174  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10175  *         self.obj = obj
10176  *         self.flags = flags             # <<<<<<<<<<<<<<
10177  *         if type(self) is memoryview or obj is not None:
10178  *             __Pyx_GetBuffer(obj, &self.view, flags)
10179  */
10180   __pyx_v_self->flags = __pyx_v_flags;
10181 
10182   /* "View.MemoryView":348
10183  *         self.obj = obj
10184  *         self.flags = flags
10185  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
10186  *             __Pyx_GetBuffer(obj, &self.view, flags)
10187  *             if <PyObject *> self.view.obj == NULL:
10188  */
10189   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10190   __pyx_t_3 = (__pyx_t_2 != 0);
10191   if (!__pyx_t_3) {
10192   } else {
10193     __pyx_t_1 = __pyx_t_3;
10194     goto __pyx_L4_bool_binop_done;
10195   }
10196   __pyx_t_3 = (__pyx_v_obj != Py_None);
10197   __pyx_t_2 = (__pyx_t_3 != 0);
10198   __pyx_t_1 = __pyx_t_2;
10199   __pyx_L4_bool_binop_done:;
10200   if (__pyx_t_1) {
10201 
10202     /* "View.MemoryView":349
10203  *         self.flags = flags
10204  *         if type(self) is memoryview or obj is not None:
10205  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
10206  *             if <PyObject *> self.view.obj == NULL:
10207  *                 (<__pyx_buffer *> &self.view).obj = Py_None
10208  */
10209     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 349, __pyx_L1_error)
10210 
10211     /* "View.MemoryView":350
10212  *         if type(self) is memoryview or obj is not None:
10213  *             __Pyx_GetBuffer(obj, &self.view, flags)
10214  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
10215  *                 (<__pyx_buffer *> &self.view).obj = Py_None
10216  *                 Py_INCREF(Py_None)
10217  */
10218     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10219     if (__pyx_t_1) {
10220 
10221       /* "View.MemoryView":351
10222  *             __Pyx_GetBuffer(obj, &self.view, flags)
10223  *             if <PyObject *> self.view.obj == NULL:
10224  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
10225  *                 Py_INCREF(Py_None)
10226  *
10227  */
10228       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10229 
10230       /* "View.MemoryView":352
10231  *             if <PyObject *> self.view.obj == NULL:
10232  *                 (<__pyx_buffer *> &self.view).obj = Py_None
10233  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
10234  *
10235  *         global __pyx_memoryview_thread_locks_used
10236  */
10237       Py_INCREF(Py_None);
10238 
10239       /* "View.MemoryView":350
10240  *         if type(self) is memoryview or obj is not None:
10241  *             __Pyx_GetBuffer(obj, &self.view, flags)
10242  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
10243  *                 (<__pyx_buffer *> &self.view).obj = Py_None
10244  *                 Py_INCREF(Py_None)
10245  */
10246     }
10247 
10248     /* "View.MemoryView":348
10249  *         self.obj = obj
10250  *         self.flags = flags
10251  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
10252  *             __Pyx_GetBuffer(obj, &self.view, flags)
10253  *             if <PyObject *> self.view.obj == NULL:
10254  */
10255   }
10256 
10257   /* "View.MemoryView":355
10258  *
10259  *         global __pyx_memoryview_thread_locks_used
10260  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
10261  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10262  *             __pyx_memoryview_thread_locks_used += 1
10263  */
10264   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10265   if (__pyx_t_1) {
10266 
10267     /* "View.MemoryView":356
10268  *         global __pyx_memoryview_thread_locks_used
10269  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10270  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
10271  *             __pyx_memoryview_thread_locks_used += 1
10272  *         if self.lock is NULL:
10273  */
10274     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10275 
10276     /* "View.MemoryView":357
10277  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10278  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10279  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
10280  *         if self.lock is NULL:
10281  *             self.lock = PyThread_allocate_lock()
10282  */
10283     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10284 
10285     /* "View.MemoryView":355
10286  *
10287  *         global __pyx_memoryview_thread_locks_used
10288  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
10289  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10290  *             __pyx_memoryview_thread_locks_used += 1
10291  */
10292   }
10293 
10294   /* "View.MemoryView":358
10295  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10296  *             __pyx_memoryview_thread_locks_used += 1
10297  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
10298  *             self.lock = PyThread_allocate_lock()
10299  *             if self.lock is NULL:
10300  */
10301   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10302   if (__pyx_t_1) {
10303 
10304     /* "View.MemoryView":359
10305  *             __pyx_memoryview_thread_locks_used += 1
10306  *         if self.lock is NULL:
10307  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
10308  *             if self.lock is NULL:
10309  *                 raise MemoryError
10310  */
10311     __pyx_v_self->lock = PyThread_allocate_lock();
10312 
10313     /* "View.MemoryView":360
10314  *         if self.lock is NULL:
10315  *             self.lock = PyThread_allocate_lock()
10316  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
10317  *                 raise MemoryError
10318  *
10319  */
10320     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10321     if (unlikely(__pyx_t_1)) {
10322 
10323       /* "View.MemoryView":361
10324  *             self.lock = PyThread_allocate_lock()
10325  *             if self.lock is NULL:
10326  *                 raise MemoryError             # <<<<<<<<<<<<<<
10327  *
10328  *         if flags & PyBUF_FORMAT:
10329  */
10330       PyErr_NoMemory(); __PYX_ERR(3, 361, __pyx_L1_error)
10331 
10332       /* "View.MemoryView":360
10333  *         if self.lock is NULL:
10334  *             self.lock = PyThread_allocate_lock()
10335  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
10336  *                 raise MemoryError
10337  *
10338  */
10339     }
10340 
10341     /* "View.MemoryView":358
10342  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10343  *             __pyx_memoryview_thread_locks_used += 1
10344  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
10345  *             self.lock = PyThread_allocate_lock()
10346  *             if self.lock is NULL:
10347  */
10348   }
10349 
10350   /* "View.MemoryView":363
10351  *                 raise MemoryError
10352  *
10353  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
10354  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10355  *         else:
10356  */
10357   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10358   if (__pyx_t_1) {
10359 
10360     /* "View.MemoryView":364
10361  *
10362  *         if flags & PyBUF_FORMAT:
10363  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
10364  *         else:
10365  *             self.dtype_is_object = dtype_is_object
10366  */
10367     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10368     if (__pyx_t_2) {
10369     } else {
10370       __pyx_t_1 = __pyx_t_2;
10371       goto __pyx_L11_bool_binop_done;
10372     }
10373     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10374     __pyx_t_1 = __pyx_t_2;
10375     __pyx_L11_bool_binop_done:;
10376     __pyx_v_self->dtype_is_object = __pyx_t_1;
10377 
10378     /* "View.MemoryView":363
10379  *                 raise MemoryError
10380  *
10381  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
10382  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10383  *         else:
10384  */
10385     goto __pyx_L10;
10386   }
10387 
10388   /* "View.MemoryView":366
10389  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10390  *         else:
10391  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
10392  *
10393  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10394  */
10395   /*else*/ {
10396     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10397   }
10398   __pyx_L10:;
10399 
10400   /* "View.MemoryView":368
10401  *             self.dtype_is_object = dtype_is_object
10402  *
10403  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
10404  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10405  *         self.typeinfo = NULL
10406  */
10407   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10408 
10409   /* "View.MemoryView":370
10410  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10411  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10412  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
10413  *
10414  *     def __dealloc__(memoryview self):
10415  */
10416   __pyx_v_self->typeinfo = NULL;
10417 
10418   /* "View.MemoryView":345
10419  *     cdef __Pyx_TypeInfo *typeinfo
10420  *
10421  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
10422  *         self.obj = obj
10423  *         self.flags = flags
10424  */
10425 
10426   /* function exit code */
10427   __pyx_r = 0;
10428   goto __pyx_L0;
10429   __pyx_L1_error:;
10430   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10431   __pyx_r = -1;
10432   __pyx_L0:;
10433   __Pyx_RefNannyFinishContext();
10434   return __pyx_r;
10435 }
10436 
10437 /* "View.MemoryView":372
10438  *         self.typeinfo = NULL
10439  *
10440  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
10441  *         if self.obj is not None:
10442  *             __Pyx_ReleaseBuffer(&self.view)
10443  */
10444 
10445 /* Python wrapper */
10446 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)10447 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10448   __Pyx_RefNannyDeclarations
10449   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10450   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10451 
10452   /* function exit code */
10453   __Pyx_RefNannyFinishContext();
10454 }
10455 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)10456 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10457   int __pyx_v_i;
10458   __Pyx_RefNannyDeclarations
10459   int __pyx_t_1;
10460   int __pyx_t_2;
10461   int __pyx_t_3;
10462   int __pyx_t_4;
10463   int __pyx_t_5;
10464   PyThread_type_lock __pyx_t_6;
10465   PyThread_type_lock __pyx_t_7;
10466   __Pyx_RefNannySetupContext("__dealloc__", 0);
10467 
10468   /* "View.MemoryView":373
10469  *
10470  *     def __dealloc__(memoryview self):
10471  *         if self.obj is not None:             # <<<<<<<<<<<<<<
10472  *             __Pyx_ReleaseBuffer(&self.view)
10473  *
10474  */
10475   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10476   __pyx_t_2 = (__pyx_t_1 != 0);
10477   if (__pyx_t_2) {
10478 
10479     /* "View.MemoryView":374
10480  *     def __dealloc__(memoryview self):
10481  *         if self.obj is not None:
10482  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
10483  *
10484  *         cdef int i
10485  */
10486     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10487 
10488     /* "View.MemoryView":373
10489  *
10490  *     def __dealloc__(memoryview self):
10491  *         if self.obj is not None:             # <<<<<<<<<<<<<<
10492  *             __Pyx_ReleaseBuffer(&self.view)
10493  *
10494  */
10495   }
10496 
10497   /* "View.MemoryView":378
10498  *         cdef int i
10499  *         global __pyx_memoryview_thread_locks_used
10500  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
10501  *             for i in range(__pyx_memoryview_thread_locks_used):
10502  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10503  */
10504   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10505   if (__pyx_t_2) {
10506 
10507     /* "View.MemoryView":379
10508  *         global __pyx_memoryview_thread_locks_used
10509  *         if self.lock != NULL:
10510  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
10511  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10512  *                     __pyx_memoryview_thread_locks_used -= 1
10513  */
10514     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10515     __pyx_t_4 = __pyx_t_3;
10516     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10517       __pyx_v_i = __pyx_t_5;
10518 
10519       /* "View.MemoryView":380
10520  *         if self.lock != NULL:
10521  *             for i in range(__pyx_memoryview_thread_locks_used):
10522  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
10523  *                     __pyx_memoryview_thread_locks_used -= 1
10524  *                     if i != __pyx_memoryview_thread_locks_used:
10525  */
10526       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10527       if (__pyx_t_2) {
10528 
10529         /* "View.MemoryView":381
10530  *             for i in range(__pyx_memoryview_thread_locks_used):
10531  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10532  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
10533  *                     if i != __pyx_memoryview_thread_locks_used:
10534  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10535  */
10536         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10537 
10538         /* "View.MemoryView":382
10539  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10540  *                     __pyx_memoryview_thread_locks_used -= 1
10541  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
10542  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10543  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10544  */
10545         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10546         if (__pyx_t_2) {
10547 
10548           /* "View.MemoryView":384
10549  *                     if i != __pyx_memoryview_thread_locks_used:
10550  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10551  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
10552  *                     break
10553  *             else:
10554  */
10555           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10556           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10557 
10558           /* "View.MemoryView":383
10559  *                     __pyx_memoryview_thread_locks_used -= 1
10560  *                     if i != __pyx_memoryview_thread_locks_used:
10561  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
10562  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10563  *                     break
10564  */
10565           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10566           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10567 
10568           /* "View.MemoryView":382
10569  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10570  *                     __pyx_memoryview_thread_locks_used -= 1
10571  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
10572  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10573  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10574  */
10575         }
10576 
10577         /* "View.MemoryView":385
10578  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10579  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10580  *                     break             # <<<<<<<<<<<<<<
10581  *             else:
10582  *                 PyThread_free_lock(self.lock)
10583  */
10584         goto __pyx_L6_break;
10585 
10586         /* "View.MemoryView":380
10587  *         if self.lock != NULL:
10588  *             for i in range(__pyx_memoryview_thread_locks_used):
10589  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
10590  *                     __pyx_memoryview_thread_locks_used -= 1
10591  *                     if i != __pyx_memoryview_thread_locks_used:
10592  */
10593       }
10594     }
10595     /*else*/ {
10596 
10597       /* "View.MemoryView":387
10598  *                     break
10599  *             else:
10600  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
10601  *
10602  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
10603  */
10604       PyThread_free_lock(__pyx_v_self->lock);
10605     }
10606     __pyx_L6_break:;
10607 
10608     /* "View.MemoryView":378
10609  *         cdef int i
10610  *         global __pyx_memoryview_thread_locks_used
10611  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
10612  *             for i in range(__pyx_memoryview_thread_locks_used):
10613  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
10614  */
10615   }
10616 
10617   /* "View.MemoryView":372
10618  *         self.typeinfo = NULL
10619  *
10620  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
10621  *         if self.obj is not None:
10622  *             __Pyx_ReleaseBuffer(&self.view)
10623  */
10624 
10625   /* function exit code */
10626   __Pyx_RefNannyFinishContext();
10627 }
10628 
10629 /* "View.MemoryView":389
10630  *                 PyThread_free_lock(self.lock)
10631  *
10632  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
10633  *         cdef Py_ssize_t dim
10634  *         cdef char *itemp = <char *> self.view.buf
10635  */
10636 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)10637 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10638   Py_ssize_t __pyx_v_dim;
10639   char *__pyx_v_itemp;
10640   PyObject *__pyx_v_idx = NULL;
10641   char *__pyx_r;
10642   __Pyx_RefNannyDeclarations
10643   Py_ssize_t __pyx_t_1;
10644   PyObject *__pyx_t_2 = NULL;
10645   Py_ssize_t __pyx_t_3;
10646   PyObject *(*__pyx_t_4)(PyObject *);
10647   PyObject *__pyx_t_5 = NULL;
10648   Py_ssize_t __pyx_t_6;
10649   char *__pyx_t_7;
10650   __Pyx_RefNannySetupContext("get_item_pointer", 0);
10651 
10652   /* "View.MemoryView":391
10653  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
10654  *         cdef Py_ssize_t dim
10655  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
10656  *
10657  *         for dim, idx in enumerate(index):
10658  */
10659   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10660 
10661   /* "View.MemoryView":393
10662  *         cdef char *itemp = <char *> self.view.buf
10663  *
10664  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
10665  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
10666  *
10667  */
10668   __pyx_t_1 = 0;
10669   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10670     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10671     __pyx_t_4 = NULL;
10672   } else {
10673     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 393, __pyx_L1_error)
10674     __Pyx_GOTREF(__pyx_t_2);
10675     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 393, __pyx_L1_error)
10676   }
10677   for (;;) {
10678     if (likely(!__pyx_t_4)) {
10679       if (likely(PyList_CheckExact(__pyx_t_2))) {
10680         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10681         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10682         __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(3, 393, __pyx_L1_error)
10683         #else
10684         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 393, __pyx_L1_error)
10685         __Pyx_GOTREF(__pyx_t_5);
10686         #endif
10687       } else {
10688         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10689         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10690         __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(3, 393, __pyx_L1_error)
10691         #else
10692         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 393, __pyx_L1_error)
10693         __Pyx_GOTREF(__pyx_t_5);
10694         #endif
10695       }
10696     } else {
10697       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10698       if (unlikely(!__pyx_t_5)) {
10699         PyObject* exc_type = PyErr_Occurred();
10700         if (exc_type) {
10701           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10702           else __PYX_ERR(3, 393, __pyx_L1_error)
10703         }
10704         break;
10705       }
10706       __Pyx_GOTREF(__pyx_t_5);
10707     }
10708     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10709     __pyx_t_5 = 0;
10710     __pyx_v_dim = __pyx_t_1;
10711     __pyx_t_1 = (__pyx_t_1 + 1);
10712 
10713     /* "View.MemoryView":394
10714  *
10715  *         for dim, idx in enumerate(index):
10716  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
10717  *
10718  *         return itemp
10719  */
10720     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 394, __pyx_L1_error)
10721     __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(3, 394, __pyx_L1_error)
10722     __pyx_v_itemp = __pyx_t_7;
10723 
10724     /* "View.MemoryView":393
10725  *         cdef char *itemp = <char *> self.view.buf
10726  *
10727  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
10728  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
10729  *
10730  */
10731   }
10732   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10733 
10734   /* "View.MemoryView":396
10735  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
10736  *
10737  *         return itemp             # <<<<<<<<<<<<<<
10738  *
10739  *
10740  */
10741   __pyx_r = __pyx_v_itemp;
10742   goto __pyx_L0;
10743 
10744   /* "View.MemoryView":389
10745  *                 PyThread_free_lock(self.lock)
10746  *
10747  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
10748  *         cdef Py_ssize_t dim
10749  *         cdef char *itemp = <char *> self.view.buf
10750  */
10751 
10752   /* function exit code */
10753   __pyx_L1_error:;
10754   __Pyx_XDECREF(__pyx_t_2);
10755   __Pyx_XDECREF(__pyx_t_5);
10756   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10757   __pyx_r = NULL;
10758   __pyx_L0:;
10759   __Pyx_XDECREF(__pyx_v_idx);
10760   __Pyx_RefNannyFinishContext();
10761   return __pyx_r;
10762 }
10763 
10764 /* "View.MemoryView":399
10765  *
10766  *
10767  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
10768  *         if index is Ellipsis:
10769  *             return self
10770  */
10771 
10772 /* Python wrapper */
10773 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)10774 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10775   PyObject *__pyx_r = 0;
10776   __Pyx_RefNannyDeclarations
10777   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10778   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10779 
10780   /* function exit code */
10781   __Pyx_RefNannyFinishContext();
10782   return __pyx_r;
10783 }
10784 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)10785 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10786   PyObject *__pyx_v_have_slices = NULL;
10787   PyObject *__pyx_v_indices = NULL;
10788   char *__pyx_v_itemp;
10789   PyObject *__pyx_r = NULL;
10790   __Pyx_RefNannyDeclarations
10791   int __pyx_t_1;
10792   int __pyx_t_2;
10793   PyObject *__pyx_t_3 = NULL;
10794   PyObject *__pyx_t_4 = NULL;
10795   PyObject *__pyx_t_5 = NULL;
10796   char *__pyx_t_6;
10797   __Pyx_RefNannySetupContext("__getitem__", 0);
10798 
10799   /* "View.MemoryView":400
10800  *
10801  *     def __getitem__(memoryview self, object index):
10802  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
10803  *             return self
10804  *
10805  */
10806   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10807   __pyx_t_2 = (__pyx_t_1 != 0);
10808   if (__pyx_t_2) {
10809 
10810     /* "View.MemoryView":401
10811  *     def __getitem__(memoryview self, object index):
10812  *         if index is Ellipsis:
10813  *             return self             # <<<<<<<<<<<<<<
10814  *
10815  *         have_slices, indices = _unellipsify(index, self.view.ndim)
10816  */
10817     __Pyx_XDECREF(__pyx_r);
10818     __Pyx_INCREF(((PyObject *)__pyx_v_self));
10819     __pyx_r = ((PyObject *)__pyx_v_self);
10820     goto __pyx_L0;
10821 
10822     /* "View.MemoryView":400
10823  *
10824  *     def __getitem__(memoryview self, object index):
10825  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
10826  *             return self
10827  *
10828  */
10829   }
10830 
10831   /* "View.MemoryView":403
10832  *             return self
10833  *
10834  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
10835  *
10836  *         cdef char *itemp
10837  */
10838   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 403, __pyx_L1_error)
10839   __Pyx_GOTREF(__pyx_t_3);
10840   if (likely(__pyx_t_3 != Py_None)) {
10841     PyObject* sequence = __pyx_t_3;
10842     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10843     if (unlikely(size != 2)) {
10844       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10845       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10846       __PYX_ERR(3, 403, __pyx_L1_error)
10847     }
10848     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10849     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10850     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10851     __Pyx_INCREF(__pyx_t_4);
10852     __Pyx_INCREF(__pyx_t_5);
10853     #else
10854     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 403, __pyx_L1_error)
10855     __Pyx_GOTREF(__pyx_t_4);
10856     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 403, __pyx_L1_error)
10857     __Pyx_GOTREF(__pyx_t_5);
10858     #endif
10859     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10860   } else {
10861     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 403, __pyx_L1_error)
10862   }
10863   __pyx_v_have_slices = __pyx_t_4;
10864   __pyx_t_4 = 0;
10865   __pyx_v_indices = __pyx_t_5;
10866   __pyx_t_5 = 0;
10867 
10868   /* "View.MemoryView":406
10869  *
10870  *         cdef char *itemp
10871  *         if have_slices:             # <<<<<<<<<<<<<<
10872  *             return memview_slice(self, indices)
10873  *         else:
10874  */
10875   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 406, __pyx_L1_error)
10876   if (__pyx_t_2) {
10877 
10878     /* "View.MemoryView":407
10879  *         cdef char *itemp
10880  *         if have_slices:
10881  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
10882  *         else:
10883  *             itemp = self.get_item_pointer(indices)
10884  */
10885     __Pyx_XDECREF(__pyx_r);
10886     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 407, __pyx_L1_error)
10887     __Pyx_GOTREF(__pyx_t_3);
10888     __pyx_r = __pyx_t_3;
10889     __pyx_t_3 = 0;
10890     goto __pyx_L0;
10891 
10892     /* "View.MemoryView":406
10893  *
10894  *         cdef char *itemp
10895  *         if have_slices:             # <<<<<<<<<<<<<<
10896  *             return memview_slice(self, indices)
10897  *         else:
10898  */
10899   }
10900 
10901   /* "View.MemoryView":409
10902  *             return memview_slice(self, indices)
10903  *         else:
10904  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
10905  *             return self.convert_item_to_object(itemp)
10906  *
10907  */
10908   /*else*/ {
10909     __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(3, 409, __pyx_L1_error)
10910     __pyx_v_itemp = __pyx_t_6;
10911 
10912     /* "View.MemoryView":410
10913  *         else:
10914  *             itemp = self.get_item_pointer(indices)
10915  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
10916  *
10917  *     def __setitem__(memoryview self, object index, object value):
10918  */
10919     __Pyx_XDECREF(__pyx_r);
10920     __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(3, 410, __pyx_L1_error)
10921     __Pyx_GOTREF(__pyx_t_3);
10922     __pyx_r = __pyx_t_3;
10923     __pyx_t_3 = 0;
10924     goto __pyx_L0;
10925   }
10926 
10927   /* "View.MemoryView":399
10928  *
10929  *
10930  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
10931  *         if index is Ellipsis:
10932  *             return self
10933  */
10934 
10935   /* function exit code */
10936   __pyx_L1_error:;
10937   __Pyx_XDECREF(__pyx_t_3);
10938   __Pyx_XDECREF(__pyx_t_4);
10939   __Pyx_XDECREF(__pyx_t_5);
10940   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10941   __pyx_r = NULL;
10942   __pyx_L0:;
10943   __Pyx_XDECREF(__pyx_v_have_slices);
10944   __Pyx_XDECREF(__pyx_v_indices);
10945   __Pyx_XGIVEREF(__pyx_r);
10946   __Pyx_RefNannyFinishContext();
10947   return __pyx_r;
10948 }
10949 
10950 /* "View.MemoryView":412
10951  *             return self.convert_item_to_object(itemp)
10952  *
10953  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
10954  *         if self.view.readonly:
10955  *             raise TypeError("Cannot assign to read-only memoryview")
10956  */
10957 
10958 /* Python wrapper */
10959 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)10960 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10961   int __pyx_r;
10962   __Pyx_RefNannyDeclarations
10963   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10964   __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));
10965 
10966   /* function exit code */
10967   __Pyx_RefNannyFinishContext();
10968   return __pyx_r;
10969 }
10970 
__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)10971 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) {
10972   PyObject *__pyx_v_have_slices = NULL;
10973   PyObject *__pyx_v_obj = NULL;
10974   int __pyx_r;
10975   __Pyx_RefNannyDeclarations
10976   int __pyx_t_1;
10977   PyObject *__pyx_t_2 = NULL;
10978   PyObject *__pyx_t_3 = NULL;
10979   PyObject *__pyx_t_4 = NULL;
10980   __Pyx_RefNannySetupContext("__setitem__", 0);
10981   __Pyx_INCREF(__pyx_v_index);
10982 
10983   /* "View.MemoryView":413
10984  *
10985  *     def __setitem__(memoryview self, object index, object value):
10986  *         if self.view.readonly:             # <<<<<<<<<<<<<<
10987  *             raise TypeError("Cannot assign to read-only memoryview")
10988  *
10989  */
10990   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10991   if (unlikely(__pyx_t_1)) {
10992 
10993     /* "View.MemoryView":414
10994  *     def __setitem__(memoryview self, object index, object value):
10995  *         if self.view.readonly:
10996  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
10997  *
10998  *         have_slices, index = _unellipsify(index, self.view.ndim)
10999  */
11000     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 414, __pyx_L1_error)
11001     __Pyx_GOTREF(__pyx_t_2);
11002     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11003     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11004     __PYX_ERR(3, 414, __pyx_L1_error)
11005 
11006     /* "View.MemoryView":413
11007  *
11008  *     def __setitem__(memoryview self, object index, object value):
11009  *         if self.view.readonly:             # <<<<<<<<<<<<<<
11010  *             raise TypeError("Cannot assign to read-only memoryview")
11011  *
11012  */
11013   }
11014 
11015   /* "View.MemoryView":416
11016  *             raise TypeError("Cannot assign to read-only memoryview")
11017  *
11018  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
11019  *
11020  *         if have_slices:
11021  */
11022   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 416, __pyx_L1_error)
11023   __Pyx_GOTREF(__pyx_t_2);
11024   if (likely(__pyx_t_2 != Py_None)) {
11025     PyObject* sequence = __pyx_t_2;
11026     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11027     if (unlikely(size != 2)) {
11028       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11029       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11030       __PYX_ERR(3, 416, __pyx_L1_error)
11031     }
11032     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11033     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11034     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11035     __Pyx_INCREF(__pyx_t_3);
11036     __Pyx_INCREF(__pyx_t_4);
11037     #else
11038     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 416, __pyx_L1_error)
11039     __Pyx_GOTREF(__pyx_t_3);
11040     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 416, __pyx_L1_error)
11041     __Pyx_GOTREF(__pyx_t_4);
11042     #endif
11043     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11044   } else {
11045     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 416, __pyx_L1_error)
11046   }
11047   __pyx_v_have_slices = __pyx_t_3;
11048   __pyx_t_3 = 0;
11049   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11050   __pyx_t_4 = 0;
11051 
11052   /* "View.MemoryView":418
11053  *         have_slices, index = _unellipsify(index, self.view.ndim)
11054  *
11055  *         if have_slices:             # <<<<<<<<<<<<<<
11056  *             obj = self.is_slice(value)
11057  *             if obj:
11058  */
11059   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 418, __pyx_L1_error)
11060   if (__pyx_t_1) {
11061 
11062     /* "View.MemoryView":419
11063  *
11064  *         if have_slices:
11065  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
11066  *             if obj:
11067  *                 self.setitem_slice_assignment(self[index], obj)
11068  */
11069     __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(3, 419, __pyx_L1_error)
11070     __Pyx_GOTREF(__pyx_t_2);
11071     __pyx_v_obj = __pyx_t_2;
11072     __pyx_t_2 = 0;
11073 
11074     /* "View.MemoryView":420
11075  *         if have_slices:
11076  *             obj = self.is_slice(value)
11077  *             if obj:             # <<<<<<<<<<<<<<
11078  *                 self.setitem_slice_assignment(self[index], obj)
11079  *             else:
11080  */
11081     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 420, __pyx_L1_error)
11082     if (__pyx_t_1) {
11083 
11084       /* "View.MemoryView":421
11085  *             obj = self.is_slice(value)
11086  *             if obj:
11087  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
11088  *             else:
11089  *                 self.setitem_slice_assign_scalar(self[index], value)
11090  */
11091       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 421, __pyx_L1_error)
11092       __Pyx_GOTREF(__pyx_t_2);
11093       __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(3, 421, __pyx_L1_error)
11094       __Pyx_GOTREF(__pyx_t_4);
11095       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11096       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11097 
11098       /* "View.MemoryView":420
11099  *         if have_slices:
11100  *             obj = self.is_slice(value)
11101  *             if obj:             # <<<<<<<<<<<<<<
11102  *                 self.setitem_slice_assignment(self[index], obj)
11103  *             else:
11104  */
11105       goto __pyx_L5;
11106     }
11107 
11108     /* "View.MemoryView":423
11109  *                 self.setitem_slice_assignment(self[index], obj)
11110  *             else:
11111  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
11112  *         else:
11113  *             self.setitem_indexed(index, value)
11114  */
11115     /*else*/ {
11116       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 423, __pyx_L1_error)
11117       __Pyx_GOTREF(__pyx_t_4);
11118       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(3, 423, __pyx_L1_error)
11119       __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(3, 423, __pyx_L1_error)
11120       __Pyx_GOTREF(__pyx_t_2);
11121       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11122       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11123     }
11124     __pyx_L5:;
11125 
11126     /* "View.MemoryView":418
11127  *         have_slices, index = _unellipsify(index, self.view.ndim)
11128  *
11129  *         if have_slices:             # <<<<<<<<<<<<<<
11130  *             obj = self.is_slice(value)
11131  *             if obj:
11132  */
11133     goto __pyx_L4;
11134   }
11135 
11136   /* "View.MemoryView":425
11137  *                 self.setitem_slice_assign_scalar(self[index], value)
11138  *         else:
11139  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
11140  *
11141  *     cdef is_slice(self, obj):
11142  */
11143   /*else*/ {
11144     __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(3, 425, __pyx_L1_error)
11145     __Pyx_GOTREF(__pyx_t_2);
11146     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11147   }
11148   __pyx_L4:;
11149 
11150   /* "View.MemoryView":412
11151  *             return self.convert_item_to_object(itemp)
11152  *
11153  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
11154  *         if self.view.readonly:
11155  *             raise TypeError("Cannot assign to read-only memoryview")
11156  */
11157 
11158   /* function exit code */
11159   __pyx_r = 0;
11160   goto __pyx_L0;
11161   __pyx_L1_error:;
11162   __Pyx_XDECREF(__pyx_t_2);
11163   __Pyx_XDECREF(__pyx_t_3);
11164   __Pyx_XDECREF(__pyx_t_4);
11165   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11166   __pyx_r = -1;
11167   __pyx_L0:;
11168   __Pyx_XDECREF(__pyx_v_have_slices);
11169   __Pyx_XDECREF(__pyx_v_obj);
11170   __Pyx_XDECREF(__pyx_v_index);
11171   __Pyx_RefNannyFinishContext();
11172   return __pyx_r;
11173 }
11174 
11175 /* "View.MemoryView":427
11176  *             self.setitem_indexed(index, value)
11177  *
11178  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
11179  *         if not isinstance(obj, memoryview):
11180  *             try:
11181  */
11182 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)11183 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11184   PyObject *__pyx_r = NULL;
11185   __Pyx_RefNannyDeclarations
11186   int __pyx_t_1;
11187   int __pyx_t_2;
11188   PyObject *__pyx_t_3 = NULL;
11189   PyObject *__pyx_t_4 = NULL;
11190   PyObject *__pyx_t_5 = NULL;
11191   PyObject *__pyx_t_6 = NULL;
11192   PyObject *__pyx_t_7 = NULL;
11193   PyObject *__pyx_t_8 = NULL;
11194   int __pyx_t_9;
11195   __Pyx_RefNannySetupContext("is_slice", 0);
11196   __Pyx_INCREF(__pyx_v_obj);
11197 
11198   /* "View.MemoryView":428
11199  *
11200  *     cdef is_slice(self, obj):
11201  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
11202  *             try:
11203  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11204  */
11205   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11206   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11207   if (__pyx_t_2) {
11208 
11209     /* "View.MemoryView":429
11210  *     cdef is_slice(self, obj):
11211  *         if not isinstance(obj, memoryview):
11212  *             try:             # <<<<<<<<<<<<<<
11213  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11214  *                                  self.dtype_is_object)
11215  */
11216     {
11217       __Pyx_PyThreadState_declare
11218       __Pyx_PyThreadState_assign
11219       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11220       __Pyx_XGOTREF(__pyx_t_3);
11221       __Pyx_XGOTREF(__pyx_t_4);
11222       __Pyx_XGOTREF(__pyx_t_5);
11223       /*try:*/ {
11224 
11225         /* "View.MemoryView":430
11226  *         if not isinstance(obj, memoryview):
11227  *             try:
11228  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
11229  *                                  self.dtype_is_object)
11230  *             except TypeError:
11231  */
11232         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 430, __pyx_L4_error)
11233         __Pyx_GOTREF(__pyx_t_6);
11234 
11235         /* "View.MemoryView":431
11236  *             try:
11237  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11238  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
11239  *             except TypeError:
11240  *                 return None
11241  */
11242         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 431, __pyx_L4_error)
11243         __Pyx_GOTREF(__pyx_t_7);
11244 
11245         /* "View.MemoryView":430
11246  *         if not isinstance(obj, memoryview):
11247  *             try:
11248  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
11249  *                                  self.dtype_is_object)
11250  *             except TypeError:
11251  */
11252         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 430, __pyx_L4_error)
11253         __Pyx_GOTREF(__pyx_t_8);
11254         __Pyx_INCREF(__pyx_v_obj);
11255         __Pyx_GIVEREF(__pyx_v_obj);
11256         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11257         __Pyx_GIVEREF(__pyx_t_6);
11258         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11259         __Pyx_GIVEREF(__pyx_t_7);
11260         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11261         __pyx_t_6 = 0;
11262         __pyx_t_7 = 0;
11263         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 430, __pyx_L4_error)
11264         __Pyx_GOTREF(__pyx_t_7);
11265         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11266         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11267         __pyx_t_7 = 0;
11268 
11269         /* "View.MemoryView":429
11270  *     cdef is_slice(self, obj):
11271  *         if not isinstance(obj, memoryview):
11272  *             try:             # <<<<<<<<<<<<<<
11273  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11274  *                                  self.dtype_is_object)
11275  */
11276       }
11277       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11278       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11279       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11280       goto __pyx_L9_try_end;
11281       __pyx_L4_error:;
11282       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11283       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11284       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11285 
11286       /* "View.MemoryView":432
11287  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11288  *                                  self.dtype_is_object)
11289  *             except TypeError:             # <<<<<<<<<<<<<<
11290  *                 return None
11291  *
11292  */
11293       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11294       if (__pyx_t_9) {
11295         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11296         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(3, 432, __pyx_L6_except_error)
11297         __Pyx_GOTREF(__pyx_t_7);
11298         __Pyx_GOTREF(__pyx_t_8);
11299         __Pyx_GOTREF(__pyx_t_6);
11300 
11301         /* "View.MemoryView":433
11302  *                                  self.dtype_is_object)
11303  *             except TypeError:
11304  *                 return None             # <<<<<<<<<<<<<<
11305  *
11306  *         return obj
11307  */
11308         __Pyx_XDECREF(__pyx_r);
11309         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11310         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11311         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11312         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11313         goto __pyx_L7_except_return;
11314       }
11315       goto __pyx_L6_except_error;
11316       __pyx_L6_except_error:;
11317 
11318       /* "View.MemoryView":429
11319  *     cdef is_slice(self, obj):
11320  *         if not isinstance(obj, memoryview):
11321  *             try:             # <<<<<<<<<<<<<<
11322  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11323  *                                  self.dtype_is_object)
11324  */
11325       __Pyx_XGIVEREF(__pyx_t_3);
11326       __Pyx_XGIVEREF(__pyx_t_4);
11327       __Pyx_XGIVEREF(__pyx_t_5);
11328       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11329       goto __pyx_L1_error;
11330       __pyx_L7_except_return:;
11331       __Pyx_XGIVEREF(__pyx_t_3);
11332       __Pyx_XGIVEREF(__pyx_t_4);
11333       __Pyx_XGIVEREF(__pyx_t_5);
11334       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11335       goto __pyx_L0;
11336       __pyx_L9_try_end:;
11337     }
11338 
11339     /* "View.MemoryView":428
11340  *
11341  *     cdef is_slice(self, obj):
11342  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
11343  *             try:
11344  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11345  */
11346   }
11347 
11348   /* "View.MemoryView":435
11349  *                 return None
11350  *
11351  *         return obj             # <<<<<<<<<<<<<<
11352  *
11353  *     cdef setitem_slice_assignment(self, dst, src):
11354  */
11355   __Pyx_XDECREF(__pyx_r);
11356   __Pyx_INCREF(__pyx_v_obj);
11357   __pyx_r = __pyx_v_obj;
11358   goto __pyx_L0;
11359 
11360   /* "View.MemoryView":427
11361  *             self.setitem_indexed(index, value)
11362  *
11363  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
11364  *         if not isinstance(obj, memoryview):
11365  *             try:
11366  */
11367 
11368   /* function exit code */
11369   __pyx_L1_error:;
11370   __Pyx_XDECREF(__pyx_t_6);
11371   __Pyx_XDECREF(__pyx_t_7);
11372   __Pyx_XDECREF(__pyx_t_8);
11373   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11374   __pyx_r = 0;
11375   __pyx_L0:;
11376   __Pyx_XDECREF(__pyx_v_obj);
11377   __Pyx_XGIVEREF(__pyx_r);
11378   __Pyx_RefNannyFinishContext();
11379   return __pyx_r;
11380 }
11381 
11382 /* "View.MemoryView":437
11383  *         return obj
11384  *
11385  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
11386  *         cdef __Pyx_memviewslice dst_slice
11387  *         cdef __Pyx_memviewslice src_slice
11388  */
11389 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)11390 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11391   __Pyx_memviewslice __pyx_v_dst_slice;
11392   __Pyx_memviewslice __pyx_v_src_slice;
11393   PyObject *__pyx_r = NULL;
11394   __Pyx_RefNannyDeclarations
11395   PyObject *__pyx_t_1 = NULL;
11396   int __pyx_t_2;
11397   int __pyx_t_3;
11398   int __pyx_t_4;
11399   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11400 
11401   /* "View.MemoryView":441
11402  *         cdef __Pyx_memviewslice src_slice
11403  *
11404  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
11405  *                                  get_slice_from_memview(dst, &dst_slice)[0],
11406  *                                  src.ndim, dst.ndim, self.dtype_is_object)
11407  */
11408   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(3, 441, __pyx_L1_error)
11409 
11410   /* "View.MemoryView":442
11411  *
11412  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11413  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
11414  *                                  src.ndim, dst.ndim, self.dtype_is_object)
11415  *
11416  */
11417   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(3, 442, __pyx_L1_error)
11418 
11419   /* "View.MemoryView":443
11420  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11421  *                                  get_slice_from_memview(dst, &dst_slice)[0],
11422  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
11423  *
11424  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11425  */
11426   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 443, __pyx_L1_error)
11427   __Pyx_GOTREF(__pyx_t_1);
11428   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 443, __pyx_L1_error)
11429   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11430   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 443, __pyx_L1_error)
11431   __Pyx_GOTREF(__pyx_t_1);
11432   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 443, __pyx_L1_error)
11433   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11434 
11435   /* "View.MemoryView":441
11436  *         cdef __Pyx_memviewslice src_slice
11437  *
11438  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
11439  *                                  get_slice_from_memview(dst, &dst_slice)[0],
11440  *                                  src.ndim, dst.ndim, self.dtype_is_object)
11441  */
11442   __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(3, 441, __pyx_L1_error)
11443 
11444   /* "View.MemoryView":437
11445  *         return obj
11446  *
11447  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
11448  *         cdef __Pyx_memviewslice dst_slice
11449  *         cdef __Pyx_memviewslice src_slice
11450  */
11451 
11452   /* function exit code */
11453   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11454   goto __pyx_L0;
11455   __pyx_L1_error:;
11456   __Pyx_XDECREF(__pyx_t_1);
11457   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11458   __pyx_r = 0;
11459   __pyx_L0:;
11460   __Pyx_XGIVEREF(__pyx_r);
11461   __Pyx_RefNannyFinishContext();
11462   return __pyx_r;
11463 }
11464 
11465 /* "View.MemoryView":445
11466  *                                  src.ndim, dst.ndim, self.dtype_is_object)
11467  *
11468  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
11469  *         cdef int array[128]
11470  *         cdef void *tmp = NULL
11471  */
11472 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)11473 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) {
11474   int __pyx_v_array[0x80];
11475   void *__pyx_v_tmp;
11476   void *__pyx_v_item;
11477   __Pyx_memviewslice *__pyx_v_dst_slice;
11478   __Pyx_memviewslice __pyx_v_tmp_slice;
11479   PyObject *__pyx_r = NULL;
11480   __Pyx_RefNannyDeclarations
11481   int __pyx_t_1;
11482   PyObject *__pyx_t_2 = NULL;
11483   int __pyx_t_3;
11484   int __pyx_t_4;
11485   char const *__pyx_t_5;
11486   PyObject *__pyx_t_6 = NULL;
11487   PyObject *__pyx_t_7 = NULL;
11488   PyObject *__pyx_t_8 = NULL;
11489   PyObject *__pyx_t_9 = NULL;
11490   PyObject *__pyx_t_10 = NULL;
11491   PyObject *__pyx_t_11 = NULL;
11492   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11493 
11494   /* "View.MemoryView":447
11495  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11496  *         cdef int array[128]
11497  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
11498  *         cdef void *item
11499  *
11500  */
11501   __pyx_v_tmp = NULL;
11502 
11503   /* "View.MemoryView":452
11504  *         cdef __Pyx_memviewslice *dst_slice
11505  *         cdef __Pyx_memviewslice tmp_slice
11506  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
11507  *
11508  *         if <size_t>self.view.itemsize > sizeof(array):
11509  */
11510   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
11511 
11512   /* "View.MemoryView":454
11513  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
11514  *
11515  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
11516  *             tmp = PyMem_Malloc(self.view.itemsize)
11517  *             if tmp == NULL:
11518  */
11519   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11520   if (__pyx_t_1) {
11521 
11522     /* "View.MemoryView":455
11523  *
11524  *         if <size_t>self.view.itemsize > sizeof(array):
11525  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
11526  *             if tmp == NULL:
11527  *                 raise MemoryError
11528  */
11529     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11530 
11531     /* "View.MemoryView":456
11532  *         if <size_t>self.view.itemsize > sizeof(array):
11533  *             tmp = PyMem_Malloc(self.view.itemsize)
11534  *             if tmp == NULL:             # <<<<<<<<<<<<<<
11535  *                 raise MemoryError
11536  *             item = tmp
11537  */
11538     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
11539     if (unlikely(__pyx_t_1)) {
11540 
11541       /* "View.MemoryView":457
11542  *             tmp = PyMem_Malloc(self.view.itemsize)
11543  *             if tmp == NULL:
11544  *                 raise MemoryError             # <<<<<<<<<<<<<<
11545  *             item = tmp
11546  *         else:
11547  */
11548       PyErr_NoMemory(); __PYX_ERR(3, 457, __pyx_L1_error)
11549 
11550       /* "View.MemoryView":456
11551  *         if <size_t>self.view.itemsize > sizeof(array):
11552  *             tmp = PyMem_Malloc(self.view.itemsize)
11553  *             if tmp == NULL:             # <<<<<<<<<<<<<<
11554  *                 raise MemoryError
11555  *             item = tmp
11556  */
11557     }
11558 
11559     /* "View.MemoryView":458
11560  *             if tmp == NULL:
11561  *                 raise MemoryError
11562  *             item = tmp             # <<<<<<<<<<<<<<
11563  *         else:
11564  *             item = <void *> array
11565  */
11566     __pyx_v_item = __pyx_v_tmp;
11567 
11568     /* "View.MemoryView":454
11569  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
11570  *
11571  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
11572  *             tmp = PyMem_Malloc(self.view.itemsize)
11573  *             if tmp == NULL:
11574  */
11575     goto __pyx_L3;
11576   }
11577 
11578   /* "View.MemoryView":460
11579  *             item = tmp
11580  *         else:
11581  *             item = <void *> array             # <<<<<<<<<<<<<<
11582  *
11583  *         try:
11584  */
11585   /*else*/ {
11586     __pyx_v_item = ((void *)__pyx_v_array);
11587   }
11588   __pyx_L3:;
11589 
11590   /* "View.MemoryView":462
11591  *             item = <void *> array
11592  *
11593  *         try:             # <<<<<<<<<<<<<<
11594  *             if self.dtype_is_object:
11595  *                 (<PyObject **> item)[0] = <PyObject *> value
11596  */
11597   /*try:*/ {
11598 
11599     /* "View.MemoryView":463
11600  *
11601  *         try:
11602  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
11603  *                 (<PyObject **> item)[0] = <PyObject *> value
11604  *             else:
11605  */
11606     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
11607     if (__pyx_t_1) {
11608 
11609       /* "View.MemoryView":464
11610  *         try:
11611  *             if self.dtype_is_object:
11612  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
11613  *             else:
11614  *                 self.assign_item_from_object(<char *> item, value)
11615  */
11616       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11617 
11618       /* "View.MemoryView":463
11619  *
11620  *         try:
11621  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
11622  *                 (<PyObject **> item)[0] = <PyObject *> value
11623  *             else:
11624  */
11625       goto __pyx_L8;
11626     }
11627 
11628     /* "View.MemoryView":466
11629  *                 (<PyObject **> item)[0] = <PyObject *> value
11630  *             else:
11631  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
11632  *
11633  *
11634  */
11635     /*else*/ {
11636       __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(3, 466, __pyx_L6_error)
11637       __Pyx_GOTREF(__pyx_t_2);
11638       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11639     }
11640     __pyx_L8:;
11641 
11642     /* "View.MemoryView":470
11643  *
11644  *
11645  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
11646  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11647  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11648  */
11649     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11650     if (__pyx_t_1) {
11651 
11652       /* "View.MemoryView":471
11653  *
11654  *             if self.view.suboffsets != NULL:
11655  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
11656  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11657  *                                 item, self.dtype_is_object)
11658  */
11659       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 471, __pyx_L6_error)
11660       __Pyx_GOTREF(__pyx_t_2);
11661       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11662 
11663       /* "View.MemoryView":470
11664  *
11665  *
11666  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
11667  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11668  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11669  */
11670     }
11671 
11672     /* "View.MemoryView":472
11673  *             if self.view.suboffsets != NULL:
11674  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11675  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
11676  *                                 item, self.dtype_is_object)
11677  *         finally:
11678  */
11679     __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);
11680   }
11681 
11682   /* "View.MemoryView":475
11683  *                                 item, self.dtype_is_object)
11684  *         finally:
11685  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
11686  *
11687  *     cdef setitem_indexed(self, index, value):
11688  */
11689   /*finally:*/ {
11690     /*normal exit:*/{
11691       PyMem_Free(__pyx_v_tmp);
11692       goto __pyx_L7;
11693     }
11694     __pyx_L6_error:;
11695     /*exception exit:*/{
11696       __Pyx_PyThreadState_declare
11697       __Pyx_PyThreadState_assign
11698       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11699       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11700       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
11701       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);
11702       __Pyx_XGOTREF(__pyx_t_6);
11703       __Pyx_XGOTREF(__pyx_t_7);
11704       __Pyx_XGOTREF(__pyx_t_8);
11705       __Pyx_XGOTREF(__pyx_t_9);
11706       __Pyx_XGOTREF(__pyx_t_10);
11707       __Pyx_XGOTREF(__pyx_t_11);
11708       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
11709       {
11710         PyMem_Free(__pyx_v_tmp);
11711       }
11712       if (PY_MAJOR_VERSION >= 3) {
11713         __Pyx_XGIVEREF(__pyx_t_9);
11714         __Pyx_XGIVEREF(__pyx_t_10);
11715         __Pyx_XGIVEREF(__pyx_t_11);
11716         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
11717       }
11718       __Pyx_XGIVEREF(__pyx_t_6);
11719       __Pyx_XGIVEREF(__pyx_t_7);
11720       __Pyx_XGIVEREF(__pyx_t_8);
11721       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11722       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11723       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
11724       goto __pyx_L1_error;
11725     }
11726     __pyx_L7:;
11727   }
11728 
11729   /* "View.MemoryView":445
11730  *                                  src.ndim, dst.ndim, self.dtype_is_object)
11731  *
11732  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
11733  *         cdef int array[128]
11734  *         cdef void *tmp = NULL
11735  */
11736 
11737   /* function exit code */
11738   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11739   goto __pyx_L0;
11740   __pyx_L1_error:;
11741   __Pyx_XDECREF(__pyx_t_2);
11742   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11743   __pyx_r = 0;
11744   __pyx_L0:;
11745   __Pyx_XGIVEREF(__pyx_r);
11746   __Pyx_RefNannyFinishContext();
11747   return __pyx_r;
11748 }
11749 
11750 /* "View.MemoryView":477
11751  *             PyMem_Free(tmp)
11752  *
11753  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
11754  *         cdef char *itemp = self.get_item_pointer(index)
11755  *         self.assign_item_from_object(itemp, value)
11756  */
11757 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)11758 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11759   char *__pyx_v_itemp;
11760   PyObject *__pyx_r = NULL;
11761   __Pyx_RefNannyDeclarations
11762   char *__pyx_t_1;
11763   PyObject *__pyx_t_2 = NULL;
11764   __Pyx_RefNannySetupContext("setitem_indexed", 0);
11765 
11766   /* "View.MemoryView":478
11767  *
11768  *     cdef setitem_indexed(self, index, value):
11769  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
11770  *         self.assign_item_from_object(itemp, value)
11771  *
11772  */
11773   __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(3, 478, __pyx_L1_error)
11774   __pyx_v_itemp = __pyx_t_1;
11775 
11776   /* "View.MemoryView":479
11777  *     cdef setitem_indexed(self, index, value):
11778  *         cdef char *itemp = self.get_item_pointer(index)
11779  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
11780  *
11781  *     cdef convert_item_to_object(self, char *itemp):
11782  */
11783   __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(3, 479, __pyx_L1_error)
11784   __Pyx_GOTREF(__pyx_t_2);
11785   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11786 
11787   /* "View.MemoryView":477
11788  *             PyMem_Free(tmp)
11789  *
11790  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
11791  *         cdef char *itemp = self.get_item_pointer(index)
11792  *         self.assign_item_from_object(itemp, value)
11793  */
11794 
11795   /* function exit code */
11796   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11797   goto __pyx_L0;
11798   __pyx_L1_error:;
11799   __Pyx_XDECREF(__pyx_t_2);
11800   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11801   __pyx_r = 0;
11802   __pyx_L0:;
11803   __Pyx_XGIVEREF(__pyx_r);
11804   __Pyx_RefNannyFinishContext();
11805   return __pyx_r;
11806 }
11807 
11808 /* "View.MemoryView":481
11809  *         self.assign_item_from_object(itemp, value)
11810  *
11811  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
11812  *         """Only used if instantiated manually by the user, or if Cython doesn't
11813  *         know how to convert the type"""
11814  */
11815 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)11816 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11817   PyObject *__pyx_v_struct = NULL;
11818   PyObject *__pyx_v_bytesitem = 0;
11819   PyObject *__pyx_v_result = NULL;
11820   PyObject *__pyx_r = NULL;
11821   __Pyx_RefNannyDeclarations
11822   PyObject *__pyx_t_1 = NULL;
11823   PyObject *__pyx_t_2 = NULL;
11824   PyObject *__pyx_t_3 = NULL;
11825   PyObject *__pyx_t_4 = NULL;
11826   PyObject *__pyx_t_5 = NULL;
11827   PyObject *__pyx_t_6 = NULL;
11828   PyObject *__pyx_t_7 = NULL;
11829   int __pyx_t_8;
11830   PyObject *__pyx_t_9 = NULL;
11831   size_t __pyx_t_10;
11832   int __pyx_t_11;
11833   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11834 
11835   /* "View.MemoryView":484
11836  *         """Only used if instantiated manually by the user, or if Cython doesn't
11837  *         know how to convert the type"""
11838  *         import struct             # <<<<<<<<<<<<<<
11839  *         cdef bytes bytesitem
11840  *
11841  */
11842   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 484, __pyx_L1_error)
11843   __Pyx_GOTREF(__pyx_t_1);
11844   __pyx_v_struct = __pyx_t_1;
11845   __pyx_t_1 = 0;
11846 
11847   /* "View.MemoryView":487
11848  *         cdef bytes bytesitem
11849  *
11850  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
11851  *         try:
11852  *             result = struct.unpack(self.view.format, bytesitem)
11853  */
11854   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 487, __pyx_L1_error)
11855   __Pyx_GOTREF(__pyx_t_1);
11856   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11857   __pyx_t_1 = 0;
11858 
11859   /* "View.MemoryView":488
11860  *
11861  *         bytesitem = itemp[:self.view.itemsize]
11862  *         try:             # <<<<<<<<<<<<<<
11863  *             result = struct.unpack(self.view.format, bytesitem)
11864  *         except struct.error:
11865  */
11866   {
11867     __Pyx_PyThreadState_declare
11868     __Pyx_PyThreadState_assign
11869     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11870     __Pyx_XGOTREF(__pyx_t_2);
11871     __Pyx_XGOTREF(__pyx_t_3);
11872     __Pyx_XGOTREF(__pyx_t_4);
11873     /*try:*/ {
11874 
11875       /* "View.MemoryView":489
11876  *         bytesitem = itemp[:self.view.itemsize]
11877  *         try:
11878  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
11879  *         except struct.error:
11880  *             raise ValueError("Unable to convert item to object")
11881  */
11882       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 489, __pyx_L3_error)
11883       __Pyx_GOTREF(__pyx_t_5);
11884       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 489, __pyx_L3_error)
11885       __Pyx_GOTREF(__pyx_t_6);
11886       __pyx_t_7 = NULL;
11887       __pyx_t_8 = 0;
11888       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11889         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11890         if (likely(__pyx_t_7)) {
11891           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11892           __Pyx_INCREF(__pyx_t_7);
11893           __Pyx_INCREF(function);
11894           __Pyx_DECREF_SET(__pyx_t_5, function);
11895           __pyx_t_8 = 1;
11896         }
11897       }
11898       #if CYTHON_FAST_PYCALL
11899       if (PyFunction_Check(__pyx_t_5)) {
11900         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11901         __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(3, 489, __pyx_L3_error)
11902         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11903         __Pyx_GOTREF(__pyx_t_1);
11904         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11905       } else
11906       #endif
11907       #if CYTHON_FAST_PYCCALL
11908       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11909         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11910         __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(3, 489, __pyx_L3_error)
11911         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11912         __Pyx_GOTREF(__pyx_t_1);
11913         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11914       } else
11915       #endif
11916       {
11917         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 489, __pyx_L3_error)
11918         __Pyx_GOTREF(__pyx_t_9);
11919         if (__pyx_t_7) {
11920           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11921         }
11922         __Pyx_GIVEREF(__pyx_t_6);
11923         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11924         __Pyx_INCREF(__pyx_v_bytesitem);
11925         __Pyx_GIVEREF(__pyx_v_bytesitem);
11926         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11927         __pyx_t_6 = 0;
11928         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 489, __pyx_L3_error)
11929         __Pyx_GOTREF(__pyx_t_1);
11930         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11931       }
11932       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11933       __pyx_v_result = __pyx_t_1;
11934       __pyx_t_1 = 0;
11935 
11936       /* "View.MemoryView":488
11937  *
11938  *         bytesitem = itemp[:self.view.itemsize]
11939  *         try:             # <<<<<<<<<<<<<<
11940  *             result = struct.unpack(self.view.format, bytesitem)
11941  *         except struct.error:
11942  */
11943     }
11944 
11945     /* "View.MemoryView":493
11946  *             raise ValueError("Unable to convert item to object")
11947  *         else:
11948  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
11949  *                 return result[0]
11950  *             return result
11951  */
11952     /*else:*/ {
11953       __pyx_t_10 = strlen(__pyx_v_self->view.format);
11954       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11955       if (__pyx_t_11) {
11956 
11957         /* "View.MemoryView":494
11958  *         else:
11959  *             if len(self.view.format) == 1:
11960  *                 return result[0]             # <<<<<<<<<<<<<<
11961  *             return result
11962  *
11963  */
11964         __Pyx_XDECREF(__pyx_r);
11965         __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(3, 494, __pyx_L5_except_error)
11966         __Pyx_GOTREF(__pyx_t_1);
11967         __pyx_r = __pyx_t_1;
11968         __pyx_t_1 = 0;
11969         goto __pyx_L6_except_return;
11970 
11971         /* "View.MemoryView":493
11972  *             raise ValueError("Unable to convert item to object")
11973  *         else:
11974  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
11975  *                 return result[0]
11976  *             return result
11977  */
11978       }
11979 
11980       /* "View.MemoryView":495
11981  *             if len(self.view.format) == 1:
11982  *                 return result[0]
11983  *             return result             # <<<<<<<<<<<<<<
11984  *
11985  *     cdef assign_item_from_object(self, char *itemp, object value):
11986  */
11987       __Pyx_XDECREF(__pyx_r);
11988       __Pyx_INCREF(__pyx_v_result);
11989       __pyx_r = __pyx_v_result;
11990       goto __pyx_L6_except_return;
11991     }
11992     __pyx_L3_error:;
11993     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11994     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11995     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11996     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11997     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11998 
11999     /* "View.MemoryView":490
12000  *         try:
12001  *             result = struct.unpack(self.view.format, bytesitem)
12002  *         except struct.error:             # <<<<<<<<<<<<<<
12003  *             raise ValueError("Unable to convert item to object")
12004  *         else:
12005  */
12006     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12007     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 490, __pyx_L5_except_error)
12008     __Pyx_GOTREF(__pyx_t_6);
12009     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12010     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12011     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12012     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12013     if (__pyx_t_8) {
12014       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12015       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(3, 490, __pyx_L5_except_error)
12016       __Pyx_GOTREF(__pyx_t_9);
12017       __Pyx_GOTREF(__pyx_t_5);
12018       __Pyx_GOTREF(__pyx_t_1);
12019 
12020       /* "View.MemoryView":491
12021  *             result = struct.unpack(self.view.format, bytesitem)
12022  *         except struct.error:
12023  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
12024  *         else:
12025  *             if len(self.view.format) == 1:
12026  */
12027       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 491, __pyx_L5_except_error)
12028       __Pyx_GOTREF(__pyx_t_6);
12029       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12030       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12031       __PYX_ERR(3, 491, __pyx_L5_except_error)
12032     }
12033     goto __pyx_L5_except_error;
12034     __pyx_L5_except_error:;
12035 
12036     /* "View.MemoryView":488
12037  *
12038  *         bytesitem = itemp[:self.view.itemsize]
12039  *         try:             # <<<<<<<<<<<<<<
12040  *             result = struct.unpack(self.view.format, bytesitem)
12041  *         except struct.error:
12042  */
12043     __Pyx_XGIVEREF(__pyx_t_2);
12044     __Pyx_XGIVEREF(__pyx_t_3);
12045     __Pyx_XGIVEREF(__pyx_t_4);
12046     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12047     goto __pyx_L1_error;
12048     __pyx_L6_except_return:;
12049     __Pyx_XGIVEREF(__pyx_t_2);
12050     __Pyx_XGIVEREF(__pyx_t_3);
12051     __Pyx_XGIVEREF(__pyx_t_4);
12052     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12053     goto __pyx_L0;
12054   }
12055 
12056   /* "View.MemoryView":481
12057  *         self.assign_item_from_object(itemp, value)
12058  *
12059  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
12060  *         """Only used if instantiated manually by the user, or if Cython doesn't
12061  *         know how to convert the type"""
12062  */
12063 
12064   /* function exit code */
12065   __pyx_L1_error:;
12066   __Pyx_XDECREF(__pyx_t_1);
12067   __Pyx_XDECREF(__pyx_t_5);
12068   __Pyx_XDECREF(__pyx_t_6);
12069   __Pyx_XDECREF(__pyx_t_7);
12070   __Pyx_XDECREF(__pyx_t_9);
12071   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12072   __pyx_r = 0;
12073   __pyx_L0:;
12074   __Pyx_XDECREF(__pyx_v_struct);
12075   __Pyx_XDECREF(__pyx_v_bytesitem);
12076   __Pyx_XDECREF(__pyx_v_result);
12077   __Pyx_XGIVEREF(__pyx_r);
12078   __Pyx_RefNannyFinishContext();
12079   return __pyx_r;
12080 }
12081 
12082 /* "View.MemoryView":497
12083  *             return result
12084  *
12085  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
12086  *         """Only used if instantiated manually by the user, or if Cython doesn't
12087  *         know how to convert the type"""
12088  */
12089 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)12090 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12091   PyObject *__pyx_v_struct = NULL;
12092   char __pyx_v_c;
12093   PyObject *__pyx_v_bytesvalue = 0;
12094   Py_ssize_t __pyx_v_i;
12095   PyObject *__pyx_r = NULL;
12096   __Pyx_RefNannyDeclarations
12097   PyObject *__pyx_t_1 = NULL;
12098   int __pyx_t_2;
12099   int __pyx_t_3;
12100   PyObject *__pyx_t_4 = NULL;
12101   PyObject *__pyx_t_5 = NULL;
12102   PyObject *__pyx_t_6 = NULL;
12103   int __pyx_t_7;
12104   PyObject *__pyx_t_8 = NULL;
12105   Py_ssize_t __pyx_t_9;
12106   PyObject *__pyx_t_10 = NULL;
12107   char *__pyx_t_11;
12108   char *__pyx_t_12;
12109   char *__pyx_t_13;
12110   char *__pyx_t_14;
12111   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12112 
12113   /* "View.MemoryView":500
12114  *         """Only used if instantiated manually by the user, or if Cython doesn't
12115  *         know how to convert the type"""
12116  *         import struct             # <<<<<<<<<<<<<<
12117  *         cdef char c
12118  *         cdef bytes bytesvalue
12119  */
12120   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 500, __pyx_L1_error)
12121   __Pyx_GOTREF(__pyx_t_1);
12122   __pyx_v_struct = __pyx_t_1;
12123   __pyx_t_1 = 0;
12124 
12125   /* "View.MemoryView":505
12126  *         cdef Py_ssize_t i
12127  *
12128  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
12129  *             bytesvalue = struct.pack(self.view.format, *value)
12130  *         else:
12131  */
12132   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12133   __pyx_t_3 = (__pyx_t_2 != 0);
12134   if (__pyx_t_3) {
12135 
12136     /* "View.MemoryView":506
12137  *
12138  *         if isinstance(value, tuple):
12139  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
12140  *         else:
12141  *             bytesvalue = struct.pack(self.view.format, value)
12142  */
12143     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 506, __pyx_L1_error)
12144     __Pyx_GOTREF(__pyx_t_1);
12145     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 506, __pyx_L1_error)
12146     __Pyx_GOTREF(__pyx_t_4);
12147     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 506, __pyx_L1_error)
12148     __Pyx_GOTREF(__pyx_t_5);
12149     __Pyx_GIVEREF(__pyx_t_4);
12150     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12151     __pyx_t_4 = 0;
12152     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 506, __pyx_L1_error)
12153     __Pyx_GOTREF(__pyx_t_4);
12154     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 506, __pyx_L1_error)
12155     __Pyx_GOTREF(__pyx_t_6);
12156     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12157     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12158     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 506, __pyx_L1_error)
12159     __Pyx_GOTREF(__pyx_t_4);
12160     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12161     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12162     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(3, 506, __pyx_L1_error)
12163     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12164     __pyx_t_4 = 0;
12165 
12166     /* "View.MemoryView":505
12167  *         cdef Py_ssize_t i
12168  *
12169  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
12170  *             bytesvalue = struct.pack(self.view.format, *value)
12171  *         else:
12172  */
12173     goto __pyx_L3;
12174   }
12175 
12176   /* "View.MemoryView":508
12177  *             bytesvalue = struct.pack(self.view.format, *value)
12178  *         else:
12179  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
12180  *
12181  *         for i, c in enumerate(bytesvalue):
12182  */
12183   /*else*/ {
12184     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 508, __pyx_L1_error)
12185     __Pyx_GOTREF(__pyx_t_6);
12186     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 508, __pyx_L1_error)
12187     __Pyx_GOTREF(__pyx_t_1);
12188     __pyx_t_5 = NULL;
12189     __pyx_t_7 = 0;
12190     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12191       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12192       if (likely(__pyx_t_5)) {
12193         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12194         __Pyx_INCREF(__pyx_t_5);
12195         __Pyx_INCREF(function);
12196         __Pyx_DECREF_SET(__pyx_t_6, function);
12197         __pyx_t_7 = 1;
12198       }
12199     }
12200     #if CYTHON_FAST_PYCALL
12201     if (PyFunction_Check(__pyx_t_6)) {
12202       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12203       __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(3, 508, __pyx_L1_error)
12204       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12205       __Pyx_GOTREF(__pyx_t_4);
12206       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12207     } else
12208     #endif
12209     #if CYTHON_FAST_PYCCALL
12210     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12211       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12212       __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(3, 508, __pyx_L1_error)
12213       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12214       __Pyx_GOTREF(__pyx_t_4);
12215       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12216     } else
12217     #endif
12218     {
12219       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 508, __pyx_L1_error)
12220       __Pyx_GOTREF(__pyx_t_8);
12221       if (__pyx_t_5) {
12222         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12223       }
12224       __Pyx_GIVEREF(__pyx_t_1);
12225       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12226       __Pyx_INCREF(__pyx_v_value);
12227       __Pyx_GIVEREF(__pyx_v_value);
12228       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12229       __pyx_t_1 = 0;
12230       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 508, __pyx_L1_error)
12231       __Pyx_GOTREF(__pyx_t_4);
12232       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12233     }
12234     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12235     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(3, 508, __pyx_L1_error)
12236     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12237     __pyx_t_4 = 0;
12238   }
12239   __pyx_L3:;
12240 
12241   /* "View.MemoryView":510
12242  *             bytesvalue = struct.pack(self.view.format, value)
12243  *
12244  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
12245  *             itemp[i] = c
12246  *
12247  */
12248   __pyx_t_9 = 0;
12249   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12250     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12251     __PYX_ERR(3, 510, __pyx_L1_error)
12252   }
12253   __Pyx_INCREF(__pyx_v_bytesvalue);
12254   __pyx_t_10 = __pyx_v_bytesvalue;
12255   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12256   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12257   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12258     __pyx_t_11 = __pyx_t_14;
12259     __pyx_v_c = (__pyx_t_11[0]);
12260 
12261     /* "View.MemoryView":511
12262  *
12263  *         for i, c in enumerate(bytesvalue):
12264  *             itemp[i] = c             # <<<<<<<<<<<<<<
12265  *
12266  *     @cname('getbuffer')
12267  */
12268     __pyx_v_i = __pyx_t_9;
12269 
12270     /* "View.MemoryView":510
12271  *             bytesvalue = struct.pack(self.view.format, value)
12272  *
12273  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
12274  *             itemp[i] = c
12275  *
12276  */
12277     __pyx_t_9 = (__pyx_t_9 + 1);
12278 
12279     /* "View.MemoryView":511
12280  *
12281  *         for i, c in enumerate(bytesvalue):
12282  *             itemp[i] = c             # <<<<<<<<<<<<<<
12283  *
12284  *     @cname('getbuffer')
12285  */
12286     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12287   }
12288   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12289 
12290   /* "View.MemoryView":497
12291  *             return result
12292  *
12293  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
12294  *         """Only used if instantiated manually by the user, or if Cython doesn't
12295  *         know how to convert the type"""
12296  */
12297 
12298   /* function exit code */
12299   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12300   goto __pyx_L0;
12301   __pyx_L1_error:;
12302   __Pyx_XDECREF(__pyx_t_1);
12303   __Pyx_XDECREF(__pyx_t_4);
12304   __Pyx_XDECREF(__pyx_t_5);
12305   __Pyx_XDECREF(__pyx_t_6);
12306   __Pyx_XDECREF(__pyx_t_8);
12307   __Pyx_XDECREF(__pyx_t_10);
12308   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12309   __pyx_r = 0;
12310   __pyx_L0:;
12311   __Pyx_XDECREF(__pyx_v_struct);
12312   __Pyx_XDECREF(__pyx_v_bytesvalue);
12313   __Pyx_XGIVEREF(__pyx_r);
12314   __Pyx_RefNannyFinishContext();
12315   return __pyx_r;
12316 }
12317 
12318 /* "View.MemoryView":514
12319  *
12320  *     @cname('getbuffer')
12321  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
12322  *         if flags & PyBUF_WRITABLE and self.view.readonly:
12323  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12324  */
12325 
12326 /* Python wrapper */
12327 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)12328 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12329   int __pyx_r;
12330   __Pyx_RefNannyDeclarations
12331   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12332   __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));
12333 
12334   /* function exit code */
12335   __Pyx_RefNannyFinishContext();
12336   return __pyx_r;
12337 }
12338 
__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)12339 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) {
12340   int __pyx_r;
12341   __Pyx_RefNannyDeclarations
12342   int __pyx_t_1;
12343   int __pyx_t_2;
12344   PyObject *__pyx_t_3 = NULL;
12345   Py_ssize_t *__pyx_t_4;
12346   char *__pyx_t_5;
12347   void *__pyx_t_6;
12348   int __pyx_t_7;
12349   Py_ssize_t __pyx_t_8;
12350   if (__pyx_v_info == NULL) {
12351     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12352     return -1;
12353   }
12354   __Pyx_RefNannySetupContext("__getbuffer__", 0);
12355   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12356   __Pyx_GIVEREF(__pyx_v_info->obj);
12357 
12358   /* "View.MemoryView":515
12359  *     @cname('getbuffer')
12360  *     def __getbuffer__(self, Py_buffer *info, int flags):
12361  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
12362  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12363  *
12364  */
12365   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12366   if (__pyx_t_2) {
12367   } else {
12368     __pyx_t_1 = __pyx_t_2;
12369     goto __pyx_L4_bool_binop_done;
12370   }
12371   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12372   __pyx_t_1 = __pyx_t_2;
12373   __pyx_L4_bool_binop_done:;
12374   if (unlikely(__pyx_t_1)) {
12375 
12376     /* "View.MemoryView":516
12377  *     def __getbuffer__(self, Py_buffer *info, int flags):
12378  *         if flags & PyBUF_WRITABLE and self.view.readonly:
12379  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
12380  *
12381  *         if flags & PyBUF_ND:
12382  */
12383     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 516, __pyx_L1_error)
12384     __Pyx_GOTREF(__pyx_t_3);
12385     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12386     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12387     __PYX_ERR(3, 516, __pyx_L1_error)
12388 
12389     /* "View.MemoryView":515
12390  *     @cname('getbuffer')
12391  *     def __getbuffer__(self, Py_buffer *info, int flags):
12392  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
12393  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12394  *
12395  */
12396   }
12397 
12398   /* "View.MemoryView":518
12399  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12400  *
12401  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
12402  *             info.shape = self.view.shape
12403  *         else:
12404  */
12405   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12406   if (__pyx_t_1) {
12407 
12408     /* "View.MemoryView":519
12409  *
12410  *         if flags & PyBUF_ND:
12411  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
12412  *         else:
12413  *             info.shape = NULL
12414  */
12415     __pyx_t_4 = __pyx_v_self->view.shape;
12416     __pyx_v_info->shape = __pyx_t_4;
12417 
12418     /* "View.MemoryView":518
12419  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12420  *
12421  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
12422  *             info.shape = self.view.shape
12423  *         else:
12424  */
12425     goto __pyx_L6;
12426   }
12427 
12428   /* "View.MemoryView":521
12429  *             info.shape = self.view.shape
12430  *         else:
12431  *             info.shape = NULL             # <<<<<<<<<<<<<<
12432  *
12433  *         if flags & PyBUF_STRIDES:
12434  */
12435   /*else*/ {
12436     __pyx_v_info->shape = NULL;
12437   }
12438   __pyx_L6:;
12439 
12440   /* "View.MemoryView":523
12441  *             info.shape = NULL
12442  *
12443  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
12444  *             info.strides = self.view.strides
12445  *         else:
12446  */
12447   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12448   if (__pyx_t_1) {
12449 
12450     /* "View.MemoryView":524
12451  *
12452  *         if flags & PyBUF_STRIDES:
12453  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
12454  *         else:
12455  *             info.strides = NULL
12456  */
12457     __pyx_t_4 = __pyx_v_self->view.strides;
12458     __pyx_v_info->strides = __pyx_t_4;
12459 
12460     /* "View.MemoryView":523
12461  *             info.shape = NULL
12462  *
12463  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
12464  *             info.strides = self.view.strides
12465  *         else:
12466  */
12467     goto __pyx_L7;
12468   }
12469 
12470   /* "View.MemoryView":526
12471  *             info.strides = self.view.strides
12472  *         else:
12473  *             info.strides = NULL             # <<<<<<<<<<<<<<
12474  *
12475  *         if flags & PyBUF_INDIRECT:
12476  */
12477   /*else*/ {
12478     __pyx_v_info->strides = NULL;
12479   }
12480   __pyx_L7:;
12481 
12482   /* "View.MemoryView":528
12483  *             info.strides = NULL
12484  *
12485  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
12486  *             info.suboffsets = self.view.suboffsets
12487  *         else:
12488  */
12489   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12490   if (__pyx_t_1) {
12491 
12492     /* "View.MemoryView":529
12493  *
12494  *         if flags & PyBUF_INDIRECT:
12495  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
12496  *         else:
12497  *             info.suboffsets = NULL
12498  */
12499     __pyx_t_4 = __pyx_v_self->view.suboffsets;
12500     __pyx_v_info->suboffsets = __pyx_t_4;
12501 
12502     /* "View.MemoryView":528
12503  *             info.strides = NULL
12504  *
12505  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
12506  *             info.suboffsets = self.view.suboffsets
12507  *         else:
12508  */
12509     goto __pyx_L8;
12510   }
12511 
12512   /* "View.MemoryView":531
12513  *             info.suboffsets = self.view.suboffsets
12514  *         else:
12515  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
12516  *
12517  *         if flags & PyBUF_FORMAT:
12518  */
12519   /*else*/ {
12520     __pyx_v_info->suboffsets = NULL;
12521   }
12522   __pyx_L8:;
12523 
12524   /* "View.MemoryView":533
12525  *             info.suboffsets = NULL
12526  *
12527  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
12528  *             info.format = self.view.format
12529  *         else:
12530  */
12531   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12532   if (__pyx_t_1) {
12533 
12534     /* "View.MemoryView":534
12535  *
12536  *         if flags & PyBUF_FORMAT:
12537  *             info.format = self.view.format             # <<<<<<<<<<<<<<
12538  *         else:
12539  *             info.format = NULL
12540  */
12541     __pyx_t_5 = __pyx_v_self->view.format;
12542     __pyx_v_info->format = __pyx_t_5;
12543 
12544     /* "View.MemoryView":533
12545  *             info.suboffsets = NULL
12546  *
12547  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
12548  *             info.format = self.view.format
12549  *         else:
12550  */
12551     goto __pyx_L9;
12552   }
12553 
12554   /* "View.MemoryView":536
12555  *             info.format = self.view.format
12556  *         else:
12557  *             info.format = NULL             # <<<<<<<<<<<<<<
12558  *
12559  *         info.buf = self.view.buf
12560  */
12561   /*else*/ {
12562     __pyx_v_info->format = NULL;
12563   }
12564   __pyx_L9:;
12565 
12566   /* "View.MemoryView":538
12567  *             info.format = NULL
12568  *
12569  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
12570  *         info.ndim = self.view.ndim
12571  *         info.itemsize = self.view.itemsize
12572  */
12573   __pyx_t_6 = __pyx_v_self->view.buf;
12574   __pyx_v_info->buf = __pyx_t_6;
12575 
12576   /* "View.MemoryView":539
12577  *
12578  *         info.buf = self.view.buf
12579  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
12580  *         info.itemsize = self.view.itemsize
12581  *         info.len = self.view.len
12582  */
12583   __pyx_t_7 = __pyx_v_self->view.ndim;
12584   __pyx_v_info->ndim = __pyx_t_7;
12585 
12586   /* "View.MemoryView":540
12587  *         info.buf = self.view.buf
12588  *         info.ndim = self.view.ndim
12589  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
12590  *         info.len = self.view.len
12591  *         info.readonly = self.view.readonly
12592  */
12593   __pyx_t_8 = __pyx_v_self->view.itemsize;
12594   __pyx_v_info->itemsize = __pyx_t_8;
12595 
12596   /* "View.MemoryView":541
12597  *         info.ndim = self.view.ndim
12598  *         info.itemsize = self.view.itemsize
12599  *         info.len = self.view.len             # <<<<<<<<<<<<<<
12600  *         info.readonly = self.view.readonly
12601  *         info.obj = self
12602  */
12603   __pyx_t_8 = __pyx_v_self->view.len;
12604   __pyx_v_info->len = __pyx_t_8;
12605 
12606   /* "View.MemoryView":542
12607  *         info.itemsize = self.view.itemsize
12608  *         info.len = self.view.len
12609  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
12610  *         info.obj = self
12611  *
12612  */
12613   __pyx_t_1 = __pyx_v_self->view.readonly;
12614   __pyx_v_info->readonly = __pyx_t_1;
12615 
12616   /* "View.MemoryView":543
12617  *         info.len = self.view.len
12618  *         info.readonly = self.view.readonly
12619  *         info.obj = self             # <<<<<<<<<<<<<<
12620  *
12621  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12622  */
12623   __Pyx_INCREF(((PyObject *)__pyx_v_self));
12624   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12625   __Pyx_GOTREF(__pyx_v_info->obj);
12626   __Pyx_DECREF(__pyx_v_info->obj);
12627   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12628 
12629   /* "View.MemoryView":514
12630  *
12631  *     @cname('getbuffer')
12632  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
12633  *         if flags & PyBUF_WRITABLE and self.view.readonly:
12634  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
12635  */
12636 
12637   /* function exit code */
12638   __pyx_r = 0;
12639   goto __pyx_L0;
12640   __pyx_L1_error:;
12641   __Pyx_XDECREF(__pyx_t_3);
12642   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12643   __pyx_r = -1;
12644   if (__pyx_v_info->obj != NULL) {
12645     __Pyx_GOTREF(__pyx_v_info->obj);
12646     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12647   }
12648   goto __pyx_L2;
12649   __pyx_L0:;
12650   if (__pyx_v_info->obj == Py_None) {
12651     __Pyx_GOTREF(__pyx_v_info->obj);
12652     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12653   }
12654   __pyx_L2:;
12655   __Pyx_RefNannyFinishContext();
12656   return __pyx_r;
12657 }
12658 
12659 /* "View.MemoryView":549
12660  *
12661  *     @property
12662  *     def T(self):             # <<<<<<<<<<<<<<
12663  *         cdef _memoryviewslice result = memoryview_copy(self)
12664  *         transpose_memslice(&result.from_slice)
12665  */
12666 
12667 /* Python wrapper */
12668 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)12669 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12670   PyObject *__pyx_r = 0;
12671   __Pyx_RefNannyDeclarations
12672   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12673   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12674 
12675   /* function exit code */
12676   __Pyx_RefNannyFinishContext();
12677   return __pyx_r;
12678 }
12679 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)12680 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12681   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12682   PyObject *__pyx_r = NULL;
12683   __Pyx_RefNannyDeclarations
12684   PyObject *__pyx_t_1 = NULL;
12685   int __pyx_t_2;
12686   __Pyx_RefNannySetupContext("__get__", 0);
12687 
12688   /* "View.MemoryView":550
12689  *     @property
12690  *     def T(self):
12691  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
12692  *         transpose_memslice(&result.from_slice)
12693  *         return result
12694  */
12695   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L1_error)
12696   __Pyx_GOTREF(__pyx_t_1);
12697   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(3, 550, __pyx_L1_error)
12698   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12699   __pyx_t_1 = 0;
12700 
12701   /* "View.MemoryView":551
12702  *     def T(self):
12703  *         cdef _memoryviewslice result = memoryview_copy(self)
12704  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
12705  *         return result
12706  *
12707  */
12708   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 551, __pyx_L1_error)
12709 
12710   /* "View.MemoryView":552
12711  *         cdef _memoryviewslice result = memoryview_copy(self)
12712  *         transpose_memslice(&result.from_slice)
12713  *         return result             # <<<<<<<<<<<<<<
12714  *
12715  *     @property
12716  */
12717   __Pyx_XDECREF(__pyx_r);
12718   __Pyx_INCREF(((PyObject *)__pyx_v_result));
12719   __pyx_r = ((PyObject *)__pyx_v_result);
12720   goto __pyx_L0;
12721 
12722   /* "View.MemoryView":549
12723  *
12724  *     @property
12725  *     def T(self):             # <<<<<<<<<<<<<<
12726  *         cdef _memoryviewslice result = memoryview_copy(self)
12727  *         transpose_memslice(&result.from_slice)
12728  */
12729 
12730   /* function exit code */
12731   __pyx_L1_error:;
12732   __Pyx_XDECREF(__pyx_t_1);
12733   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12734   __pyx_r = NULL;
12735   __pyx_L0:;
12736   __Pyx_XDECREF((PyObject *)__pyx_v_result);
12737   __Pyx_XGIVEREF(__pyx_r);
12738   __Pyx_RefNannyFinishContext();
12739   return __pyx_r;
12740 }
12741 
12742 /* "View.MemoryView":555
12743  *
12744  *     @property
12745  *     def base(self):             # <<<<<<<<<<<<<<
12746  *         return self.obj
12747  *
12748  */
12749 
12750 /* Python wrapper */
12751 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)12752 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12753   PyObject *__pyx_r = 0;
12754   __Pyx_RefNannyDeclarations
12755   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12756   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12757 
12758   /* function exit code */
12759   __Pyx_RefNannyFinishContext();
12760   return __pyx_r;
12761 }
12762 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)12763 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12764   PyObject *__pyx_r = NULL;
12765   __Pyx_RefNannyDeclarations
12766   __Pyx_RefNannySetupContext("__get__", 0);
12767 
12768   /* "View.MemoryView":556
12769  *     @property
12770  *     def base(self):
12771  *         return self.obj             # <<<<<<<<<<<<<<
12772  *
12773  *     @property
12774  */
12775   __Pyx_XDECREF(__pyx_r);
12776   __Pyx_INCREF(__pyx_v_self->obj);
12777   __pyx_r = __pyx_v_self->obj;
12778   goto __pyx_L0;
12779 
12780   /* "View.MemoryView":555
12781  *
12782  *     @property
12783  *     def base(self):             # <<<<<<<<<<<<<<
12784  *         return self.obj
12785  *
12786  */
12787 
12788   /* function exit code */
12789   __pyx_L0:;
12790   __Pyx_XGIVEREF(__pyx_r);
12791   __Pyx_RefNannyFinishContext();
12792   return __pyx_r;
12793 }
12794 
12795 /* "View.MemoryView":559
12796  *
12797  *     @property
12798  *     def shape(self):             # <<<<<<<<<<<<<<
12799  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
12800  *
12801  */
12802 
12803 /* Python wrapper */
12804 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)12805 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12806   PyObject *__pyx_r = 0;
12807   __Pyx_RefNannyDeclarations
12808   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12809   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12810 
12811   /* function exit code */
12812   __Pyx_RefNannyFinishContext();
12813   return __pyx_r;
12814 }
12815 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)12816 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12817   Py_ssize_t __pyx_v_length;
12818   PyObject *__pyx_r = NULL;
12819   __Pyx_RefNannyDeclarations
12820   PyObject *__pyx_t_1 = NULL;
12821   Py_ssize_t *__pyx_t_2;
12822   Py_ssize_t *__pyx_t_3;
12823   Py_ssize_t *__pyx_t_4;
12824   PyObject *__pyx_t_5 = NULL;
12825   __Pyx_RefNannySetupContext("__get__", 0);
12826 
12827   /* "View.MemoryView":560
12828  *     @property
12829  *     def shape(self):
12830  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
12831  *
12832  *     @property
12833  */
12834   __Pyx_XDECREF(__pyx_r);
12835   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 560, __pyx_L1_error)
12836   __Pyx_GOTREF(__pyx_t_1);
12837   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12838   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12839     __pyx_t_2 = __pyx_t_4;
12840     __pyx_v_length = (__pyx_t_2[0]);
12841     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 560, __pyx_L1_error)
12842     __Pyx_GOTREF(__pyx_t_5);
12843     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 560, __pyx_L1_error)
12844     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12845   }
12846   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 560, __pyx_L1_error)
12847   __Pyx_GOTREF(__pyx_t_5);
12848   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12849   __pyx_r = __pyx_t_5;
12850   __pyx_t_5 = 0;
12851   goto __pyx_L0;
12852 
12853   /* "View.MemoryView":559
12854  *
12855  *     @property
12856  *     def shape(self):             # <<<<<<<<<<<<<<
12857  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
12858  *
12859  */
12860 
12861   /* function exit code */
12862   __pyx_L1_error:;
12863   __Pyx_XDECREF(__pyx_t_1);
12864   __Pyx_XDECREF(__pyx_t_5);
12865   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12866   __pyx_r = NULL;
12867   __pyx_L0:;
12868   __Pyx_XGIVEREF(__pyx_r);
12869   __Pyx_RefNannyFinishContext();
12870   return __pyx_r;
12871 }
12872 
12873 /* "View.MemoryView":563
12874  *
12875  *     @property
12876  *     def strides(self):             # <<<<<<<<<<<<<<
12877  *         if self.view.strides == NULL:
12878  *
12879  */
12880 
12881 /* Python wrapper */
12882 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)12883 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12884   PyObject *__pyx_r = 0;
12885   __Pyx_RefNannyDeclarations
12886   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12887   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12888 
12889   /* function exit code */
12890   __Pyx_RefNannyFinishContext();
12891   return __pyx_r;
12892 }
12893 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)12894 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12895   Py_ssize_t __pyx_v_stride;
12896   PyObject *__pyx_r = NULL;
12897   __Pyx_RefNannyDeclarations
12898   int __pyx_t_1;
12899   PyObject *__pyx_t_2 = NULL;
12900   Py_ssize_t *__pyx_t_3;
12901   Py_ssize_t *__pyx_t_4;
12902   Py_ssize_t *__pyx_t_5;
12903   PyObject *__pyx_t_6 = NULL;
12904   __Pyx_RefNannySetupContext("__get__", 0);
12905 
12906   /* "View.MemoryView":564
12907  *     @property
12908  *     def strides(self):
12909  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
12910  *
12911  *             raise ValueError("Buffer view does not expose strides")
12912  */
12913   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12914   if (unlikely(__pyx_t_1)) {
12915 
12916     /* "View.MemoryView":566
12917  *         if self.view.strides == NULL:
12918  *
12919  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
12920  *
12921  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12922  */
12923     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 566, __pyx_L1_error)
12924     __Pyx_GOTREF(__pyx_t_2);
12925     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12926     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12927     __PYX_ERR(3, 566, __pyx_L1_error)
12928 
12929     /* "View.MemoryView":564
12930  *     @property
12931  *     def strides(self):
12932  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
12933  *
12934  *             raise ValueError("Buffer view does not expose strides")
12935  */
12936   }
12937 
12938   /* "View.MemoryView":568
12939  *             raise ValueError("Buffer view does not expose strides")
12940  *
12941  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
12942  *
12943  *     @property
12944  */
12945   __Pyx_XDECREF(__pyx_r);
12946   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 568, __pyx_L1_error)
12947   __Pyx_GOTREF(__pyx_t_2);
12948   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12949   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12950     __pyx_t_3 = __pyx_t_5;
12951     __pyx_v_stride = (__pyx_t_3[0]);
12952     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 568, __pyx_L1_error)
12953     __Pyx_GOTREF(__pyx_t_6);
12954     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 568, __pyx_L1_error)
12955     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12956   }
12957   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 568, __pyx_L1_error)
12958   __Pyx_GOTREF(__pyx_t_6);
12959   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12960   __pyx_r = __pyx_t_6;
12961   __pyx_t_6 = 0;
12962   goto __pyx_L0;
12963 
12964   /* "View.MemoryView":563
12965  *
12966  *     @property
12967  *     def strides(self):             # <<<<<<<<<<<<<<
12968  *         if self.view.strides == NULL:
12969  *
12970  */
12971 
12972   /* function exit code */
12973   __pyx_L1_error:;
12974   __Pyx_XDECREF(__pyx_t_2);
12975   __Pyx_XDECREF(__pyx_t_6);
12976   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12977   __pyx_r = NULL;
12978   __pyx_L0:;
12979   __Pyx_XGIVEREF(__pyx_r);
12980   __Pyx_RefNannyFinishContext();
12981   return __pyx_r;
12982 }
12983 
12984 /* "View.MemoryView":571
12985  *
12986  *     @property
12987  *     def suboffsets(self):             # <<<<<<<<<<<<<<
12988  *         if self.view.suboffsets == NULL:
12989  *             return (-1,) * self.view.ndim
12990  */
12991 
12992 /* Python wrapper */
12993 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)12994 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12995   PyObject *__pyx_r = 0;
12996   __Pyx_RefNannyDeclarations
12997   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12998   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12999 
13000   /* function exit code */
13001   __Pyx_RefNannyFinishContext();
13002   return __pyx_r;
13003 }
13004 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)13005 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13006   Py_ssize_t __pyx_v_suboffset;
13007   PyObject *__pyx_r = NULL;
13008   __Pyx_RefNannyDeclarations
13009   int __pyx_t_1;
13010   PyObject *__pyx_t_2 = NULL;
13011   PyObject *__pyx_t_3 = NULL;
13012   Py_ssize_t *__pyx_t_4;
13013   Py_ssize_t *__pyx_t_5;
13014   Py_ssize_t *__pyx_t_6;
13015   __Pyx_RefNannySetupContext("__get__", 0);
13016 
13017   /* "View.MemoryView":572
13018  *     @property
13019  *     def suboffsets(self):
13020  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
13021  *             return (-1,) * self.view.ndim
13022  *
13023  */
13024   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13025   if (__pyx_t_1) {
13026 
13027     /* "View.MemoryView":573
13028  *     def suboffsets(self):
13029  *         if self.view.suboffsets == NULL:
13030  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
13031  *
13032  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13033  */
13034     __Pyx_XDECREF(__pyx_r);
13035     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 573, __pyx_L1_error)
13036     __Pyx_GOTREF(__pyx_t_2);
13037     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 573, __pyx_L1_error)
13038     __Pyx_GOTREF(__pyx_t_3);
13039     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13040     __pyx_r = __pyx_t_3;
13041     __pyx_t_3 = 0;
13042     goto __pyx_L0;
13043 
13044     /* "View.MemoryView":572
13045  *     @property
13046  *     def suboffsets(self):
13047  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
13048  *             return (-1,) * self.view.ndim
13049  *
13050  */
13051   }
13052 
13053   /* "View.MemoryView":575
13054  *             return (-1,) * self.view.ndim
13055  *
13056  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
13057  *
13058  *     @property
13059  */
13060   __Pyx_XDECREF(__pyx_r);
13061   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 575, __pyx_L1_error)
13062   __Pyx_GOTREF(__pyx_t_3);
13063   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13064   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13065     __pyx_t_4 = __pyx_t_6;
13066     __pyx_v_suboffset = (__pyx_t_4[0]);
13067     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 575, __pyx_L1_error)
13068     __Pyx_GOTREF(__pyx_t_2);
13069     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(3, 575, __pyx_L1_error)
13070     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13071   }
13072   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 575, __pyx_L1_error)
13073   __Pyx_GOTREF(__pyx_t_2);
13074   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13075   __pyx_r = __pyx_t_2;
13076   __pyx_t_2 = 0;
13077   goto __pyx_L0;
13078 
13079   /* "View.MemoryView":571
13080  *
13081  *     @property
13082  *     def suboffsets(self):             # <<<<<<<<<<<<<<
13083  *         if self.view.suboffsets == NULL:
13084  *             return (-1,) * self.view.ndim
13085  */
13086 
13087   /* function exit code */
13088   __pyx_L1_error:;
13089   __Pyx_XDECREF(__pyx_t_2);
13090   __Pyx_XDECREF(__pyx_t_3);
13091   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13092   __pyx_r = NULL;
13093   __pyx_L0:;
13094   __Pyx_XGIVEREF(__pyx_r);
13095   __Pyx_RefNannyFinishContext();
13096   return __pyx_r;
13097 }
13098 
13099 /* "View.MemoryView":578
13100  *
13101  *     @property
13102  *     def ndim(self):             # <<<<<<<<<<<<<<
13103  *         return self.view.ndim
13104  *
13105  */
13106 
13107 /* Python wrapper */
13108 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)13109 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13110   PyObject *__pyx_r = 0;
13111   __Pyx_RefNannyDeclarations
13112   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13113   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13114 
13115   /* function exit code */
13116   __Pyx_RefNannyFinishContext();
13117   return __pyx_r;
13118 }
13119 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)13120 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13121   PyObject *__pyx_r = NULL;
13122   __Pyx_RefNannyDeclarations
13123   PyObject *__pyx_t_1 = NULL;
13124   __Pyx_RefNannySetupContext("__get__", 0);
13125 
13126   /* "View.MemoryView":579
13127  *     @property
13128  *     def ndim(self):
13129  *         return self.view.ndim             # <<<<<<<<<<<<<<
13130  *
13131  *     @property
13132  */
13133   __Pyx_XDECREF(__pyx_r);
13134   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 579, __pyx_L1_error)
13135   __Pyx_GOTREF(__pyx_t_1);
13136   __pyx_r = __pyx_t_1;
13137   __pyx_t_1 = 0;
13138   goto __pyx_L0;
13139 
13140   /* "View.MemoryView":578
13141  *
13142  *     @property
13143  *     def ndim(self):             # <<<<<<<<<<<<<<
13144  *         return self.view.ndim
13145  *
13146  */
13147 
13148   /* function exit code */
13149   __pyx_L1_error:;
13150   __Pyx_XDECREF(__pyx_t_1);
13151   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13152   __pyx_r = NULL;
13153   __pyx_L0:;
13154   __Pyx_XGIVEREF(__pyx_r);
13155   __Pyx_RefNannyFinishContext();
13156   return __pyx_r;
13157 }
13158 
13159 /* "View.MemoryView":582
13160  *
13161  *     @property
13162  *     def itemsize(self):             # <<<<<<<<<<<<<<
13163  *         return self.view.itemsize
13164  *
13165  */
13166 
13167 /* Python wrapper */
13168 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)13169 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13170   PyObject *__pyx_r = 0;
13171   __Pyx_RefNannyDeclarations
13172   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13173   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13174 
13175   /* function exit code */
13176   __Pyx_RefNannyFinishContext();
13177   return __pyx_r;
13178 }
13179 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)13180 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13181   PyObject *__pyx_r = NULL;
13182   __Pyx_RefNannyDeclarations
13183   PyObject *__pyx_t_1 = NULL;
13184   __Pyx_RefNannySetupContext("__get__", 0);
13185 
13186   /* "View.MemoryView":583
13187  *     @property
13188  *     def itemsize(self):
13189  *         return self.view.itemsize             # <<<<<<<<<<<<<<
13190  *
13191  *     @property
13192  */
13193   __Pyx_XDECREF(__pyx_r);
13194   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 583, __pyx_L1_error)
13195   __Pyx_GOTREF(__pyx_t_1);
13196   __pyx_r = __pyx_t_1;
13197   __pyx_t_1 = 0;
13198   goto __pyx_L0;
13199 
13200   /* "View.MemoryView":582
13201  *
13202  *     @property
13203  *     def itemsize(self):             # <<<<<<<<<<<<<<
13204  *         return self.view.itemsize
13205  *
13206  */
13207 
13208   /* function exit code */
13209   __pyx_L1_error:;
13210   __Pyx_XDECREF(__pyx_t_1);
13211   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13212   __pyx_r = NULL;
13213   __pyx_L0:;
13214   __Pyx_XGIVEREF(__pyx_r);
13215   __Pyx_RefNannyFinishContext();
13216   return __pyx_r;
13217 }
13218 
13219 /* "View.MemoryView":586
13220  *
13221  *     @property
13222  *     def nbytes(self):             # <<<<<<<<<<<<<<
13223  *         return self.size * self.view.itemsize
13224  *
13225  */
13226 
13227 /* Python wrapper */
13228 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)13229 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13230   PyObject *__pyx_r = 0;
13231   __Pyx_RefNannyDeclarations
13232   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13233   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13234 
13235   /* function exit code */
13236   __Pyx_RefNannyFinishContext();
13237   return __pyx_r;
13238 }
13239 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)13240 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13241   PyObject *__pyx_r = NULL;
13242   __Pyx_RefNannyDeclarations
13243   PyObject *__pyx_t_1 = NULL;
13244   PyObject *__pyx_t_2 = NULL;
13245   PyObject *__pyx_t_3 = NULL;
13246   __Pyx_RefNannySetupContext("__get__", 0);
13247 
13248   /* "View.MemoryView":587
13249  *     @property
13250  *     def nbytes(self):
13251  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
13252  *
13253  *     @property
13254  */
13255   __Pyx_XDECREF(__pyx_r);
13256   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 587, __pyx_L1_error)
13257   __Pyx_GOTREF(__pyx_t_1);
13258   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 587, __pyx_L1_error)
13259   __Pyx_GOTREF(__pyx_t_2);
13260   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 587, __pyx_L1_error)
13261   __Pyx_GOTREF(__pyx_t_3);
13262   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13263   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13264   __pyx_r = __pyx_t_3;
13265   __pyx_t_3 = 0;
13266   goto __pyx_L0;
13267 
13268   /* "View.MemoryView":586
13269  *
13270  *     @property
13271  *     def nbytes(self):             # <<<<<<<<<<<<<<
13272  *         return self.size * self.view.itemsize
13273  *
13274  */
13275 
13276   /* function exit code */
13277   __pyx_L1_error:;
13278   __Pyx_XDECREF(__pyx_t_1);
13279   __Pyx_XDECREF(__pyx_t_2);
13280   __Pyx_XDECREF(__pyx_t_3);
13281   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13282   __pyx_r = NULL;
13283   __pyx_L0:;
13284   __Pyx_XGIVEREF(__pyx_r);
13285   __Pyx_RefNannyFinishContext();
13286   return __pyx_r;
13287 }
13288 
13289 /* "View.MemoryView":590
13290  *
13291  *     @property
13292  *     def size(self):             # <<<<<<<<<<<<<<
13293  *         if self._size is None:
13294  *             result = 1
13295  */
13296 
13297 /* Python wrapper */
13298 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)13299 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13300   PyObject *__pyx_r = 0;
13301   __Pyx_RefNannyDeclarations
13302   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13303   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13304 
13305   /* function exit code */
13306   __Pyx_RefNannyFinishContext();
13307   return __pyx_r;
13308 }
13309 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)13310 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13311   PyObject *__pyx_v_result = NULL;
13312   PyObject *__pyx_v_length = NULL;
13313   PyObject *__pyx_r = NULL;
13314   __Pyx_RefNannyDeclarations
13315   int __pyx_t_1;
13316   int __pyx_t_2;
13317   Py_ssize_t *__pyx_t_3;
13318   Py_ssize_t *__pyx_t_4;
13319   Py_ssize_t *__pyx_t_5;
13320   PyObject *__pyx_t_6 = NULL;
13321   __Pyx_RefNannySetupContext("__get__", 0);
13322 
13323   /* "View.MemoryView":591
13324  *     @property
13325  *     def size(self):
13326  *         if self._size is None:             # <<<<<<<<<<<<<<
13327  *             result = 1
13328  *
13329  */
13330   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13331   __pyx_t_2 = (__pyx_t_1 != 0);
13332   if (__pyx_t_2) {
13333 
13334     /* "View.MemoryView":592
13335  *     def size(self):
13336  *         if self._size is None:
13337  *             result = 1             # <<<<<<<<<<<<<<
13338  *
13339  *             for length in self.view.shape[:self.view.ndim]:
13340  */
13341     __Pyx_INCREF(__pyx_int_1);
13342     __pyx_v_result = __pyx_int_1;
13343 
13344     /* "View.MemoryView":594
13345  *             result = 1
13346  *
13347  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
13348  *                 result *= length
13349  *
13350  */
13351     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13352     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13353       __pyx_t_3 = __pyx_t_5;
13354       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 594, __pyx_L1_error)
13355       __Pyx_GOTREF(__pyx_t_6);
13356       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13357       __pyx_t_6 = 0;
13358 
13359       /* "View.MemoryView":595
13360  *
13361  *             for length in self.view.shape[:self.view.ndim]:
13362  *                 result *= length             # <<<<<<<<<<<<<<
13363  *
13364  *             self._size = result
13365  */
13366       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 595, __pyx_L1_error)
13367       __Pyx_GOTREF(__pyx_t_6);
13368       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13369       __pyx_t_6 = 0;
13370     }
13371 
13372     /* "View.MemoryView":597
13373  *                 result *= length
13374  *
13375  *             self._size = result             # <<<<<<<<<<<<<<
13376  *
13377  *         return self._size
13378  */
13379     __Pyx_INCREF(__pyx_v_result);
13380     __Pyx_GIVEREF(__pyx_v_result);
13381     __Pyx_GOTREF(__pyx_v_self->_size);
13382     __Pyx_DECREF(__pyx_v_self->_size);
13383     __pyx_v_self->_size = __pyx_v_result;
13384 
13385     /* "View.MemoryView":591
13386  *     @property
13387  *     def size(self):
13388  *         if self._size is None:             # <<<<<<<<<<<<<<
13389  *             result = 1
13390  *
13391  */
13392   }
13393 
13394   /* "View.MemoryView":599
13395  *             self._size = result
13396  *
13397  *         return self._size             # <<<<<<<<<<<<<<
13398  *
13399  *     def __len__(self):
13400  */
13401   __Pyx_XDECREF(__pyx_r);
13402   __Pyx_INCREF(__pyx_v_self->_size);
13403   __pyx_r = __pyx_v_self->_size;
13404   goto __pyx_L0;
13405 
13406   /* "View.MemoryView":590
13407  *
13408  *     @property
13409  *     def size(self):             # <<<<<<<<<<<<<<
13410  *         if self._size is None:
13411  *             result = 1
13412  */
13413 
13414   /* function exit code */
13415   __pyx_L1_error:;
13416   __Pyx_XDECREF(__pyx_t_6);
13417   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13418   __pyx_r = NULL;
13419   __pyx_L0:;
13420   __Pyx_XDECREF(__pyx_v_result);
13421   __Pyx_XDECREF(__pyx_v_length);
13422   __Pyx_XGIVEREF(__pyx_r);
13423   __Pyx_RefNannyFinishContext();
13424   return __pyx_r;
13425 }
13426 
13427 /* "View.MemoryView":601
13428  *         return self._size
13429  *
13430  *     def __len__(self):             # <<<<<<<<<<<<<<
13431  *         if self.view.ndim >= 1:
13432  *             return self.view.shape[0]
13433  */
13434 
13435 /* Python wrapper */
13436 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)13437 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13438   Py_ssize_t __pyx_r;
13439   __Pyx_RefNannyDeclarations
13440   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13441   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13442 
13443   /* function exit code */
13444   __Pyx_RefNannyFinishContext();
13445   return __pyx_r;
13446 }
13447 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)13448 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13449   Py_ssize_t __pyx_r;
13450   __Pyx_RefNannyDeclarations
13451   int __pyx_t_1;
13452   __Pyx_RefNannySetupContext("__len__", 0);
13453 
13454   /* "View.MemoryView":602
13455  *
13456  *     def __len__(self):
13457  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
13458  *             return self.view.shape[0]
13459  *
13460  */
13461   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13462   if (__pyx_t_1) {
13463 
13464     /* "View.MemoryView":603
13465  *     def __len__(self):
13466  *         if self.view.ndim >= 1:
13467  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
13468  *
13469  *         return 0
13470  */
13471     __pyx_r = (__pyx_v_self->view.shape[0]);
13472     goto __pyx_L0;
13473 
13474     /* "View.MemoryView":602
13475  *
13476  *     def __len__(self):
13477  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
13478  *             return self.view.shape[0]
13479  *
13480  */
13481   }
13482 
13483   /* "View.MemoryView":605
13484  *             return self.view.shape[0]
13485  *
13486  *         return 0             # <<<<<<<<<<<<<<
13487  *
13488  *     def __repr__(self):
13489  */
13490   __pyx_r = 0;
13491   goto __pyx_L0;
13492 
13493   /* "View.MemoryView":601
13494  *         return self._size
13495  *
13496  *     def __len__(self):             # <<<<<<<<<<<<<<
13497  *         if self.view.ndim >= 1:
13498  *             return self.view.shape[0]
13499  */
13500 
13501   /* function exit code */
13502   __pyx_L0:;
13503   __Pyx_RefNannyFinishContext();
13504   return __pyx_r;
13505 }
13506 
13507 /* "View.MemoryView":607
13508  *         return 0
13509  *
13510  *     def __repr__(self):             # <<<<<<<<<<<<<<
13511  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13512  *                                                id(self))
13513  */
13514 
13515 /* Python wrapper */
13516 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)13517 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13518   PyObject *__pyx_r = 0;
13519   __Pyx_RefNannyDeclarations
13520   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13521   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13522 
13523   /* function exit code */
13524   __Pyx_RefNannyFinishContext();
13525   return __pyx_r;
13526 }
13527 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)13528 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13529   PyObject *__pyx_r = NULL;
13530   __Pyx_RefNannyDeclarations
13531   PyObject *__pyx_t_1 = NULL;
13532   PyObject *__pyx_t_2 = NULL;
13533   PyObject *__pyx_t_3 = NULL;
13534   __Pyx_RefNannySetupContext("__repr__", 0);
13535 
13536   /* "View.MemoryView":608
13537  *
13538  *     def __repr__(self):
13539  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
13540  *                                                id(self))
13541  *
13542  */
13543   __Pyx_XDECREF(__pyx_r);
13544   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 608, __pyx_L1_error)
13545   __Pyx_GOTREF(__pyx_t_1);
13546   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 608, __pyx_L1_error)
13547   __Pyx_GOTREF(__pyx_t_2);
13548   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13549   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 608, __pyx_L1_error)
13550   __Pyx_GOTREF(__pyx_t_1);
13551   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13552 
13553   /* "View.MemoryView":609
13554  *     def __repr__(self):
13555  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13556  *                                                id(self))             # <<<<<<<<<<<<<<
13557  *
13558  *     def __str__(self):
13559  */
13560   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 609, __pyx_L1_error)
13561   __Pyx_GOTREF(__pyx_t_2);
13562 
13563   /* "View.MemoryView":608
13564  *
13565  *     def __repr__(self):
13566  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
13567  *                                                id(self))
13568  *
13569  */
13570   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 608, __pyx_L1_error)
13571   __Pyx_GOTREF(__pyx_t_3);
13572   __Pyx_GIVEREF(__pyx_t_1);
13573   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13574   __Pyx_GIVEREF(__pyx_t_2);
13575   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13576   __pyx_t_1 = 0;
13577   __pyx_t_2 = 0;
13578   __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(3, 608, __pyx_L1_error)
13579   __Pyx_GOTREF(__pyx_t_2);
13580   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13581   __pyx_r = __pyx_t_2;
13582   __pyx_t_2 = 0;
13583   goto __pyx_L0;
13584 
13585   /* "View.MemoryView":607
13586  *         return 0
13587  *
13588  *     def __repr__(self):             # <<<<<<<<<<<<<<
13589  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13590  *                                                id(self))
13591  */
13592 
13593   /* function exit code */
13594   __pyx_L1_error:;
13595   __Pyx_XDECREF(__pyx_t_1);
13596   __Pyx_XDECREF(__pyx_t_2);
13597   __Pyx_XDECREF(__pyx_t_3);
13598   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13599   __pyx_r = NULL;
13600   __pyx_L0:;
13601   __Pyx_XGIVEREF(__pyx_r);
13602   __Pyx_RefNannyFinishContext();
13603   return __pyx_r;
13604 }
13605 
13606 /* "View.MemoryView":611
13607  *                                                id(self))
13608  *
13609  *     def __str__(self):             # <<<<<<<<<<<<<<
13610  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13611  *
13612  */
13613 
13614 /* Python wrapper */
13615 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)13616 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13617   PyObject *__pyx_r = 0;
13618   __Pyx_RefNannyDeclarations
13619   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13620   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13621 
13622   /* function exit code */
13623   __Pyx_RefNannyFinishContext();
13624   return __pyx_r;
13625 }
13626 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)13627 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13628   PyObject *__pyx_r = NULL;
13629   __Pyx_RefNannyDeclarations
13630   PyObject *__pyx_t_1 = NULL;
13631   PyObject *__pyx_t_2 = NULL;
13632   __Pyx_RefNannySetupContext("__str__", 0);
13633 
13634   /* "View.MemoryView":612
13635  *
13636  *     def __str__(self):
13637  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
13638  *
13639  *
13640  */
13641   __Pyx_XDECREF(__pyx_r);
13642   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 612, __pyx_L1_error)
13643   __Pyx_GOTREF(__pyx_t_1);
13644   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 612, __pyx_L1_error)
13645   __Pyx_GOTREF(__pyx_t_2);
13646   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13647   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 612, __pyx_L1_error)
13648   __Pyx_GOTREF(__pyx_t_1);
13649   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13650   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 612, __pyx_L1_error)
13651   __Pyx_GOTREF(__pyx_t_2);
13652   __Pyx_GIVEREF(__pyx_t_1);
13653   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13654   __pyx_t_1 = 0;
13655   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 612, __pyx_L1_error)
13656   __Pyx_GOTREF(__pyx_t_1);
13657   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13658   __pyx_r = __pyx_t_1;
13659   __pyx_t_1 = 0;
13660   goto __pyx_L0;
13661 
13662   /* "View.MemoryView":611
13663  *                                                id(self))
13664  *
13665  *     def __str__(self):             # <<<<<<<<<<<<<<
13666  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13667  *
13668  */
13669 
13670   /* function exit code */
13671   __pyx_L1_error:;
13672   __Pyx_XDECREF(__pyx_t_1);
13673   __Pyx_XDECREF(__pyx_t_2);
13674   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13675   __pyx_r = NULL;
13676   __pyx_L0:;
13677   __Pyx_XGIVEREF(__pyx_r);
13678   __Pyx_RefNannyFinishContext();
13679   return __pyx_r;
13680 }
13681 
13682 /* "View.MemoryView":615
13683  *
13684  *
13685  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
13686  *         cdef __Pyx_memviewslice *mslice
13687  *         cdef __Pyx_memviewslice tmp
13688  */
13689 
13690 /* Python wrapper */
13691 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)13692 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13693   PyObject *__pyx_r = 0;
13694   __Pyx_RefNannyDeclarations
13695   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13696   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13697 
13698   /* function exit code */
13699   __Pyx_RefNannyFinishContext();
13700   return __pyx_r;
13701 }
13702 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)13703 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13704   __Pyx_memviewslice *__pyx_v_mslice;
13705   __Pyx_memviewslice __pyx_v_tmp;
13706   PyObject *__pyx_r = NULL;
13707   __Pyx_RefNannyDeclarations
13708   PyObject *__pyx_t_1 = NULL;
13709   __Pyx_RefNannySetupContext("is_c_contig", 0);
13710 
13711   /* "View.MemoryView":618
13712  *         cdef __Pyx_memviewslice *mslice
13713  *         cdef __Pyx_memviewslice tmp
13714  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
13715  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
13716  *
13717  */
13718   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13719 
13720   /* "View.MemoryView":619
13721  *         cdef __Pyx_memviewslice tmp
13722  *         mslice = get_slice_from_memview(self, &tmp)
13723  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
13724  *
13725  *     def is_f_contig(self):
13726  */
13727   __Pyx_XDECREF(__pyx_r);
13728   __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(3, 619, __pyx_L1_error)
13729   __Pyx_GOTREF(__pyx_t_1);
13730   __pyx_r = __pyx_t_1;
13731   __pyx_t_1 = 0;
13732   goto __pyx_L0;
13733 
13734   /* "View.MemoryView":615
13735  *
13736  *
13737  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
13738  *         cdef __Pyx_memviewslice *mslice
13739  *         cdef __Pyx_memviewslice tmp
13740  */
13741 
13742   /* function exit code */
13743   __pyx_L1_error:;
13744   __Pyx_XDECREF(__pyx_t_1);
13745   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13746   __pyx_r = NULL;
13747   __pyx_L0:;
13748   __Pyx_XGIVEREF(__pyx_r);
13749   __Pyx_RefNannyFinishContext();
13750   return __pyx_r;
13751 }
13752 
13753 /* "View.MemoryView":621
13754  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
13755  *
13756  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
13757  *         cdef __Pyx_memviewslice *mslice
13758  *         cdef __Pyx_memviewslice tmp
13759  */
13760 
13761 /* Python wrapper */
13762 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)13763 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13764   PyObject *__pyx_r = 0;
13765   __Pyx_RefNannyDeclarations
13766   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13767   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13768 
13769   /* function exit code */
13770   __Pyx_RefNannyFinishContext();
13771   return __pyx_r;
13772 }
13773 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)13774 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13775   __Pyx_memviewslice *__pyx_v_mslice;
13776   __Pyx_memviewslice __pyx_v_tmp;
13777   PyObject *__pyx_r = NULL;
13778   __Pyx_RefNannyDeclarations
13779   PyObject *__pyx_t_1 = NULL;
13780   __Pyx_RefNannySetupContext("is_f_contig", 0);
13781 
13782   /* "View.MemoryView":624
13783  *         cdef __Pyx_memviewslice *mslice
13784  *         cdef __Pyx_memviewslice tmp
13785  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
13786  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
13787  *
13788  */
13789   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13790 
13791   /* "View.MemoryView":625
13792  *         cdef __Pyx_memviewslice tmp
13793  *         mslice = get_slice_from_memview(self, &tmp)
13794  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
13795  *
13796  *     def copy(self):
13797  */
13798   __Pyx_XDECREF(__pyx_r);
13799   __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(3, 625, __pyx_L1_error)
13800   __Pyx_GOTREF(__pyx_t_1);
13801   __pyx_r = __pyx_t_1;
13802   __pyx_t_1 = 0;
13803   goto __pyx_L0;
13804 
13805   /* "View.MemoryView":621
13806  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
13807  *
13808  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
13809  *         cdef __Pyx_memviewslice *mslice
13810  *         cdef __Pyx_memviewslice tmp
13811  */
13812 
13813   /* function exit code */
13814   __pyx_L1_error:;
13815   __Pyx_XDECREF(__pyx_t_1);
13816   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13817   __pyx_r = NULL;
13818   __pyx_L0:;
13819   __Pyx_XGIVEREF(__pyx_r);
13820   __Pyx_RefNannyFinishContext();
13821   return __pyx_r;
13822 }
13823 
13824 /* "View.MemoryView":627
13825  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
13826  *
13827  *     def copy(self):             # <<<<<<<<<<<<<<
13828  *         cdef __Pyx_memviewslice mslice
13829  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13830  */
13831 
13832 /* Python wrapper */
13833 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)13834 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13835   PyObject *__pyx_r = 0;
13836   __Pyx_RefNannyDeclarations
13837   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13838   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13839 
13840   /* function exit code */
13841   __Pyx_RefNannyFinishContext();
13842   return __pyx_r;
13843 }
13844 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)13845 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13846   __Pyx_memviewslice __pyx_v_mslice;
13847   int __pyx_v_flags;
13848   PyObject *__pyx_r = NULL;
13849   __Pyx_RefNannyDeclarations
13850   __Pyx_memviewslice __pyx_t_1;
13851   PyObject *__pyx_t_2 = NULL;
13852   __Pyx_RefNannySetupContext("copy", 0);
13853 
13854   /* "View.MemoryView":629
13855  *     def copy(self):
13856  *         cdef __Pyx_memviewslice mslice
13857  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
13858  *
13859  *         slice_copy(self, &mslice)
13860  */
13861   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13862 
13863   /* "View.MemoryView":631
13864  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13865  *
13866  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
13867  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13868  *                                    self.view.itemsize,
13869  */
13870   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13871 
13872   /* "View.MemoryView":632
13873  *
13874  *         slice_copy(self, &mslice)
13875  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
13876  *                                    self.view.itemsize,
13877  *                                    flags|PyBUF_C_CONTIGUOUS,
13878  */
13879   __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(3, 632, __pyx_L1_error)
13880   __pyx_v_mslice = __pyx_t_1;
13881 
13882   /* "View.MemoryView":637
13883  *                                    self.dtype_is_object)
13884  *
13885  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
13886  *
13887  *     def copy_fortran(self):
13888  */
13889   __Pyx_XDECREF(__pyx_r);
13890   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 637, __pyx_L1_error)
13891   __Pyx_GOTREF(__pyx_t_2);
13892   __pyx_r = __pyx_t_2;
13893   __pyx_t_2 = 0;
13894   goto __pyx_L0;
13895 
13896   /* "View.MemoryView":627
13897  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
13898  *
13899  *     def copy(self):             # <<<<<<<<<<<<<<
13900  *         cdef __Pyx_memviewslice mslice
13901  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13902  */
13903 
13904   /* function exit code */
13905   __pyx_L1_error:;
13906   __Pyx_XDECREF(__pyx_t_2);
13907   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13908   __pyx_r = NULL;
13909   __pyx_L0:;
13910   __Pyx_XGIVEREF(__pyx_r);
13911   __Pyx_RefNannyFinishContext();
13912   return __pyx_r;
13913 }
13914 
13915 /* "View.MemoryView":639
13916  *         return memoryview_copy_from_slice(self, &mslice)
13917  *
13918  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
13919  *         cdef __Pyx_memviewslice src, dst
13920  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13921  */
13922 
13923 /* Python wrapper */
13924 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)13925 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13926   PyObject *__pyx_r = 0;
13927   __Pyx_RefNannyDeclarations
13928   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13929   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13930 
13931   /* function exit code */
13932   __Pyx_RefNannyFinishContext();
13933   return __pyx_r;
13934 }
13935 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)13936 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13937   __Pyx_memviewslice __pyx_v_src;
13938   __Pyx_memviewslice __pyx_v_dst;
13939   int __pyx_v_flags;
13940   PyObject *__pyx_r = NULL;
13941   __Pyx_RefNannyDeclarations
13942   __Pyx_memviewslice __pyx_t_1;
13943   PyObject *__pyx_t_2 = NULL;
13944   __Pyx_RefNannySetupContext("copy_fortran", 0);
13945 
13946   /* "View.MemoryView":641
13947  *     def copy_fortran(self):
13948  *         cdef __Pyx_memviewslice src, dst
13949  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
13950  *
13951  *         slice_copy(self, &src)
13952  */
13953   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13954 
13955   /* "View.MemoryView":643
13956  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13957  *
13958  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
13959  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13960  *                                 self.view.itemsize,
13961  */
13962   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13963 
13964   /* "View.MemoryView":644
13965  *
13966  *         slice_copy(self, &src)
13967  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
13968  *                                 self.view.itemsize,
13969  *                                 flags|PyBUF_F_CONTIGUOUS,
13970  */
13971   __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(3, 644, __pyx_L1_error)
13972   __pyx_v_dst = __pyx_t_1;
13973 
13974   /* "View.MemoryView":649
13975  *                                 self.dtype_is_object)
13976  *
13977  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
13978  *
13979  *
13980  */
13981   __Pyx_XDECREF(__pyx_r);
13982   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error)
13983   __Pyx_GOTREF(__pyx_t_2);
13984   __pyx_r = __pyx_t_2;
13985   __pyx_t_2 = 0;
13986   goto __pyx_L0;
13987 
13988   /* "View.MemoryView":639
13989  *         return memoryview_copy_from_slice(self, &mslice)
13990  *
13991  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
13992  *         cdef __Pyx_memviewslice src, dst
13993  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13994  */
13995 
13996   /* function exit code */
13997   __pyx_L1_error:;
13998   __Pyx_XDECREF(__pyx_t_2);
13999   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14000   __pyx_r = NULL;
14001   __pyx_L0:;
14002   __Pyx_XGIVEREF(__pyx_r);
14003   __Pyx_RefNannyFinishContext();
14004   return __pyx_r;
14005 }
14006 
14007 /* "(tree fragment)":1
14008  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14009  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14010  * def __setstate_cython__(self, __pyx_state):
14011  */
14012 
14013 /* Python wrapper */
14014 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)14015 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14016   PyObject *__pyx_r = 0;
14017   __Pyx_RefNannyDeclarations
14018   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14019   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14020 
14021   /* function exit code */
14022   __Pyx_RefNannyFinishContext();
14023   return __pyx_r;
14024 }
14025 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)14026 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14027   PyObject *__pyx_r = NULL;
14028   __Pyx_RefNannyDeclarations
14029   PyObject *__pyx_t_1 = NULL;
14030   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14031 
14032   /* "(tree fragment)":2
14033  * def __reduce_cython__(self):
14034  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
14035  * def __setstate_cython__(self, __pyx_state):
14036  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14037  */
14038   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error)
14039   __Pyx_GOTREF(__pyx_t_1);
14040   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14041   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14042   __PYX_ERR(3, 2, __pyx_L1_error)
14043 
14044   /* "(tree fragment)":1
14045  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14046  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14047  * def __setstate_cython__(self, __pyx_state):
14048  */
14049 
14050   /* function exit code */
14051   __pyx_L1_error:;
14052   __Pyx_XDECREF(__pyx_t_1);
14053   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14054   __pyx_r = NULL;
14055   __Pyx_XGIVEREF(__pyx_r);
14056   __Pyx_RefNannyFinishContext();
14057   return __pyx_r;
14058 }
14059 
14060 /* "(tree fragment)":3
14061  * def __reduce_cython__(self):
14062  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14063  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14064  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14065  */
14066 
14067 /* Python wrapper */
14068 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)14069 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14070   PyObject *__pyx_r = 0;
14071   __Pyx_RefNannyDeclarations
14072   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14073   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14074 
14075   /* function exit code */
14076   __Pyx_RefNannyFinishContext();
14077   return __pyx_r;
14078 }
14079 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)14080 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) {
14081   PyObject *__pyx_r = NULL;
14082   __Pyx_RefNannyDeclarations
14083   PyObject *__pyx_t_1 = NULL;
14084   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14085 
14086   /* "(tree fragment)":4
14087  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14088  * def __setstate_cython__(self, __pyx_state):
14089  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
14090  */
14091   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
14092   __Pyx_GOTREF(__pyx_t_1);
14093   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14094   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14095   __PYX_ERR(3, 4, __pyx_L1_error)
14096 
14097   /* "(tree fragment)":3
14098  * def __reduce_cython__(self):
14099  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14100  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14101  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14102  */
14103 
14104   /* function exit code */
14105   __pyx_L1_error:;
14106   __Pyx_XDECREF(__pyx_t_1);
14107   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14108   __pyx_r = NULL;
14109   __Pyx_XGIVEREF(__pyx_r);
14110   __Pyx_RefNannyFinishContext();
14111   return __pyx_r;
14112 }
14113 
14114 /* "View.MemoryView":653
14115  *
14116  * @cname('__pyx_memoryview_new')
14117  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
14118  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
14119  *     result.typeinfo = typeinfo
14120  */
14121 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)14122 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14123   struct __pyx_memoryview_obj *__pyx_v_result = 0;
14124   PyObject *__pyx_r = NULL;
14125   __Pyx_RefNannyDeclarations
14126   PyObject *__pyx_t_1 = NULL;
14127   PyObject *__pyx_t_2 = NULL;
14128   PyObject *__pyx_t_3 = NULL;
14129   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14130 
14131   /* "View.MemoryView":654
14132  * @cname('__pyx_memoryview_new')
14133  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14134  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
14135  *     result.typeinfo = typeinfo
14136  *     return result
14137  */
14138   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 654, __pyx_L1_error)
14139   __Pyx_GOTREF(__pyx_t_1);
14140   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
14141   __Pyx_GOTREF(__pyx_t_2);
14142   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 654, __pyx_L1_error)
14143   __Pyx_GOTREF(__pyx_t_3);
14144   __Pyx_INCREF(__pyx_v_o);
14145   __Pyx_GIVEREF(__pyx_v_o);
14146   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14147   __Pyx_GIVEREF(__pyx_t_1);
14148   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14149   __Pyx_GIVEREF(__pyx_t_2);
14150   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14151   __pyx_t_1 = 0;
14152   __pyx_t_2 = 0;
14153   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
14154   __Pyx_GOTREF(__pyx_t_2);
14155   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14156   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14157   __pyx_t_2 = 0;
14158 
14159   /* "View.MemoryView":655
14160  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14161  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
14162  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
14163  *     return result
14164  *
14165  */
14166   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14167 
14168   /* "View.MemoryView":656
14169  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
14170  *     result.typeinfo = typeinfo
14171  *     return result             # <<<<<<<<<<<<<<
14172  *
14173  * @cname('__pyx_memoryview_check')
14174  */
14175   __Pyx_XDECREF(__pyx_r);
14176   __Pyx_INCREF(((PyObject *)__pyx_v_result));
14177   __pyx_r = ((PyObject *)__pyx_v_result);
14178   goto __pyx_L0;
14179 
14180   /* "View.MemoryView":653
14181  *
14182  * @cname('__pyx_memoryview_new')
14183  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
14184  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
14185  *     result.typeinfo = typeinfo
14186  */
14187 
14188   /* function exit code */
14189   __pyx_L1_error:;
14190   __Pyx_XDECREF(__pyx_t_1);
14191   __Pyx_XDECREF(__pyx_t_2);
14192   __Pyx_XDECREF(__pyx_t_3);
14193   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14194   __pyx_r = 0;
14195   __pyx_L0:;
14196   __Pyx_XDECREF((PyObject *)__pyx_v_result);
14197   __Pyx_XGIVEREF(__pyx_r);
14198   __Pyx_RefNannyFinishContext();
14199   return __pyx_r;
14200 }
14201 
14202 /* "View.MemoryView":659
14203  *
14204  * @cname('__pyx_memoryview_check')
14205  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
14206  *     return isinstance(o, memoryview)
14207  *
14208  */
14209 
__pyx_memoryview_check(PyObject * __pyx_v_o)14210 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14211   int __pyx_r;
14212   __Pyx_RefNannyDeclarations
14213   int __pyx_t_1;
14214   __Pyx_RefNannySetupContext("memoryview_check", 0);
14215 
14216   /* "View.MemoryView":660
14217  * @cname('__pyx_memoryview_check')
14218  * cdef inline bint memoryview_check(object o):
14219  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
14220  *
14221  * cdef tuple _unellipsify(object index, int ndim):
14222  */
14223   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14224   __pyx_r = __pyx_t_1;
14225   goto __pyx_L0;
14226 
14227   /* "View.MemoryView":659
14228  *
14229  * @cname('__pyx_memoryview_check')
14230  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
14231  *     return isinstance(o, memoryview)
14232  *
14233  */
14234 
14235   /* function exit code */
14236   __pyx_L0:;
14237   __Pyx_RefNannyFinishContext();
14238   return __pyx_r;
14239 }
14240 
14241 /* "View.MemoryView":662
14242  *     return isinstance(o, memoryview)
14243  *
14244  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
14245  *     """
14246  *     Replace all ellipses with full slices and fill incomplete indices with
14247  */
14248 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)14249 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14250   PyObject *__pyx_v_tup = NULL;
14251   PyObject *__pyx_v_result = NULL;
14252   int __pyx_v_have_slices;
14253   int __pyx_v_seen_ellipsis;
14254   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14255   PyObject *__pyx_v_item = NULL;
14256   Py_ssize_t __pyx_v_nslices;
14257   PyObject *__pyx_r = NULL;
14258   __Pyx_RefNannyDeclarations
14259   int __pyx_t_1;
14260   int __pyx_t_2;
14261   PyObject *__pyx_t_3 = NULL;
14262   PyObject *__pyx_t_4 = NULL;
14263   Py_ssize_t __pyx_t_5;
14264   PyObject *(*__pyx_t_6)(PyObject *);
14265   PyObject *__pyx_t_7 = NULL;
14266   Py_ssize_t __pyx_t_8;
14267   int __pyx_t_9;
14268   int __pyx_t_10;
14269   PyObject *__pyx_t_11 = NULL;
14270   __Pyx_RefNannySetupContext("_unellipsify", 0);
14271 
14272   /* "View.MemoryView":667
14273  *     full slices.
14274  *     """
14275  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
14276  *         tup = (index,)
14277  *     else:
14278  */
14279   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14280   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14281   if (__pyx_t_2) {
14282 
14283     /* "View.MemoryView":668
14284  *     """
14285  *     if not isinstance(index, tuple):
14286  *         tup = (index,)             # <<<<<<<<<<<<<<
14287  *     else:
14288  *         tup = index
14289  */
14290     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 668, __pyx_L1_error)
14291     __Pyx_GOTREF(__pyx_t_3);
14292     __Pyx_INCREF(__pyx_v_index);
14293     __Pyx_GIVEREF(__pyx_v_index);
14294     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14295     __pyx_v_tup = __pyx_t_3;
14296     __pyx_t_3 = 0;
14297 
14298     /* "View.MemoryView":667
14299  *     full slices.
14300  *     """
14301  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
14302  *         tup = (index,)
14303  *     else:
14304  */
14305     goto __pyx_L3;
14306   }
14307 
14308   /* "View.MemoryView":670
14309  *         tup = (index,)
14310  *     else:
14311  *         tup = index             # <<<<<<<<<<<<<<
14312  *
14313  *     result = []
14314  */
14315   /*else*/ {
14316     __Pyx_INCREF(__pyx_v_index);
14317     __pyx_v_tup = __pyx_v_index;
14318   }
14319   __pyx_L3:;
14320 
14321   /* "View.MemoryView":672
14322  *         tup = index
14323  *
14324  *     result = []             # <<<<<<<<<<<<<<
14325  *     have_slices = False
14326  *     seen_ellipsis = False
14327  */
14328   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 672, __pyx_L1_error)
14329   __Pyx_GOTREF(__pyx_t_3);
14330   __pyx_v_result = ((PyObject*)__pyx_t_3);
14331   __pyx_t_3 = 0;
14332 
14333   /* "View.MemoryView":673
14334  *
14335  *     result = []
14336  *     have_slices = False             # <<<<<<<<<<<<<<
14337  *     seen_ellipsis = False
14338  *     for idx, item in enumerate(tup):
14339  */
14340   __pyx_v_have_slices = 0;
14341 
14342   /* "View.MemoryView":674
14343  *     result = []
14344  *     have_slices = False
14345  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
14346  *     for idx, item in enumerate(tup):
14347  *         if item is Ellipsis:
14348  */
14349   __pyx_v_seen_ellipsis = 0;
14350 
14351   /* "View.MemoryView":675
14352  *     have_slices = False
14353  *     seen_ellipsis = False
14354  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
14355  *         if item is Ellipsis:
14356  *             if not seen_ellipsis:
14357  */
14358   __Pyx_INCREF(__pyx_int_0);
14359   __pyx_t_3 = __pyx_int_0;
14360   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14361     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14362     __pyx_t_6 = NULL;
14363   } else {
14364     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 675, __pyx_L1_error)
14365     __Pyx_GOTREF(__pyx_t_4);
14366     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 675, __pyx_L1_error)
14367   }
14368   for (;;) {
14369     if (likely(!__pyx_t_6)) {
14370       if (likely(PyList_CheckExact(__pyx_t_4))) {
14371         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14372         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14373         __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(3, 675, __pyx_L1_error)
14374         #else
14375         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error)
14376         __Pyx_GOTREF(__pyx_t_7);
14377         #endif
14378       } else {
14379         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14380         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14381         __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(3, 675, __pyx_L1_error)
14382         #else
14383         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error)
14384         __Pyx_GOTREF(__pyx_t_7);
14385         #endif
14386       }
14387     } else {
14388       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14389       if (unlikely(!__pyx_t_7)) {
14390         PyObject* exc_type = PyErr_Occurred();
14391         if (exc_type) {
14392           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14393           else __PYX_ERR(3, 675, __pyx_L1_error)
14394         }
14395         break;
14396       }
14397       __Pyx_GOTREF(__pyx_t_7);
14398     }
14399     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14400     __pyx_t_7 = 0;
14401     __Pyx_INCREF(__pyx_t_3);
14402     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14403     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 675, __pyx_L1_error)
14404     __Pyx_GOTREF(__pyx_t_7);
14405     __Pyx_DECREF(__pyx_t_3);
14406     __pyx_t_3 = __pyx_t_7;
14407     __pyx_t_7 = 0;
14408 
14409     /* "View.MemoryView":676
14410  *     seen_ellipsis = False
14411  *     for idx, item in enumerate(tup):
14412  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
14413  *             if not seen_ellipsis:
14414  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
14415  */
14416     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14417     __pyx_t_1 = (__pyx_t_2 != 0);
14418     if (__pyx_t_1) {
14419 
14420       /* "View.MemoryView":677
14421  *     for idx, item in enumerate(tup):
14422  *         if item is Ellipsis:
14423  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
14424  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
14425  *                 seen_ellipsis = True
14426  */
14427       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14428       if (__pyx_t_1) {
14429 
14430         /* "View.MemoryView":678
14431  *         if item is Ellipsis:
14432  *             if not seen_ellipsis:
14433  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
14434  *                 seen_ellipsis = True
14435  *             else:
14436  */
14437         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(3, 678, __pyx_L1_error)
14438         __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(3, 678, __pyx_L1_error)
14439         __Pyx_GOTREF(__pyx_t_7);
14440         { Py_ssize_t __pyx_temp;
14441           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14442             __Pyx_INCREF(__pyx_slice__22);
14443             __Pyx_GIVEREF(__pyx_slice__22);
14444             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
14445           }
14446         }
14447         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 678, __pyx_L1_error)
14448         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14449 
14450         /* "View.MemoryView":679
14451  *             if not seen_ellipsis:
14452  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
14453  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
14454  *             else:
14455  *                 result.append(slice(None))
14456  */
14457         __pyx_v_seen_ellipsis = 1;
14458 
14459         /* "View.MemoryView":677
14460  *     for idx, item in enumerate(tup):
14461  *         if item is Ellipsis:
14462  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
14463  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
14464  *                 seen_ellipsis = True
14465  */
14466         goto __pyx_L7;
14467       }
14468 
14469       /* "View.MemoryView":681
14470  *                 seen_ellipsis = True
14471  *             else:
14472  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
14473  *             have_slices = True
14474  *         else:
14475  */
14476       /*else*/ {
14477         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 681, __pyx_L1_error)
14478       }
14479       __pyx_L7:;
14480 
14481       /* "View.MemoryView":682
14482  *             else:
14483  *                 result.append(slice(None))
14484  *             have_slices = True             # <<<<<<<<<<<<<<
14485  *         else:
14486  *             if not isinstance(item, slice) and not PyIndex_Check(item):
14487  */
14488       __pyx_v_have_slices = 1;
14489 
14490       /* "View.MemoryView":676
14491  *     seen_ellipsis = False
14492  *     for idx, item in enumerate(tup):
14493  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
14494  *             if not seen_ellipsis:
14495  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
14496  */
14497       goto __pyx_L6;
14498     }
14499 
14500     /* "View.MemoryView":684
14501  *             have_slices = True
14502  *         else:
14503  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
14504  *                 raise TypeError("Cannot index with type '%s'" % type(item))
14505  *
14506  */
14507     /*else*/ {
14508       __pyx_t_2 = PySlice_Check(__pyx_v_item);
14509       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14510       if (__pyx_t_10) {
14511       } else {
14512         __pyx_t_1 = __pyx_t_10;
14513         goto __pyx_L9_bool_binop_done;
14514       }
14515       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14516       __pyx_t_1 = __pyx_t_10;
14517       __pyx_L9_bool_binop_done:;
14518       if (unlikely(__pyx_t_1)) {
14519 
14520         /* "View.MemoryView":685
14521  *         else:
14522  *             if not isinstance(item, slice) and not PyIndex_Check(item):
14523  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
14524  *
14525  *             have_slices = have_slices or isinstance(item, slice)
14526  */
14527         __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(3, 685, __pyx_L1_error)
14528         __Pyx_GOTREF(__pyx_t_7);
14529         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 685, __pyx_L1_error)
14530         __Pyx_GOTREF(__pyx_t_11);
14531         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14532         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14533         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14534         __PYX_ERR(3, 685, __pyx_L1_error)
14535 
14536         /* "View.MemoryView":684
14537  *             have_slices = True
14538  *         else:
14539  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
14540  *                 raise TypeError("Cannot index with type '%s'" % type(item))
14541  *
14542  */
14543       }
14544 
14545       /* "View.MemoryView":687
14546  *                 raise TypeError("Cannot index with type '%s'" % type(item))
14547  *
14548  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
14549  *             result.append(item)
14550  *
14551  */
14552       __pyx_t_10 = (__pyx_v_have_slices != 0);
14553       if (!__pyx_t_10) {
14554       } else {
14555         __pyx_t_1 = __pyx_t_10;
14556         goto __pyx_L11_bool_binop_done;
14557       }
14558       __pyx_t_10 = PySlice_Check(__pyx_v_item);
14559       __pyx_t_2 = (__pyx_t_10 != 0);
14560       __pyx_t_1 = __pyx_t_2;
14561       __pyx_L11_bool_binop_done:;
14562       __pyx_v_have_slices = __pyx_t_1;
14563 
14564       /* "View.MemoryView":688
14565  *
14566  *             have_slices = have_slices or isinstance(item, slice)
14567  *             result.append(item)             # <<<<<<<<<<<<<<
14568  *
14569  *     nslices = ndim - len(result)
14570  */
14571       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 688, __pyx_L1_error)
14572     }
14573     __pyx_L6:;
14574 
14575     /* "View.MemoryView":675
14576  *     have_slices = False
14577  *     seen_ellipsis = False
14578  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
14579  *         if item is Ellipsis:
14580  *             if not seen_ellipsis:
14581  */
14582   }
14583   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14584   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14585 
14586   /* "View.MemoryView":690
14587  *             result.append(item)
14588  *
14589  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
14590  *     if nslices:
14591  *         result.extend([slice(None)] * nslices)
14592  */
14593   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 690, __pyx_L1_error)
14594   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14595 
14596   /* "View.MemoryView":691
14597  *
14598  *     nslices = ndim - len(result)
14599  *     if nslices:             # <<<<<<<<<<<<<<
14600  *         result.extend([slice(None)] * nslices)
14601  *
14602  */
14603   __pyx_t_1 = (__pyx_v_nslices != 0);
14604   if (__pyx_t_1) {
14605 
14606     /* "View.MemoryView":692
14607  *     nslices = ndim - len(result)
14608  *     if nslices:
14609  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
14610  *
14611  *     return have_slices or nslices, tuple(result)
14612  */
14613     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 692, __pyx_L1_error)
14614     __Pyx_GOTREF(__pyx_t_3);
14615     { Py_ssize_t __pyx_temp;
14616       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14617         __Pyx_INCREF(__pyx_slice__22);
14618         __Pyx_GIVEREF(__pyx_slice__22);
14619         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
14620       }
14621     }
14622     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 692, __pyx_L1_error)
14623     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14624 
14625     /* "View.MemoryView":691
14626  *
14627  *     nslices = ndim - len(result)
14628  *     if nslices:             # <<<<<<<<<<<<<<
14629  *         result.extend([slice(None)] * nslices)
14630  *
14631  */
14632   }
14633 
14634   /* "View.MemoryView":694
14635  *         result.extend([slice(None)] * nslices)
14636  *
14637  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
14638  *
14639  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14640  */
14641   __Pyx_XDECREF(__pyx_r);
14642   if (!__pyx_v_have_slices) {
14643   } else {
14644     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 694, __pyx_L1_error)
14645     __Pyx_GOTREF(__pyx_t_4);
14646     __pyx_t_3 = __pyx_t_4;
14647     __pyx_t_4 = 0;
14648     goto __pyx_L14_bool_binop_done;
14649   }
14650   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 694, __pyx_L1_error)
14651   __Pyx_GOTREF(__pyx_t_4);
14652   __pyx_t_3 = __pyx_t_4;
14653   __pyx_t_4 = 0;
14654   __pyx_L14_bool_binop_done:;
14655   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 694, __pyx_L1_error)
14656   __Pyx_GOTREF(__pyx_t_4);
14657   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 694, __pyx_L1_error)
14658   __Pyx_GOTREF(__pyx_t_11);
14659   __Pyx_GIVEREF(__pyx_t_3);
14660   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14661   __Pyx_GIVEREF(__pyx_t_4);
14662   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14663   __pyx_t_3 = 0;
14664   __pyx_t_4 = 0;
14665   __pyx_r = ((PyObject*)__pyx_t_11);
14666   __pyx_t_11 = 0;
14667   goto __pyx_L0;
14668 
14669   /* "View.MemoryView":662
14670  *     return isinstance(o, memoryview)
14671  *
14672  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
14673  *     """
14674  *     Replace all ellipses with full slices and fill incomplete indices with
14675  */
14676 
14677   /* function exit code */
14678   __pyx_L1_error:;
14679   __Pyx_XDECREF(__pyx_t_3);
14680   __Pyx_XDECREF(__pyx_t_4);
14681   __Pyx_XDECREF(__pyx_t_7);
14682   __Pyx_XDECREF(__pyx_t_11);
14683   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14684   __pyx_r = 0;
14685   __pyx_L0:;
14686   __Pyx_XDECREF(__pyx_v_tup);
14687   __Pyx_XDECREF(__pyx_v_result);
14688   __Pyx_XDECREF(__pyx_v_idx);
14689   __Pyx_XDECREF(__pyx_v_item);
14690   __Pyx_XGIVEREF(__pyx_r);
14691   __Pyx_RefNannyFinishContext();
14692   return __pyx_r;
14693 }
14694 
14695 /* "View.MemoryView":696
14696  *     return have_slices or nslices, tuple(result)
14697  *
14698  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
14699  *     for suboffset in suboffsets[:ndim]:
14700  *         if suboffset >= 0:
14701  */
14702 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)14703 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14704   Py_ssize_t __pyx_v_suboffset;
14705   PyObject *__pyx_r = NULL;
14706   __Pyx_RefNannyDeclarations
14707   Py_ssize_t *__pyx_t_1;
14708   Py_ssize_t *__pyx_t_2;
14709   Py_ssize_t *__pyx_t_3;
14710   int __pyx_t_4;
14711   PyObject *__pyx_t_5 = NULL;
14712   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14713 
14714   /* "View.MemoryView":697
14715  *
14716  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14717  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
14718  *         if suboffset >= 0:
14719  *             raise ValueError("Indirect dimensions not supported")
14720  */
14721   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14722   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14723     __pyx_t_1 = __pyx_t_3;
14724     __pyx_v_suboffset = (__pyx_t_1[0]);
14725 
14726     /* "View.MemoryView":698
14727  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14728  *     for suboffset in suboffsets[:ndim]:
14729  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
14730  *             raise ValueError("Indirect dimensions not supported")
14731  *
14732  */
14733     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14734     if (unlikely(__pyx_t_4)) {
14735 
14736       /* "View.MemoryView":699
14737  *     for suboffset in suboffsets[:ndim]:
14738  *         if suboffset >= 0:
14739  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
14740  *
14741  *
14742  */
14743       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 699, __pyx_L1_error)
14744       __Pyx_GOTREF(__pyx_t_5);
14745       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14746       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14747       __PYX_ERR(3, 699, __pyx_L1_error)
14748 
14749       /* "View.MemoryView":698
14750  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14751  *     for suboffset in suboffsets[:ndim]:
14752  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
14753  *             raise ValueError("Indirect dimensions not supported")
14754  *
14755  */
14756     }
14757   }
14758 
14759   /* "View.MemoryView":696
14760  *     return have_slices or nslices, tuple(result)
14761  *
14762  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
14763  *     for suboffset in suboffsets[:ndim]:
14764  *         if suboffset >= 0:
14765  */
14766 
14767   /* function exit code */
14768   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14769   goto __pyx_L0;
14770   __pyx_L1_error:;
14771   __Pyx_XDECREF(__pyx_t_5);
14772   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14773   __pyx_r = 0;
14774   __pyx_L0:;
14775   __Pyx_XGIVEREF(__pyx_r);
14776   __Pyx_RefNannyFinishContext();
14777   return __pyx_r;
14778 }
14779 
14780 /* "View.MemoryView":706
14781  *
14782  * @cname('__pyx_memview_slice')
14783  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
14784  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
14785  *     cdef bint negative_step
14786  */
14787 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)14788 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14789   int __pyx_v_new_ndim;
14790   int __pyx_v_suboffset_dim;
14791   int __pyx_v_dim;
14792   __Pyx_memviewslice __pyx_v_src;
14793   __Pyx_memviewslice __pyx_v_dst;
14794   __Pyx_memviewslice *__pyx_v_p_src;
14795   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14796   __Pyx_memviewslice *__pyx_v_p_dst;
14797   int *__pyx_v_p_suboffset_dim;
14798   Py_ssize_t __pyx_v_start;
14799   Py_ssize_t __pyx_v_stop;
14800   Py_ssize_t __pyx_v_step;
14801   int __pyx_v_have_start;
14802   int __pyx_v_have_stop;
14803   int __pyx_v_have_step;
14804   PyObject *__pyx_v_index = NULL;
14805   struct __pyx_memoryview_obj *__pyx_r = NULL;
14806   __Pyx_RefNannyDeclarations
14807   int __pyx_t_1;
14808   int __pyx_t_2;
14809   PyObject *__pyx_t_3 = NULL;
14810   struct __pyx_memoryview_obj *__pyx_t_4;
14811   char *__pyx_t_5;
14812   int __pyx_t_6;
14813   Py_ssize_t __pyx_t_7;
14814   PyObject *(*__pyx_t_8)(PyObject *);
14815   PyObject *__pyx_t_9 = NULL;
14816   Py_ssize_t __pyx_t_10;
14817   int __pyx_t_11;
14818   Py_ssize_t __pyx_t_12;
14819   __Pyx_RefNannySetupContext("memview_slice", 0);
14820 
14821   /* "View.MemoryView":707
14822  * @cname('__pyx_memview_slice')
14823  * cdef memoryview memview_slice(memoryview memview, object indices):
14824  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
14825  *     cdef bint negative_step
14826  *     cdef __Pyx_memviewslice src, dst
14827  */
14828   __pyx_v_new_ndim = 0;
14829   __pyx_v_suboffset_dim = -1;
14830 
14831   /* "View.MemoryView":714
14832  *
14833  *
14834  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
14835  *
14836  *     cdef _memoryviewslice memviewsliceobj
14837  */
14838   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14839 
14840   /* "View.MemoryView":718
14841  *     cdef _memoryviewslice memviewsliceobj
14842  *
14843  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
14844  *
14845  *     if isinstance(memview, _memoryviewslice):
14846  */
14847   #ifndef CYTHON_WITHOUT_ASSERTIONS
14848   if (unlikely(!Py_OptimizeFlag)) {
14849     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14850       PyErr_SetNone(PyExc_AssertionError);
14851       __PYX_ERR(3, 718, __pyx_L1_error)
14852     }
14853   }
14854   #endif
14855 
14856   /* "View.MemoryView":720
14857  *     assert memview.view.ndim > 0
14858  *
14859  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
14860  *         memviewsliceobj = memview
14861  *         p_src = &memviewsliceobj.from_slice
14862  */
14863   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14864   __pyx_t_2 = (__pyx_t_1 != 0);
14865   if (__pyx_t_2) {
14866 
14867     /* "View.MemoryView":721
14868  *
14869  *     if isinstance(memview, _memoryviewslice):
14870  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
14871  *         p_src = &memviewsliceobj.from_slice
14872  *     else:
14873  */
14874     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 721, __pyx_L1_error)
14875     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14876     __Pyx_INCREF(__pyx_t_3);
14877     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14878     __pyx_t_3 = 0;
14879 
14880     /* "View.MemoryView":722
14881  *     if isinstance(memview, _memoryviewslice):
14882  *         memviewsliceobj = memview
14883  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
14884  *     else:
14885  *         slice_copy(memview, &src)
14886  */
14887     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14888 
14889     /* "View.MemoryView":720
14890  *     assert memview.view.ndim > 0
14891  *
14892  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
14893  *         memviewsliceobj = memview
14894  *         p_src = &memviewsliceobj.from_slice
14895  */
14896     goto __pyx_L3;
14897   }
14898 
14899   /* "View.MemoryView":724
14900  *         p_src = &memviewsliceobj.from_slice
14901  *     else:
14902  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
14903  *         p_src = &src
14904  *
14905  */
14906   /*else*/ {
14907     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14908 
14909     /* "View.MemoryView":725
14910  *     else:
14911  *         slice_copy(memview, &src)
14912  *         p_src = &src             # <<<<<<<<<<<<<<
14913  *
14914  *
14915  */
14916     __pyx_v_p_src = (&__pyx_v_src);
14917   }
14918   __pyx_L3:;
14919 
14920   /* "View.MemoryView":731
14921  *
14922  *
14923  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
14924  *     dst.data = p_src.data
14925  *
14926  */
14927   __pyx_t_4 = __pyx_v_p_src->memview;
14928   __pyx_v_dst.memview = __pyx_t_4;
14929 
14930   /* "View.MemoryView":732
14931  *
14932  *     dst.memview = p_src.memview
14933  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
14934  *
14935  *
14936  */
14937   __pyx_t_5 = __pyx_v_p_src->data;
14938   __pyx_v_dst.data = __pyx_t_5;
14939 
14940   /* "View.MemoryView":737
14941  *
14942  *
14943  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
14944  *     cdef int *p_suboffset_dim = &suboffset_dim
14945  *     cdef Py_ssize_t start, stop, step
14946  */
14947   __pyx_v_p_dst = (&__pyx_v_dst);
14948 
14949   /* "View.MemoryView":738
14950  *
14951  *     cdef __Pyx_memviewslice *p_dst = &dst
14952  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
14953  *     cdef Py_ssize_t start, stop, step
14954  *     cdef bint have_start, have_stop, have_step
14955  */
14956   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14957 
14958   /* "View.MemoryView":742
14959  *     cdef bint have_start, have_stop, have_step
14960  *
14961  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
14962  *         if PyIndex_Check(index):
14963  *             slice_memviewslice(
14964  */
14965   __pyx_t_6 = 0;
14966   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14967     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14968     __pyx_t_8 = NULL;
14969   } else {
14970     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 742, __pyx_L1_error)
14971     __Pyx_GOTREF(__pyx_t_3);
14972     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 742, __pyx_L1_error)
14973   }
14974   for (;;) {
14975     if (likely(!__pyx_t_8)) {
14976       if (likely(PyList_CheckExact(__pyx_t_3))) {
14977         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14978         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14979         __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(3, 742, __pyx_L1_error)
14980         #else
14981         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 742, __pyx_L1_error)
14982         __Pyx_GOTREF(__pyx_t_9);
14983         #endif
14984       } else {
14985         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14986         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14987         __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(3, 742, __pyx_L1_error)
14988         #else
14989         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 742, __pyx_L1_error)
14990         __Pyx_GOTREF(__pyx_t_9);
14991         #endif
14992       }
14993     } else {
14994       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14995       if (unlikely(!__pyx_t_9)) {
14996         PyObject* exc_type = PyErr_Occurred();
14997         if (exc_type) {
14998           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14999           else __PYX_ERR(3, 742, __pyx_L1_error)
15000         }
15001         break;
15002       }
15003       __Pyx_GOTREF(__pyx_t_9);
15004     }
15005     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15006     __pyx_t_9 = 0;
15007     __pyx_v_dim = __pyx_t_6;
15008     __pyx_t_6 = (__pyx_t_6 + 1);
15009 
15010     /* "View.MemoryView":743
15011  *
15012  *     for dim, index in enumerate(indices):
15013  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
15014  *             slice_memviewslice(
15015  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15016  */
15017     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15018     if (__pyx_t_2) {
15019 
15020       /* "View.MemoryView":747
15021  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15022  *                 dim, new_ndim, p_suboffset_dim,
15023  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
15024  *                 0, 0, 0, # have_{start,stop,step}
15025  *                 False)
15026  */
15027       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 747, __pyx_L1_error)
15028 
15029       /* "View.MemoryView":744
15030  *     for dim, index in enumerate(indices):
15031  *         if PyIndex_Check(index):
15032  *             slice_memviewslice(             # <<<<<<<<<<<<<<
15033  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15034  *                 dim, new_ndim, p_suboffset_dim,
15035  */
15036       __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(3, 744, __pyx_L1_error)
15037 
15038       /* "View.MemoryView":743
15039  *
15040  *     for dim, index in enumerate(indices):
15041  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
15042  *             slice_memviewslice(
15043  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15044  */
15045       goto __pyx_L6;
15046     }
15047 
15048     /* "View.MemoryView":750
15049  *                 0, 0, 0, # have_{start,stop,step}
15050  *                 False)
15051  *         elif index is None:             # <<<<<<<<<<<<<<
15052  *             p_dst.shape[new_ndim] = 1
15053  *             p_dst.strides[new_ndim] = 0
15054  */
15055     __pyx_t_2 = (__pyx_v_index == Py_None);
15056     __pyx_t_1 = (__pyx_t_2 != 0);
15057     if (__pyx_t_1) {
15058 
15059       /* "View.MemoryView":751
15060  *                 False)
15061  *         elif index is None:
15062  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
15063  *             p_dst.strides[new_ndim] = 0
15064  *             p_dst.suboffsets[new_ndim] = -1
15065  */
15066       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15067 
15068       /* "View.MemoryView":752
15069  *         elif index is None:
15070  *             p_dst.shape[new_ndim] = 1
15071  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
15072  *             p_dst.suboffsets[new_ndim] = -1
15073  *             new_ndim += 1
15074  */
15075       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15076 
15077       /* "View.MemoryView":753
15078  *             p_dst.shape[new_ndim] = 1
15079  *             p_dst.strides[new_ndim] = 0
15080  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
15081  *             new_ndim += 1
15082  *         else:
15083  */
15084       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15085 
15086       /* "View.MemoryView":754
15087  *             p_dst.strides[new_ndim] = 0
15088  *             p_dst.suboffsets[new_ndim] = -1
15089  *             new_ndim += 1             # <<<<<<<<<<<<<<
15090  *         else:
15091  *             start = index.start or 0
15092  */
15093       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15094 
15095       /* "View.MemoryView":750
15096  *                 0, 0, 0, # have_{start,stop,step}
15097  *                 False)
15098  *         elif index is None:             # <<<<<<<<<<<<<<
15099  *             p_dst.shape[new_ndim] = 1
15100  *             p_dst.strides[new_ndim] = 0
15101  */
15102       goto __pyx_L6;
15103     }
15104 
15105     /* "View.MemoryView":756
15106  *             new_ndim += 1
15107  *         else:
15108  *             start = index.start or 0             # <<<<<<<<<<<<<<
15109  *             stop = index.stop or 0
15110  *             step = index.step or 0
15111  */
15112     /*else*/ {
15113       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 756, __pyx_L1_error)
15114       __Pyx_GOTREF(__pyx_t_9);
15115       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 756, __pyx_L1_error)
15116       if (!__pyx_t_1) {
15117         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15118       } else {
15119         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 756, __pyx_L1_error)
15120         __pyx_t_10 = __pyx_t_12;
15121         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15122         goto __pyx_L7_bool_binop_done;
15123       }
15124       __pyx_t_10 = 0;
15125       __pyx_L7_bool_binop_done:;
15126       __pyx_v_start = __pyx_t_10;
15127 
15128       /* "View.MemoryView":757
15129  *         else:
15130  *             start = index.start or 0
15131  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
15132  *             step = index.step or 0
15133  *
15134  */
15135       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 757, __pyx_L1_error)
15136       __Pyx_GOTREF(__pyx_t_9);
15137       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 757, __pyx_L1_error)
15138       if (!__pyx_t_1) {
15139         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15140       } else {
15141         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 757, __pyx_L1_error)
15142         __pyx_t_10 = __pyx_t_12;
15143         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15144         goto __pyx_L9_bool_binop_done;
15145       }
15146       __pyx_t_10 = 0;
15147       __pyx_L9_bool_binop_done:;
15148       __pyx_v_stop = __pyx_t_10;
15149 
15150       /* "View.MemoryView":758
15151  *             start = index.start or 0
15152  *             stop = index.stop or 0
15153  *             step = index.step or 0             # <<<<<<<<<<<<<<
15154  *
15155  *             have_start = index.start is not None
15156  */
15157       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 758, __pyx_L1_error)
15158       __Pyx_GOTREF(__pyx_t_9);
15159       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 758, __pyx_L1_error)
15160       if (!__pyx_t_1) {
15161         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15162       } else {
15163         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 758, __pyx_L1_error)
15164         __pyx_t_10 = __pyx_t_12;
15165         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15166         goto __pyx_L11_bool_binop_done;
15167       }
15168       __pyx_t_10 = 0;
15169       __pyx_L11_bool_binop_done:;
15170       __pyx_v_step = __pyx_t_10;
15171 
15172       /* "View.MemoryView":760
15173  *             step = index.step or 0
15174  *
15175  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
15176  *             have_stop = index.stop is not None
15177  *             have_step = index.step is not None
15178  */
15179       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 760, __pyx_L1_error)
15180       __Pyx_GOTREF(__pyx_t_9);
15181       __pyx_t_1 = (__pyx_t_9 != Py_None);
15182       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15183       __pyx_v_have_start = __pyx_t_1;
15184 
15185       /* "View.MemoryView":761
15186  *
15187  *             have_start = index.start is not None
15188  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
15189  *             have_step = index.step is not None
15190  *
15191  */
15192       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 761, __pyx_L1_error)
15193       __Pyx_GOTREF(__pyx_t_9);
15194       __pyx_t_1 = (__pyx_t_9 != Py_None);
15195       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15196       __pyx_v_have_stop = __pyx_t_1;
15197 
15198       /* "View.MemoryView":762
15199  *             have_start = index.start is not None
15200  *             have_stop = index.stop is not None
15201  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
15202  *
15203  *             slice_memviewslice(
15204  */
15205       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 762, __pyx_L1_error)
15206       __Pyx_GOTREF(__pyx_t_9);
15207       __pyx_t_1 = (__pyx_t_9 != Py_None);
15208       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15209       __pyx_v_have_step = __pyx_t_1;
15210 
15211       /* "View.MemoryView":764
15212  *             have_step = index.step is not None
15213  *
15214  *             slice_memviewslice(             # <<<<<<<<<<<<<<
15215  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15216  *                 dim, new_ndim, p_suboffset_dim,
15217  */
15218       __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(3, 764, __pyx_L1_error)
15219 
15220       /* "View.MemoryView":770
15221  *                 have_start, have_stop, have_step,
15222  *                 True)
15223  *             new_ndim += 1             # <<<<<<<<<<<<<<
15224  *
15225  *     if isinstance(memview, _memoryviewslice):
15226  */
15227       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15228     }
15229     __pyx_L6:;
15230 
15231     /* "View.MemoryView":742
15232  *     cdef bint have_start, have_stop, have_step
15233  *
15234  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
15235  *         if PyIndex_Check(index):
15236  *             slice_memviewslice(
15237  */
15238   }
15239   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15240 
15241   /* "View.MemoryView":772
15242  *             new_ndim += 1
15243  *
15244  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15245  *         return memoryview_fromslice(dst, new_ndim,
15246  *                                     memviewsliceobj.to_object_func,
15247  */
15248   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15249   __pyx_t_2 = (__pyx_t_1 != 0);
15250   if (__pyx_t_2) {
15251 
15252     /* "View.MemoryView":773
15253  *
15254  *     if isinstance(memview, _memoryviewslice):
15255  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
15256  *                                     memviewsliceobj.to_object_func,
15257  *                                     memviewsliceobj.to_dtype_func,
15258  */
15259     __Pyx_XDECREF(((PyObject *)__pyx_r));
15260 
15261     /* "View.MemoryView":774
15262  *     if isinstance(memview, _memoryviewslice):
15263  *         return memoryview_fromslice(dst, new_ndim,
15264  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
15265  *                                     memviewsliceobj.to_dtype_func,
15266  *                                     memview.dtype_is_object)
15267  */
15268     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 774, __pyx_L1_error) }
15269 
15270     /* "View.MemoryView":775
15271  *         return memoryview_fromslice(dst, new_ndim,
15272  *                                     memviewsliceobj.to_object_func,
15273  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
15274  *                                     memview.dtype_is_object)
15275  *     else:
15276  */
15277     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(3, 775, __pyx_L1_error) }
15278 
15279     /* "View.MemoryView":773
15280  *
15281  *     if isinstance(memview, _memoryviewslice):
15282  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
15283  *                                     memviewsliceobj.to_object_func,
15284  *                                     memviewsliceobj.to_dtype_func,
15285  */
15286     __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(3, 773, __pyx_L1_error)
15287     __Pyx_GOTREF(__pyx_t_3);
15288     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 773, __pyx_L1_error)
15289     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15290     __pyx_t_3 = 0;
15291     goto __pyx_L0;
15292 
15293     /* "View.MemoryView":772
15294  *             new_ndim += 1
15295  *
15296  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
15297  *         return memoryview_fromslice(dst, new_ndim,
15298  *                                     memviewsliceobj.to_object_func,
15299  */
15300   }
15301 
15302   /* "View.MemoryView":778
15303  *                                     memview.dtype_is_object)
15304  *     else:
15305  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
15306  *                                     memview.dtype_is_object)
15307  *
15308  */
15309   /*else*/ {
15310     __Pyx_XDECREF(((PyObject *)__pyx_r));
15311 
15312     /* "View.MemoryView":779
15313  *     else:
15314  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15315  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
15316  *
15317  *
15318  */
15319     __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(3, 778, __pyx_L1_error)
15320     __Pyx_GOTREF(__pyx_t_3);
15321 
15322     /* "View.MemoryView":778
15323  *                                     memview.dtype_is_object)
15324  *     else:
15325  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
15326  *                                     memview.dtype_is_object)
15327  *
15328  */
15329     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(3, 778, __pyx_L1_error)
15330     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15331     __pyx_t_3 = 0;
15332     goto __pyx_L0;
15333   }
15334 
15335   /* "View.MemoryView":706
15336  *
15337  * @cname('__pyx_memview_slice')
15338  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
15339  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
15340  *     cdef bint negative_step
15341  */
15342 
15343   /* function exit code */
15344   __pyx_L1_error:;
15345   __Pyx_XDECREF(__pyx_t_3);
15346   __Pyx_XDECREF(__pyx_t_9);
15347   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15348   __pyx_r = 0;
15349   __pyx_L0:;
15350   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15351   __Pyx_XDECREF(__pyx_v_index);
15352   __Pyx_XGIVEREF((PyObject *)__pyx_r);
15353   __Pyx_RefNannyFinishContext();
15354   return __pyx_r;
15355 }
15356 
15357 /* "View.MemoryView":803
15358  *
15359  * @cname('__pyx_memoryview_slice_memviewslice')
15360  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
15361  *         __Pyx_memviewslice *dst,
15362  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15363  */
15364 
__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)15365 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) {
15366   Py_ssize_t __pyx_v_new_shape;
15367   int __pyx_v_negative_step;
15368   int __pyx_r;
15369   int __pyx_t_1;
15370   int __pyx_t_2;
15371   int __pyx_t_3;
15372 
15373   /* "View.MemoryView":823
15374  *     cdef bint negative_step
15375  *
15376  *     if not is_slice:             # <<<<<<<<<<<<<<
15377  *
15378  *         if start < 0:
15379  */
15380   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15381   if (__pyx_t_1) {
15382 
15383     /* "View.MemoryView":825
15384  *     if not is_slice:
15385  *
15386  *         if start < 0:             # <<<<<<<<<<<<<<
15387  *             start += shape
15388  *         if not 0 <= start < shape:
15389  */
15390     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15391     if (__pyx_t_1) {
15392 
15393       /* "View.MemoryView":826
15394  *
15395  *         if start < 0:
15396  *             start += shape             # <<<<<<<<<<<<<<
15397  *         if not 0 <= start < shape:
15398  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15399  */
15400       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15401 
15402       /* "View.MemoryView":825
15403  *     if not is_slice:
15404  *
15405  *         if start < 0:             # <<<<<<<<<<<<<<
15406  *             start += shape
15407  *         if not 0 <= start < shape:
15408  */
15409     }
15410 
15411     /* "View.MemoryView":827
15412  *         if start < 0:
15413  *             start += shape
15414  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
15415  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15416  *     else:
15417  */
15418     __pyx_t_1 = (0 <= __pyx_v_start);
15419     if (__pyx_t_1) {
15420       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15421     }
15422     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15423     if (__pyx_t_2) {
15424 
15425       /* "View.MemoryView":828
15426  *             start += shape
15427  *         if not 0 <= start < shape:
15428  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
15429  *     else:
15430  *
15431  */
15432       __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(3, 828, __pyx_L1_error)
15433 
15434       /* "View.MemoryView":827
15435  *         if start < 0:
15436  *             start += shape
15437  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
15438  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15439  *     else:
15440  */
15441     }
15442 
15443     /* "View.MemoryView":823
15444  *     cdef bint negative_step
15445  *
15446  *     if not is_slice:             # <<<<<<<<<<<<<<
15447  *
15448  *         if start < 0:
15449  */
15450     goto __pyx_L3;
15451   }
15452 
15453   /* "View.MemoryView":831
15454  *     else:
15455  *
15456  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
15457  *
15458  *         if have_step and step == 0:
15459  */
15460   /*else*/ {
15461     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15462     if (__pyx_t_1) {
15463     } else {
15464       __pyx_t_2 = __pyx_t_1;
15465       goto __pyx_L6_bool_binop_done;
15466     }
15467     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15468     __pyx_t_2 = __pyx_t_1;
15469     __pyx_L6_bool_binop_done:;
15470     __pyx_v_negative_step = __pyx_t_2;
15471 
15472     /* "View.MemoryView":833
15473  *         negative_step = have_step != 0 and step < 0
15474  *
15475  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
15476  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15477  *
15478  */
15479     __pyx_t_1 = (__pyx_v_have_step != 0);
15480     if (__pyx_t_1) {
15481     } else {
15482       __pyx_t_2 = __pyx_t_1;
15483       goto __pyx_L9_bool_binop_done;
15484     }
15485     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15486     __pyx_t_2 = __pyx_t_1;
15487     __pyx_L9_bool_binop_done:;
15488     if (__pyx_t_2) {
15489 
15490       /* "View.MemoryView":834
15491  *
15492  *         if have_step and step == 0:
15493  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
15494  *
15495  *
15496  */
15497       __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(3, 834, __pyx_L1_error)
15498 
15499       /* "View.MemoryView":833
15500  *         negative_step = have_step != 0 and step < 0
15501  *
15502  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
15503  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15504  *
15505  */
15506     }
15507 
15508     /* "View.MemoryView":837
15509  *
15510  *
15511  *         if have_start:             # <<<<<<<<<<<<<<
15512  *             if start < 0:
15513  *                 start += shape
15514  */
15515     __pyx_t_2 = (__pyx_v_have_start != 0);
15516     if (__pyx_t_2) {
15517 
15518       /* "View.MemoryView":838
15519  *
15520  *         if have_start:
15521  *             if start < 0:             # <<<<<<<<<<<<<<
15522  *                 start += shape
15523  *                 if start < 0:
15524  */
15525       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15526       if (__pyx_t_2) {
15527 
15528         /* "View.MemoryView":839
15529  *         if have_start:
15530  *             if start < 0:
15531  *                 start += shape             # <<<<<<<<<<<<<<
15532  *                 if start < 0:
15533  *                     start = 0
15534  */
15535         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15536 
15537         /* "View.MemoryView":840
15538  *             if start < 0:
15539  *                 start += shape
15540  *                 if start < 0:             # <<<<<<<<<<<<<<
15541  *                     start = 0
15542  *             elif start >= shape:
15543  */
15544         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15545         if (__pyx_t_2) {
15546 
15547           /* "View.MemoryView":841
15548  *                 start += shape
15549  *                 if start < 0:
15550  *                     start = 0             # <<<<<<<<<<<<<<
15551  *             elif start >= shape:
15552  *                 if negative_step:
15553  */
15554           __pyx_v_start = 0;
15555 
15556           /* "View.MemoryView":840
15557  *             if start < 0:
15558  *                 start += shape
15559  *                 if start < 0:             # <<<<<<<<<<<<<<
15560  *                     start = 0
15561  *             elif start >= shape:
15562  */
15563         }
15564 
15565         /* "View.MemoryView":838
15566  *
15567  *         if have_start:
15568  *             if start < 0:             # <<<<<<<<<<<<<<
15569  *                 start += shape
15570  *                 if start < 0:
15571  */
15572         goto __pyx_L12;
15573       }
15574 
15575       /* "View.MemoryView":842
15576  *                 if start < 0:
15577  *                     start = 0
15578  *             elif start >= shape:             # <<<<<<<<<<<<<<
15579  *                 if negative_step:
15580  *                     start = shape - 1
15581  */
15582       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15583       if (__pyx_t_2) {
15584 
15585         /* "View.MemoryView":843
15586  *                     start = 0
15587  *             elif start >= shape:
15588  *                 if negative_step:             # <<<<<<<<<<<<<<
15589  *                     start = shape - 1
15590  *                 else:
15591  */
15592         __pyx_t_2 = (__pyx_v_negative_step != 0);
15593         if (__pyx_t_2) {
15594 
15595           /* "View.MemoryView":844
15596  *             elif start >= shape:
15597  *                 if negative_step:
15598  *                     start = shape - 1             # <<<<<<<<<<<<<<
15599  *                 else:
15600  *                     start = shape
15601  */
15602           __pyx_v_start = (__pyx_v_shape - 1);
15603 
15604           /* "View.MemoryView":843
15605  *                     start = 0
15606  *             elif start >= shape:
15607  *                 if negative_step:             # <<<<<<<<<<<<<<
15608  *                     start = shape - 1
15609  *                 else:
15610  */
15611           goto __pyx_L14;
15612         }
15613 
15614         /* "View.MemoryView":846
15615  *                     start = shape - 1
15616  *                 else:
15617  *                     start = shape             # <<<<<<<<<<<<<<
15618  *         else:
15619  *             if negative_step:
15620  */
15621         /*else*/ {
15622           __pyx_v_start = __pyx_v_shape;
15623         }
15624         __pyx_L14:;
15625 
15626         /* "View.MemoryView":842
15627  *                 if start < 0:
15628  *                     start = 0
15629  *             elif start >= shape:             # <<<<<<<<<<<<<<
15630  *                 if negative_step:
15631  *                     start = shape - 1
15632  */
15633       }
15634       __pyx_L12:;
15635 
15636       /* "View.MemoryView":837
15637  *
15638  *
15639  *         if have_start:             # <<<<<<<<<<<<<<
15640  *             if start < 0:
15641  *                 start += shape
15642  */
15643       goto __pyx_L11;
15644     }
15645 
15646     /* "View.MemoryView":848
15647  *                     start = shape
15648  *         else:
15649  *             if negative_step:             # <<<<<<<<<<<<<<
15650  *                 start = shape - 1
15651  *             else:
15652  */
15653     /*else*/ {
15654       __pyx_t_2 = (__pyx_v_negative_step != 0);
15655       if (__pyx_t_2) {
15656 
15657         /* "View.MemoryView":849
15658  *         else:
15659  *             if negative_step:
15660  *                 start = shape - 1             # <<<<<<<<<<<<<<
15661  *             else:
15662  *                 start = 0
15663  */
15664         __pyx_v_start = (__pyx_v_shape - 1);
15665 
15666         /* "View.MemoryView":848
15667  *                     start = shape
15668  *         else:
15669  *             if negative_step:             # <<<<<<<<<<<<<<
15670  *                 start = shape - 1
15671  *             else:
15672  */
15673         goto __pyx_L15;
15674       }
15675 
15676       /* "View.MemoryView":851
15677  *                 start = shape - 1
15678  *             else:
15679  *                 start = 0             # <<<<<<<<<<<<<<
15680  *
15681  *         if have_stop:
15682  */
15683       /*else*/ {
15684         __pyx_v_start = 0;
15685       }
15686       __pyx_L15:;
15687     }
15688     __pyx_L11:;
15689 
15690     /* "View.MemoryView":853
15691  *                 start = 0
15692  *
15693  *         if have_stop:             # <<<<<<<<<<<<<<
15694  *             if stop < 0:
15695  *                 stop += shape
15696  */
15697     __pyx_t_2 = (__pyx_v_have_stop != 0);
15698     if (__pyx_t_2) {
15699 
15700       /* "View.MemoryView":854
15701  *
15702  *         if have_stop:
15703  *             if stop < 0:             # <<<<<<<<<<<<<<
15704  *                 stop += shape
15705  *                 if stop < 0:
15706  */
15707       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15708       if (__pyx_t_2) {
15709 
15710         /* "View.MemoryView":855
15711  *         if have_stop:
15712  *             if stop < 0:
15713  *                 stop += shape             # <<<<<<<<<<<<<<
15714  *                 if stop < 0:
15715  *                     stop = 0
15716  */
15717         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15718 
15719         /* "View.MemoryView":856
15720  *             if stop < 0:
15721  *                 stop += shape
15722  *                 if stop < 0:             # <<<<<<<<<<<<<<
15723  *                     stop = 0
15724  *             elif stop > shape:
15725  */
15726         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15727         if (__pyx_t_2) {
15728 
15729           /* "View.MemoryView":857
15730  *                 stop += shape
15731  *                 if stop < 0:
15732  *                     stop = 0             # <<<<<<<<<<<<<<
15733  *             elif stop > shape:
15734  *                 stop = shape
15735  */
15736           __pyx_v_stop = 0;
15737 
15738           /* "View.MemoryView":856
15739  *             if stop < 0:
15740  *                 stop += shape
15741  *                 if stop < 0:             # <<<<<<<<<<<<<<
15742  *                     stop = 0
15743  *             elif stop > shape:
15744  */
15745         }
15746 
15747         /* "View.MemoryView":854
15748  *
15749  *         if have_stop:
15750  *             if stop < 0:             # <<<<<<<<<<<<<<
15751  *                 stop += shape
15752  *                 if stop < 0:
15753  */
15754         goto __pyx_L17;
15755       }
15756 
15757       /* "View.MemoryView":858
15758  *                 if stop < 0:
15759  *                     stop = 0
15760  *             elif stop > shape:             # <<<<<<<<<<<<<<
15761  *                 stop = shape
15762  *         else:
15763  */
15764       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15765       if (__pyx_t_2) {
15766 
15767         /* "View.MemoryView":859
15768  *                     stop = 0
15769  *             elif stop > shape:
15770  *                 stop = shape             # <<<<<<<<<<<<<<
15771  *         else:
15772  *             if negative_step:
15773  */
15774         __pyx_v_stop = __pyx_v_shape;
15775 
15776         /* "View.MemoryView":858
15777  *                 if stop < 0:
15778  *                     stop = 0
15779  *             elif stop > shape:             # <<<<<<<<<<<<<<
15780  *                 stop = shape
15781  *         else:
15782  */
15783       }
15784       __pyx_L17:;
15785 
15786       /* "View.MemoryView":853
15787  *                 start = 0
15788  *
15789  *         if have_stop:             # <<<<<<<<<<<<<<
15790  *             if stop < 0:
15791  *                 stop += shape
15792  */
15793       goto __pyx_L16;
15794     }
15795 
15796     /* "View.MemoryView":861
15797  *                 stop = shape
15798  *         else:
15799  *             if negative_step:             # <<<<<<<<<<<<<<
15800  *                 stop = -1
15801  *             else:
15802  */
15803     /*else*/ {
15804       __pyx_t_2 = (__pyx_v_negative_step != 0);
15805       if (__pyx_t_2) {
15806 
15807         /* "View.MemoryView":862
15808  *         else:
15809  *             if negative_step:
15810  *                 stop = -1             # <<<<<<<<<<<<<<
15811  *             else:
15812  *                 stop = shape
15813  */
15814         __pyx_v_stop = -1L;
15815 
15816         /* "View.MemoryView":861
15817  *                 stop = shape
15818  *         else:
15819  *             if negative_step:             # <<<<<<<<<<<<<<
15820  *                 stop = -1
15821  *             else:
15822  */
15823         goto __pyx_L19;
15824       }
15825 
15826       /* "View.MemoryView":864
15827  *                 stop = -1
15828  *             else:
15829  *                 stop = shape             # <<<<<<<<<<<<<<
15830  *
15831  *         if not have_step:
15832  */
15833       /*else*/ {
15834         __pyx_v_stop = __pyx_v_shape;
15835       }
15836       __pyx_L19:;
15837     }
15838     __pyx_L16:;
15839 
15840     /* "View.MemoryView":866
15841  *                 stop = shape
15842  *
15843  *         if not have_step:             # <<<<<<<<<<<<<<
15844  *             step = 1
15845  *
15846  */
15847     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15848     if (__pyx_t_2) {
15849 
15850       /* "View.MemoryView":867
15851  *
15852  *         if not have_step:
15853  *             step = 1             # <<<<<<<<<<<<<<
15854  *
15855  *
15856  */
15857       __pyx_v_step = 1;
15858 
15859       /* "View.MemoryView":866
15860  *                 stop = shape
15861  *
15862  *         if not have_step:             # <<<<<<<<<<<<<<
15863  *             step = 1
15864  *
15865  */
15866     }
15867 
15868     /* "View.MemoryView":871
15869  *
15870  *         with cython.cdivision(True):
15871  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
15872  *
15873  *             if (stop - start) - step * new_shape:
15874  */
15875     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15876 
15877     /* "View.MemoryView":873
15878  *             new_shape = (stop - start) // step
15879  *
15880  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
15881  *                 new_shape += 1
15882  *
15883  */
15884     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15885     if (__pyx_t_2) {
15886 
15887       /* "View.MemoryView":874
15888  *
15889  *             if (stop - start) - step * new_shape:
15890  *                 new_shape += 1             # <<<<<<<<<<<<<<
15891  *
15892  *         if new_shape < 0:
15893  */
15894       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15895 
15896       /* "View.MemoryView":873
15897  *             new_shape = (stop - start) // step
15898  *
15899  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
15900  *                 new_shape += 1
15901  *
15902  */
15903     }
15904 
15905     /* "View.MemoryView":876
15906  *                 new_shape += 1
15907  *
15908  *         if new_shape < 0:             # <<<<<<<<<<<<<<
15909  *             new_shape = 0
15910  *
15911  */
15912     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15913     if (__pyx_t_2) {
15914 
15915       /* "View.MemoryView":877
15916  *
15917  *         if new_shape < 0:
15918  *             new_shape = 0             # <<<<<<<<<<<<<<
15919  *
15920  *
15921  */
15922       __pyx_v_new_shape = 0;
15923 
15924       /* "View.MemoryView":876
15925  *                 new_shape += 1
15926  *
15927  *         if new_shape < 0:             # <<<<<<<<<<<<<<
15928  *             new_shape = 0
15929  *
15930  */
15931     }
15932 
15933     /* "View.MemoryView":880
15934  *
15935  *
15936  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
15937  *         dst.shape[new_ndim] = new_shape
15938  *         dst.suboffsets[new_ndim] = suboffset
15939  */
15940     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15941 
15942     /* "View.MemoryView":881
15943  *
15944  *         dst.strides[new_ndim] = stride * step
15945  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
15946  *         dst.suboffsets[new_ndim] = suboffset
15947  *
15948  */
15949     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15950 
15951     /* "View.MemoryView":882
15952  *         dst.strides[new_ndim] = stride * step
15953  *         dst.shape[new_ndim] = new_shape
15954  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
15955  *
15956  *
15957  */
15958     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15959   }
15960   __pyx_L3:;
15961 
15962   /* "View.MemoryView":885
15963  *
15964  *
15965  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
15966  *         dst.data += start * stride
15967  *     else:
15968  */
15969   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15970   if (__pyx_t_2) {
15971 
15972     /* "View.MemoryView":886
15973  *
15974  *     if suboffset_dim[0] < 0:
15975  *         dst.data += start * stride             # <<<<<<<<<<<<<<
15976  *     else:
15977  *         dst.suboffsets[suboffset_dim[0]] += start * stride
15978  */
15979     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15980 
15981     /* "View.MemoryView":885
15982  *
15983  *
15984  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
15985  *         dst.data += start * stride
15986  *     else:
15987  */
15988     goto __pyx_L23;
15989   }
15990 
15991   /* "View.MemoryView":888
15992  *         dst.data += start * stride
15993  *     else:
15994  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
15995  *
15996  *     if suboffset >= 0:
15997  */
15998   /*else*/ {
15999     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16000     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16001   }
16002   __pyx_L23:;
16003 
16004   /* "View.MemoryView":890
16005  *         dst.suboffsets[suboffset_dim[0]] += start * stride
16006  *
16007  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
16008  *         if not is_slice:
16009  *             if new_ndim == 0:
16010  */
16011   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16012   if (__pyx_t_2) {
16013 
16014     /* "View.MemoryView":891
16015  *
16016  *     if suboffset >= 0:
16017  *         if not is_slice:             # <<<<<<<<<<<<<<
16018  *             if new_ndim == 0:
16019  *                 dst.data = (<char **> dst.data)[0] + suboffset
16020  */
16021     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16022     if (__pyx_t_2) {
16023 
16024       /* "View.MemoryView":892
16025  *     if suboffset >= 0:
16026  *         if not is_slice:
16027  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
16028  *                 dst.data = (<char **> dst.data)[0] + suboffset
16029  *             else:
16030  */
16031       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16032       if (__pyx_t_2) {
16033 
16034         /* "View.MemoryView":893
16035  *         if not is_slice:
16036  *             if new_ndim == 0:
16037  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
16038  *             else:
16039  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
16040  */
16041         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16042 
16043         /* "View.MemoryView":892
16044  *     if suboffset >= 0:
16045  *         if not is_slice:
16046  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
16047  *                 dst.data = (<char **> dst.data)[0] + suboffset
16048  *             else:
16049  */
16050         goto __pyx_L26;
16051       }
16052 
16053       /* "View.MemoryView":895
16054  *                 dst.data = (<char **> dst.data)[0] + suboffset
16055  *             else:
16056  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
16057  *                                      "must be indexed and not sliced", dim)
16058  *         else:
16059  */
16060       /*else*/ {
16061 
16062         /* "View.MemoryView":896
16063  *             else:
16064  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
16065  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
16066  *         else:
16067  *             suboffset_dim[0] = new_ndim
16068  */
16069         __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(3, 895, __pyx_L1_error)
16070       }
16071       __pyx_L26:;
16072 
16073       /* "View.MemoryView":891
16074  *
16075  *     if suboffset >= 0:
16076  *         if not is_slice:             # <<<<<<<<<<<<<<
16077  *             if new_ndim == 0:
16078  *                 dst.data = (<char **> dst.data)[0] + suboffset
16079  */
16080       goto __pyx_L25;
16081     }
16082 
16083     /* "View.MemoryView":898
16084  *                                      "must be indexed and not sliced", dim)
16085  *         else:
16086  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
16087  *
16088  *     return 0
16089  */
16090     /*else*/ {
16091       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16092     }
16093     __pyx_L25:;
16094 
16095     /* "View.MemoryView":890
16096  *         dst.suboffsets[suboffset_dim[0]] += start * stride
16097  *
16098  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
16099  *         if not is_slice:
16100  *             if new_ndim == 0:
16101  */
16102   }
16103 
16104   /* "View.MemoryView":900
16105  *             suboffset_dim[0] = new_ndim
16106  *
16107  *     return 0             # <<<<<<<<<<<<<<
16108  *
16109  *
16110  */
16111   __pyx_r = 0;
16112   goto __pyx_L0;
16113 
16114   /* "View.MemoryView":803
16115  *
16116  * @cname('__pyx_memoryview_slice_memviewslice')
16117  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
16118  *         __Pyx_memviewslice *dst,
16119  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16120  */
16121 
16122   /* function exit code */
16123   __pyx_L1_error:;
16124   {
16125     #ifdef WITH_THREAD
16126     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16127     #endif
16128     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16129     #ifdef WITH_THREAD
16130     __Pyx_PyGILState_Release(__pyx_gilstate_save);
16131     #endif
16132   }
16133   __pyx_r = -1;
16134   __pyx_L0:;
16135   return __pyx_r;
16136 }
16137 
16138 /* "View.MemoryView":906
16139  *
16140  * @cname('__pyx_pybuffer_index')
16141  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
16142  *                           Py_ssize_t dim) except NULL:
16143  *     cdef Py_ssize_t shape, stride, suboffset = -1
16144  */
16145 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)16146 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) {
16147   Py_ssize_t __pyx_v_shape;
16148   Py_ssize_t __pyx_v_stride;
16149   Py_ssize_t __pyx_v_suboffset;
16150   Py_ssize_t __pyx_v_itemsize;
16151   char *__pyx_v_resultp;
16152   char *__pyx_r;
16153   __Pyx_RefNannyDeclarations
16154   Py_ssize_t __pyx_t_1;
16155   int __pyx_t_2;
16156   PyObject *__pyx_t_3 = NULL;
16157   PyObject *__pyx_t_4 = NULL;
16158   __Pyx_RefNannySetupContext("pybuffer_index", 0);
16159 
16160   /* "View.MemoryView":908
16161  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16162  *                           Py_ssize_t dim) except NULL:
16163  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
16164  *     cdef Py_ssize_t itemsize = view.itemsize
16165  *     cdef char *resultp
16166  */
16167   __pyx_v_suboffset = -1L;
16168 
16169   /* "View.MemoryView":909
16170  *                           Py_ssize_t dim) except NULL:
16171  *     cdef Py_ssize_t shape, stride, suboffset = -1
16172  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
16173  *     cdef char *resultp
16174  *
16175  */
16176   __pyx_t_1 = __pyx_v_view->itemsize;
16177   __pyx_v_itemsize = __pyx_t_1;
16178 
16179   /* "View.MemoryView":912
16180  *     cdef char *resultp
16181  *
16182  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
16183  *         shape = view.len / itemsize
16184  *         stride = itemsize
16185  */
16186   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16187   if (__pyx_t_2) {
16188 
16189     /* "View.MemoryView":913
16190  *
16191  *     if view.ndim == 0:
16192  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
16193  *         stride = itemsize
16194  *     else:
16195  */
16196     if (unlikely(__pyx_v_itemsize == 0)) {
16197       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16198       __PYX_ERR(3, 913, __pyx_L1_error)
16199     }
16200     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))) {
16201       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16202       __PYX_ERR(3, 913, __pyx_L1_error)
16203     }
16204     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16205 
16206     /* "View.MemoryView":914
16207  *     if view.ndim == 0:
16208  *         shape = view.len / itemsize
16209  *         stride = itemsize             # <<<<<<<<<<<<<<
16210  *     else:
16211  *         shape = view.shape[dim]
16212  */
16213     __pyx_v_stride = __pyx_v_itemsize;
16214 
16215     /* "View.MemoryView":912
16216  *     cdef char *resultp
16217  *
16218  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
16219  *         shape = view.len / itemsize
16220  *         stride = itemsize
16221  */
16222     goto __pyx_L3;
16223   }
16224 
16225   /* "View.MemoryView":916
16226  *         stride = itemsize
16227  *     else:
16228  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
16229  *         stride = view.strides[dim]
16230  *         if view.suboffsets != NULL:
16231  */
16232   /*else*/ {
16233     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16234 
16235     /* "View.MemoryView":917
16236  *     else:
16237  *         shape = view.shape[dim]
16238  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
16239  *         if view.suboffsets != NULL:
16240  *             suboffset = view.suboffsets[dim]
16241  */
16242     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16243 
16244     /* "View.MemoryView":918
16245  *         shape = view.shape[dim]
16246  *         stride = view.strides[dim]
16247  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
16248  *             suboffset = view.suboffsets[dim]
16249  *
16250  */
16251     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16252     if (__pyx_t_2) {
16253 
16254       /* "View.MemoryView":919
16255  *         stride = view.strides[dim]
16256  *         if view.suboffsets != NULL:
16257  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
16258  *
16259  *     if index < 0:
16260  */
16261       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16262 
16263       /* "View.MemoryView":918
16264  *         shape = view.shape[dim]
16265  *         stride = view.strides[dim]
16266  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
16267  *             suboffset = view.suboffsets[dim]
16268  *
16269  */
16270     }
16271   }
16272   __pyx_L3:;
16273 
16274   /* "View.MemoryView":921
16275  *             suboffset = view.suboffsets[dim]
16276  *
16277  *     if index < 0:             # <<<<<<<<<<<<<<
16278  *         index += view.shape[dim]
16279  *         if index < 0:
16280  */
16281   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16282   if (__pyx_t_2) {
16283 
16284     /* "View.MemoryView":922
16285  *
16286  *     if index < 0:
16287  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
16288  *         if index < 0:
16289  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16290  */
16291     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16292 
16293     /* "View.MemoryView":923
16294  *     if index < 0:
16295  *         index += view.shape[dim]
16296  *         if index < 0:             # <<<<<<<<<<<<<<
16297  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16298  *
16299  */
16300     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16301     if (unlikely(__pyx_t_2)) {
16302 
16303       /* "View.MemoryView":924
16304  *         index += view.shape[dim]
16305  *         if index < 0:
16306  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
16307  *
16308  *     if index >= shape:
16309  */
16310       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 924, __pyx_L1_error)
16311       __Pyx_GOTREF(__pyx_t_3);
16312       __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(3, 924, __pyx_L1_error)
16313       __Pyx_GOTREF(__pyx_t_4);
16314       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16315       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 924, __pyx_L1_error)
16316       __Pyx_GOTREF(__pyx_t_3);
16317       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16318       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16319       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16320       __PYX_ERR(3, 924, __pyx_L1_error)
16321 
16322       /* "View.MemoryView":923
16323  *     if index < 0:
16324  *         index += view.shape[dim]
16325  *         if index < 0:             # <<<<<<<<<<<<<<
16326  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16327  *
16328  */
16329     }
16330 
16331     /* "View.MemoryView":921
16332  *             suboffset = view.suboffsets[dim]
16333  *
16334  *     if index < 0:             # <<<<<<<<<<<<<<
16335  *         index += view.shape[dim]
16336  *         if index < 0:
16337  */
16338   }
16339 
16340   /* "View.MemoryView":926
16341  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16342  *
16343  *     if index >= shape:             # <<<<<<<<<<<<<<
16344  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16345  *
16346  */
16347   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16348   if (unlikely(__pyx_t_2)) {
16349 
16350     /* "View.MemoryView":927
16351  *
16352  *     if index >= shape:
16353  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
16354  *
16355  *     resultp = bufp + index * stride
16356  */
16357     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 927, __pyx_L1_error)
16358     __Pyx_GOTREF(__pyx_t_3);
16359     __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(3, 927, __pyx_L1_error)
16360     __Pyx_GOTREF(__pyx_t_4);
16361     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16362     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 927, __pyx_L1_error)
16363     __Pyx_GOTREF(__pyx_t_3);
16364     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16365     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16366     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16367     __PYX_ERR(3, 927, __pyx_L1_error)
16368 
16369     /* "View.MemoryView":926
16370  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16371  *
16372  *     if index >= shape:             # <<<<<<<<<<<<<<
16373  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16374  *
16375  */
16376   }
16377 
16378   /* "View.MemoryView":929
16379  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16380  *
16381  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
16382  *     if suboffset >= 0:
16383  *         resultp = (<char **> resultp)[0] + suboffset
16384  */
16385   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16386 
16387   /* "View.MemoryView":930
16388  *
16389  *     resultp = bufp + index * stride
16390  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
16391  *         resultp = (<char **> resultp)[0] + suboffset
16392  *
16393  */
16394   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16395   if (__pyx_t_2) {
16396 
16397     /* "View.MemoryView":931
16398  *     resultp = bufp + index * stride
16399  *     if suboffset >= 0:
16400  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
16401  *
16402  *     return resultp
16403  */
16404     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16405 
16406     /* "View.MemoryView":930
16407  *
16408  *     resultp = bufp + index * stride
16409  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
16410  *         resultp = (<char **> resultp)[0] + suboffset
16411  *
16412  */
16413   }
16414 
16415   /* "View.MemoryView":933
16416  *         resultp = (<char **> resultp)[0] + suboffset
16417  *
16418  *     return resultp             # <<<<<<<<<<<<<<
16419  *
16420  *
16421  */
16422   __pyx_r = __pyx_v_resultp;
16423   goto __pyx_L0;
16424 
16425   /* "View.MemoryView":906
16426  *
16427  * @cname('__pyx_pybuffer_index')
16428  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
16429  *                           Py_ssize_t dim) except NULL:
16430  *     cdef Py_ssize_t shape, stride, suboffset = -1
16431  */
16432 
16433   /* function exit code */
16434   __pyx_L1_error:;
16435   __Pyx_XDECREF(__pyx_t_3);
16436   __Pyx_XDECREF(__pyx_t_4);
16437   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16438   __pyx_r = NULL;
16439   __pyx_L0:;
16440   __Pyx_RefNannyFinishContext();
16441   return __pyx_r;
16442 }
16443 
16444 /* "View.MemoryView":939
16445  *
16446  * @cname('__pyx_memslice_transpose')
16447  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
16448  *     cdef int ndim = memslice.memview.view.ndim
16449  *
16450  */
16451 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)16452 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16453   int __pyx_v_ndim;
16454   Py_ssize_t *__pyx_v_shape;
16455   Py_ssize_t *__pyx_v_strides;
16456   int __pyx_v_i;
16457   int __pyx_v_j;
16458   int __pyx_r;
16459   int __pyx_t_1;
16460   Py_ssize_t *__pyx_t_2;
16461   long __pyx_t_3;
16462   long __pyx_t_4;
16463   Py_ssize_t __pyx_t_5;
16464   Py_ssize_t __pyx_t_6;
16465   int __pyx_t_7;
16466   int __pyx_t_8;
16467   int __pyx_t_9;
16468 
16469   /* "View.MemoryView":940
16470  * @cname('__pyx_memslice_transpose')
16471  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16472  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
16473  *
16474  *     cdef Py_ssize_t *shape = memslice.shape
16475  */
16476   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16477   __pyx_v_ndim = __pyx_t_1;
16478 
16479   /* "View.MemoryView":942
16480  *     cdef int ndim = memslice.memview.view.ndim
16481  *
16482  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
16483  *     cdef Py_ssize_t *strides = memslice.strides
16484  *
16485  */
16486   __pyx_t_2 = __pyx_v_memslice->shape;
16487   __pyx_v_shape = __pyx_t_2;
16488 
16489   /* "View.MemoryView":943
16490  *
16491  *     cdef Py_ssize_t *shape = memslice.shape
16492  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
16493  *
16494  *
16495  */
16496   __pyx_t_2 = __pyx_v_memslice->strides;
16497   __pyx_v_strides = __pyx_t_2;
16498 
16499   /* "View.MemoryView":947
16500  *
16501  *     cdef int i, j
16502  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
16503  *         j = ndim - 1 - i
16504  *         strides[i], strides[j] = strides[j], strides[i]
16505  */
16506   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16507   __pyx_t_4 = __pyx_t_3;
16508   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16509     __pyx_v_i = __pyx_t_1;
16510 
16511     /* "View.MemoryView":948
16512  *     cdef int i, j
16513  *     for i in range(ndim / 2):
16514  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
16515  *         strides[i], strides[j] = strides[j], strides[i]
16516  *         shape[i], shape[j] = shape[j], shape[i]
16517  */
16518     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16519 
16520     /* "View.MemoryView":949
16521  *     for i in range(ndim / 2):
16522  *         j = ndim - 1 - i
16523  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
16524  *         shape[i], shape[j] = shape[j], shape[i]
16525  *
16526  */
16527     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16528     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16529     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16530     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16531 
16532     /* "View.MemoryView":950
16533  *         j = ndim - 1 - i
16534  *         strides[i], strides[j] = strides[j], strides[i]
16535  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
16536  *
16537  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16538  */
16539     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16540     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16541     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16542     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16543 
16544     /* "View.MemoryView":952
16545  *         shape[i], shape[j] = shape[j], shape[i]
16546  *
16547  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
16548  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16549  *
16550  */
16551     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16552     if (!__pyx_t_8) {
16553     } else {
16554       __pyx_t_7 = __pyx_t_8;
16555       goto __pyx_L6_bool_binop_done;
16556     }
16557     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16558     __pyx_t_7 = __pyx_t_8;
16559     __pyx_L6_bool_binop_done:;
16560     if (__pyx_t_7) {
16561 
16562       /* "View.MemoryView":953
16563  *
16564  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16565  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
16566  *
16567  *     return 1
16568  */
16569       __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(3, 953, __pyx_L1_error)
16570 
16571       /* "View.MemoryView":952
16572  *         shape[i], shape[j] = shape[j], shape[i]
16573  *
16574  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
16575  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16576  *
16577  */
16578     }
16579   }
16580 
16581   /* "View.MemoryView":955
16582  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16583  *
16584  *     return 1             # <<<<<<<<<<<<<<
16585  *
16586  *
16587  */
16588   __pyx_r = 1;
16589   goto __pyx_L0;
16590 
16591   /* "View.MemoryView":939
16592  *
16593  * @cname('__pyx_memslice_transpose')
16594  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
16595  *     cdef int ndim = memslice.memview.view.ndim
16596  *
16597  */
16598 
16599   /* function exit code */
16600   __pyx_L1_error:;
16601   {
16602     #ifdef WITH_THREAD
16603     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16604     #endif
16605     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16606     #ifdef WITH_THREAD
16607     __Pyx_PyGILState_Release(__pyx_gilstate_save);
16608     #endif
16609   }
16610   __pyx_r = 0;
16611   __pyx_L0:;
16612   return __pyx_r;
16613 }
16614 
16615 /* "View.MemoryView":972
16616  *     cdef int (*to_dtype_func)(char *, object) except 0
16617  *
16618  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
16619  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16620  *
16621  */
16622 
16623 /* Python wrapper */
16624 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)16625 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16626   __Pyx_RefNannyDeclarations
16627   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16628   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16629 
16630   /* function exit code */
16631   __Pyx_RefNannyFinishContext();
16632 }
16633 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)16634 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16635   __Pyx_RefNannyDeclarations
16636   __Pyx_RefNannySetupContext("__dealloc__", 0);
16637 
16638   /* "View.MemoryView":973
16639  *
16640  *     def __dealloc__(self):
16641  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
16642  *
16643  *     cdef convert_item_to_object(self, char *itemp):
16644  */
16645   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16646 
16647   /* "View.MemoryView":972
16648  *     cdef int (*to_dtype_func)(char *, object) except 0
16649  *
16650  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
16651  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16652  *
16653  */
16654 
16655   /* function exit code */
16656   __Pyx_RefNannyFinishContext();
16657 }
16658 
16659 /* "View.MemoryView":975
16660  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16661  *
16662  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
16663  *         if self.to_object_func != NULL:
16664  *             return self.to_object_func(itemp)
16665  */
16666 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)16667 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16668   PyObject *__pyx_r = NULL;
16669   __Pyx_RefNannyDeclarations
16670   int __pyx_t_1;
16671   PyObject *__pyx_t_2 = NULL;
16672   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16673 
16674   /* "View.MemoryView":976
16675  *
16676  *     cdef convert_item_to_object(self, char *itemp):
16677  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
16678  *             return self.to_object_func(itemp)
16679  *         else:
16680  */
16681   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16682   if (__pyx_t_1) {
16683 
16684     /* "View.MemoryView":977
16685  *     cdef convert_item_to_object(self, char *itemp):
16686  *         if self.to_object_func != NULL:
16687  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
16688  *         else:
16689  *             return memoryview.convert_item_to_object(self, itemp)
16690  */
16691     __Pyx_XDECREF(__pyx_r);
16692     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 977, __pyx_L1_error)
16693     __Pyx_GOTREF(__pyx_t_2);
16694     __pyx_r = __pyx_t_2;
16695     __pyx_t_2 = 0;
16696     goto __pyx_L0;
16697 
16698     /* "View.MemoryView":976
16699  *
16700  *     cdef convert_item_to_object(self, char *itemp):
16701  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
16702  *             return self.to_object_func(itemp)
16703  *         else:
16704  */
16705   }
16706 
16707   /* "View.MemoryView":979
16708  *             return self.to_object_func(itemp)
16709  *         else:
16710  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
16711  *
16712  *     cdef assign_item_from_object(self, char *itemp, object value):
16713  */
16714   /*else*/ {
16715     __Pyx_XDECREF(__pyx_r);
16716     __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(3, 979, __pyx_L1_error)
16717     __Pyx_GOTREF(__pyx_t_2);
16718     __pyx_r = __pyx_t_2;
16719     __pyx_t_2 = 0;
16720     goto __pyx_L0;
16721   }
16722 
16723   /* "View.MemoryView":975
16724  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16725  *
16726  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
16727  *         if self.to_object_func != NULL:
16728  *             return self.to_object_func(itemp)
16729  */
16730 
16731   /* function exit code */
16732   __pyx_L1_error:;
16733   __Pyx_XDECREF(__pyx_t_2);
16734   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16735   __pyx_r = 0;
16736   __pyx_L0:;
16737   __Pyx_XGIVEREF(__pyx_r);
16738   __Pyx_RefNannyFinishContext();
16739   return __pyx_r;
16740 }
16741 
16742 /* "View.MemoryView":981
16743  *             return memoryview.convert_item_to_object(self, itemp)
16744  *
16745  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
16746  *         if self.to_dtype_func != NULL:
16747  *             self.to_dtype_func(itemp, value)
16748  */
16749 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)16750 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16751   PyObject *__pyx_r = NULL;
16752   __Pyx_RefNannyDeclarations
16753   int __pyx_t_1;
16754   int __pyx_t_2;
16755   PyObject *__pyx_t_3 = NULL;
16756   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16757 
16758   /* "View.MemoryView":982
16759  *
16760  *     cdef assign_item_from_object(self, char *itemp, object value):
16761  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
16762  *             self.to_dtype_func(itemp, value)
16763  *         else:
16764  */
16765   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16766   if (__pyx_t_1) {
16767 
16768     /* "View.MemoryView":983
16769  *     cdef assign_item_from_object(self, char *itemp, object value):
16770  *         if self.to_dtype_func != NULL:
16771  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
16772  *         else:
16773  *             memoryview.assign_item_from_object(self, itemp, value)
16774  */
16775     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 983, __pyx_L1_error)
16776 
16777     /* "View.MemoryView":982
16778  *
16779  *     cdef assign_item_from_object(self, char *itemp, object value):
16780  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
16781  *             self.to_dtype_func(itemp, value)
16782  *         else:
16783  */
16784     goto __pyx_L3;
16785   }
16786 
16787   /* "View.MemoryView":985
16788  *             self.to_dtype_func(itemp, value)
16789  *         else:
16790  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
16791  *
16792  *     @property
16793  */
16794   /*else*/ {
16795     __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(3, 985, __pyx_L1_error)
16796     __Pyx_GOTREF(__pyx_t_3);
16797     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16798   }
16799   __pyx_L3:;
16800 
16801   /* "View.MemoryView":981
16802  *             return memoryview.convert_item_to_object(self, itemp)
16803  *
16804  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
16805  *         if self.to_dtype_func != NULL:
16806  *             self.to_dtype_func(itemp, value)
16807  */
16808 
16809   /* function exit code */
16810   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16811   goto __pyx_L0;
16812   __pyx_L1_error:;
16813   __Pyx_XDECREF(__pyx_t_3);
16814   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16815   __pyx_r = 0;
16816   __pyx_L0:;
16817   __Pyx_XGIVEREF(__pyx_r);
16818   __Pyx_RefNannyFinishContext();
16819   return __pyx_r;
16820 }
16821 
16822 /* "View.MemoryView":988
16823  *
16824  *     @property
16825  *     def base(self):             # <<<<<<<<<<<<<<
16826  *         return self.from_object
16827  *
16828  */
16829 
16830 /* Python wrapper */
16831 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)16832 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16833   PyObject *__pyx_r = 0;
16834   __Pyx_RefNannyDeclarations
16835   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16836   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16837 
16838   /* function exit code */
16839   __Pyx_RefNannyFinishContext();
16840   return __pyx_r;
16841 }
16842 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)16843 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16844   PyObject *__pyx_r = NULL;
16845   __Pyx_RefNannyDeclarations
16846   __Pyx_RefNannySetupContext("__get__", 0);
16847 
16848   /* "View.MemoryView":989
16849  *     @property
16850  *     def base(self):
16851  *         return self.from_object             # <<<<<<<<<<<<<<
16852  *
16853  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16854  */
16855   __Pyx_XDECREF(__pyx_r);
16856   __Pyx_INCREF(__pyx_v_self->from_object);
16857   __pyx_r = __pyx_v_self->from_object;
16858   goto __pyx_L0;
16859 
16860   /* "View.MemoryView":988
16861  *
16862  *     @property
16863  *     def base(self):             # <<<<<<<<<<<<<<
16864  *         return self.from_object
16865  *
16866  */
16867 
16868   /* function exit code */
16869   __pyx_L0:;
16870   __Pyx_XGIVEREF(__pyx_r);
16871   __Pyx_RefNannyFinishContext();
16872   return __pyx_r;
16873 }
16874 
16875 /* "(tree fragment)":1
16876  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
16877  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16878  * def __setstate_cython__(self, __pyx_state):
16879  */
16880 
16881 /* Python wrapper */
16882 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)16883 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16884   PyObject *__pyx_r = 0;
16885   __Pyx_RefNannyDeclarations
16886   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16887   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16888 
16889   /* function exit code */
16890   __Pyx_RefNannyFinishContext();
16891   return __pyx_r;
16892 }
16893 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)16894 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16895   PyObject *__pyx_r = NULL;
16896   __Pyx_RefNannyDeclarations
16897   PyObject *__pyx_t_1 = NULL;
16898   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16899 
16900   /* "(tree fragment)":2
16901  * def __reduce_cython__(self):
16902  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
16903  * def __setstate_cython__(self, __pyx_state):
16904  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16905  */
16906   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2, __pyx_L1_error)
16907   __Pyx_GOTREF(__pyx_t_1);
16908   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16910   __PYX_ERR(3, 2, __pyx_L1_error)
16911 
16912   /* "(tree fragment)":1
16913  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
16914  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16915  * def __setstate_cython__(self, __pyx_state):
16916  */
16917 
16918   /* function exit code */
16919   __pyx_L1_error:;
16920   __Pyx_XDECREF(__pyx_t_1);
16921   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16922   __pyx_r = NULL;
16923   __Pyx_XGIVEREF(__pyx_r);
16924   __Pyx_RefNannyFinishContext();
16925   return __pyx_r;
16926 }
16927 
16928 /* "(tree fragment)":3
16929  * def __reduce_cython__(self):
16930  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16931  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
16932  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16933  */
16934 
16935 /* Python wrapper */
16936 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)16937 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16938   PyObject *__pyx_r = 0;
16939   __Pyx_RefNannyDeclarations
16940   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16941   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16942 
16943   /* function exit code */
16944   __Pyx_RefNannyFinishContext();
16945   return __pyx_r;
16946 }
16947 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)16948 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) {
16949   PyObject *__pyx_r = NULL;
16950   __Pyx_RefNannyDeclarations
16951   PyObject *__pyx_t_1 = NULL;
16952   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16953 
16954   /* "(tree fragment)":4
16955  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16956  * def __setstate_cython__(self, __pyx_state):
16957  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
16958  */
16959   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
16960   __Pyx_GOTREF(__pyx_t_1);
16961   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16962   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16963   __PYX_ERR(3, 4, __pyx_L1_error)
16964 
16965   /* "(tree fragment)":3
16966  * def __reduce_cython__(self):
16967  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16968  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
16969  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16970  */
16971 
16972   /* function exit code */
16973   __pyx_L1_error:;
16974   __Pyx_XDECREF(__pyx_t_1);
16975   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16976   __pyx_r = NULL;
16977   __Pyx_XGIVEREF(__pyx_r);
16978   __Pyx_RefNannyFinishContext();
16979   return __pyx_r;
16980 }
16981 
16982 /* "View.MemoryView":995
16983  *
16984  * @cname('__pyx_memoryview_fromslice')
16985  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
16986  *                           int ndim,
16987  *                           object (*to_object_func)(char *),
16988  */
16989 
__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)16990 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) {
16991   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16992   Py_ssize_t __pyx_v_suboffset;
16993   PyObject *__pyx_v_length = NULL;
16994   PyObject *__pyx_r = NULL;
16995   __Pyx_RefNannyDeclarations
16996   int __pyx_t_1;
16997   PyObject *__pyx_t_2 = NULL;
16998   PyObject *__pyx_t_3 = NULL;
16999   __Pyx_TypeInfo *__pyx_t_4;
17000   Py_buffer __pyx_t_5;
17001   Py_ssize_t *__pyx_t_6;
17002   Py_ssize_t *__pyx_t_7;
17003   Py_ssize_t *__pyx_t_8;
17004   Py_ssize_t __pyx_t_9;
17005   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17006 
17007   /* "View.MemoryView":1003
17008  *     cdef _memoryviewslice result
17009  *
17010  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
17011  *         return None
17012  *
17013  */
17014   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17015   if (__pyx_t_1) {
17016 
17017     /* "View.MemoryView":1004
17018  *
17019  *     if <PyObject *> memviewslice.memview == Py_None:
17020  *         return None             # <<<<<<<<<<<<<<
17021  *
17022  *
17023  */
17024     __Pyx_XDECREF(__pyx_r);
17025     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17026     goto __pyx_L0;
17027 
17028     /* "View.MemoryView":1003
17029  *     cdef _memoryviewslice result
17030  *
17031  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
17032  *         return None
17033  *
17034  */
17035   }
17036 
17037   /* "View.MemoryView":1009
17038  *
17039  *
17040  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
17041  *
17042  *     result.from_slice = memviewslice
17043  */
17044   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1009, __pyx_L1_error)
17045   __Pyx_GOTREF(__pyx_t_2);
17046   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1009, __pyx_L1_error)
17047   __Pyx_GOTREF(__pyx_t_3);
17048   __Pyx_INCREF(Py_None);
17049   __Pyx_GIVEREF(Py_None);
17050   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17051   __Pyx_INCREF(__pyx_int_0);
17052   __Pyx_GIVEREF(__pyx_int_0);
17053   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17054   __Pyx_GIVEREF(__pyx_t_2);
17055   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17056   __pyx_t_2 = 0;
17057   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1009, __pyx_L1_error)
17058   __Pyx_GOTREF(__pyx_t_2);
17059   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17060   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17061   __pyx_t_2 = 0;
17062 
17063   /* "View.MemoryView":1011
17064  *     result = _memoryviewslice(None, 0, dtype_is_object)
17065  *
17066  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
17067  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
17068  *
17069  */
17070   __pyx_v_result->from_slice = __pyx_v_memviewslice;
17071 
17072   /* "View.MemoryView":1012
17073  *
17074  *     result.from_slice = memviewslice
17075  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
17076  *
17077  *     result.from_object = (<memoryview> memviewslice.memview).base
17078  */
17079   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17080 
17081   /* "View.MemoryView":1014
17082  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
17083  *
17084  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
17085  *     result.typeinfo = memviewslice.memview.typeinfo
17086  *
17087  */
17088   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1014, __pyx_L1_error)
17089   __Pyx_GOTREF(__pyx_t_2);
17090   __Pyx_GIVEREF(__pyx_t_2);
17091   __Pyx_GOTREF(__pyx_v_result->from_object);
17092   __Pyx_DECREF(__pyx_v_result->from_object);
17093   __pyx_v_result->from_object = __pyx_t_2;
17094   __pyx_t_2 = 0;
17095 
17096   /* "View.MemoryView":1015
17097  *
17098  *     result.from_object = (<memoryview> memviewslice.memview).base
17099  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
17100  *
17101  *     result.view = memviewslice.memview.view
17102  */
17103   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17104   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17105 
17106   /* "View.MemoryView":1017
17107  *     result.typeinfo = memviewslice.memview.typeinfo
17108  *
17109  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
17110  *     result.view.buf = <void *> memviewslice.data
17111  *     result.view.ndim = ndim
17112  */
17113   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17114   __pyx_v_result->__pyx_base.view = __pyx_t_5;
17115 
17116   /* "View.MemoryView":1018
17117  *
17118  *     result.view = memviewslice.memview.view
17119  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
17120  *     result.view.ndim = ndim
17121  *     (<__pyx_buffer *> &result.view).obj = Py_None
17122  */
17123   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17124 
17125   /* "View.MemoryView":1019
17126  *     result.view = memviewslice.memview.view
17127  *     result.view.buf = <void *> memviewslice.data
17128  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
17129  *     (<__pyx_buffer *> &result.view).obj = Py_None
17130  *     Py_INCREF(Py_None)
17131  */
17132   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17133 
17134   /* "View.MemoryView":1020
17135  *     result.view.buf = <void *> memviewslice.data
17136  *     result.view.ndim = ndim
17137  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
17138  *     Py_INCREF(Py_None)
17139  *
17140  */
17141   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17142 
17143   /* "View.MemoryView":1021
17144  *     result.view.ndim = ndim
17145  *     (<__pyx_buffer *> &result.view).obj = Py_None
17146  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
17147  *
17148  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17149  */
17150   Py_INCREF(Py_None);
17151 
17152   /* "View.MemoryView":1023
17153  *     Py_INCREF(Py_None)
17154  *
17155  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
17156  *         result.flags = PyBUF_RECORDS
17157  *     else:
17158  */
17159   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17160   if (__pyx_t_1) {
17161 
17162     /* "View.MemoryView":1024
17163  *
17164  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17165  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
17166  *     else:
17167  *         result.flags = PyBUF_RECORDS_RO
17168  */
17169     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17170 
17171     /* "View.MemoryView":1023
17172  *     Py_INCREF(Py_None)
17173  *
17174  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
17175  *         result.flags = PyBUF_RECORDS
17176  *     else:
17177  */
17178     goto __pyx_L4;
17179   }
17180 
17181   /* "View.MemoryView":1026
17182  *         result.flags = PyBUF_RECORDS
17183  *     else:
17184  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
17185  *
17186  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
17187  */
17188   /*else*/ {
17189     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17190   }
17191   __pyx_L4:;
17192 
17193   /* "View.MemoryView":1028
17194  *         result.flags = PyBUF_RECORDS_RO
17195  *
17196  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
17197  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
17198  *
17199  */
17200   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17201 
17202   /* "View.MemoryView":1029
17203  *
17204  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
17205  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
17206  *
17207  *
17208  */
17209   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17210 
17211   /* "View.MemoryView":1032
17212  *
17213  *
17214  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
17215  *     for suboffset in result.from_slice.suboffsets[:ndim]:
17216  *         if suboffset >= 0:
17217  */
17218   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17219 
17220   /* "View.MemoryView":1033
17221  *
17222  *     result.view.suboffsets = NULL
17223  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
17224  *         if suboffset >= 0:
17225  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17226  */
17227   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17228   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17229     __pyx_t_6 = __pyx_t_8;
17230     __pyx_v_suboffset = (__pyx_t_6[0]);
17231 
17232     /* "View.MemoryView":1034
17233  *     result.view.suboffsets = NULL
17234  *     for suboffset in result.from_slice.suboffsets[:ndim]:
17235  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
17236  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17237  *             break
17238  */
17239     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17240     if (__pyx_t_1) {
17241 
17242       /* "View.MemoryView":1035
17243  *     for suboffset in result.from_slice.suboffsets[:ndim]:
17244  *         if suboffset >= 0:
17245  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
17246  *             break
17247  *
17248  */
17249       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17250 
17251       /* "View.MemoryView":1036
17252  *         if suboffset >= 0:
17253  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17254  *             break             # <<<<<<<<<<<<<<
17255  *
17256  *     result.view.len = result.view.itemsize
17257  */
17258       goto __pyx_L6_break;
17259 
17260       /* "View.MemoryView":1034
17261  *     result.view.suboffsets = NULL
17262  *     for suboffset in result.from_slice.suboffsets[:ndim]:
17263  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
17264  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17265  *             break
17266  */
17267     }
17268   }
17269   __pyx_L6_break:;
17270 
17271   /* "View.MemoryView":1038
17272  *             break
17273  *
17274  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
17275  *     for length in result.view.shape[:ndim]:
17276  *         result.view.len *= length
17277  */
17278   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17279   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17280 
17281   /* "View.MemoryView":1039
17282  *
17283  *     result.view.len = result.view.itemsize
17284  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
17285  *         result.view.len *= length
17286  *
17287  */
17288   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17289   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17290     __pyx_t_6 = __pyx_t_8;
17291     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1039, __pyx_L1_error)
17292     __Pyx_GOTREF(__pyx_t_2);
17293     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17294     __pyx_t_2 = 0;
17295 
17296     /* "View.MemoryView":1040
17297  *     result.view.len = result.view.itemsize
17298  *     for length in result.view.shape[:ndim]:
17299  *         result.view.len *= length             # <<<<<<<<<<<<<<
17300  *
17301  *     result.to_object_func = to_object_func
17302  */
17303     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1040, __pyx_L1_error)
17304     __Pyx_GOTREF(__pyx_t_2);
17305     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1040, __pyx_L1_error)
17306     __Pyx_GOTREF(__pyx_t_3);
17307     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17308     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1040, __pyx_L1_error)
17309     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17310     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17311   }
17312 
17313   /* "View.MemoryView":1042
17314  *         result.view.len *= length
17315  *
17316  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
17317  *     result.to_dtype_func = to_dtype_func
17318  *
17319  */
17320   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17321 
17322   /* "View.MemoryView":1043
17323  *
17324  *     result.to_object_func = to_object_func
17325  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
17326  *
17327  *     return result
17328  */
17329   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17330 
17331   /* "View.MemoryView":1045
17332  *     result.to_dtype_func = to_dtype_func
17333  *
17334  *     return result             # <<<<<<<<<<<<<<
17335  *
17336  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17337  */
17338   __Pyx_XDECREF(__pyx_r);
17339   __Pyx_INCREF(((PyObject *)__pyx_v_result));
17340   __pyx_r = ((PyObject *)__pyx_v_result);
17341   goto __pyx_L0;
17342 
17343   /* "View.MemoryView":995
17344  *
17345  * @cname('__pyx_memoryview_fromslice')
17346  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
17347  *                           int ndim,
17348  *                           object (*to_object_func)(char *),
17349  */
17350 
17351   /* function exit code */
17352   __pyx_L1_error:;
17353   __Pyx_XDECREF(__pyx_t_2);
17354   __Pyx_XDECREF(__pyx_t_3);
17355   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17356   __pyx_r = 0;
17357   __pyx_L0:;
17358   __Pyx_XDECREF((PyObject *)__pyx_v_result);
17359   __Pyx_XDECREF(__pyx_v_length);
17360   __Pyx_XGIVEREF(__pyx_r);
17361   __Pyx_RefNannyFinishContext();
17362   return __pyx_r;
17363 }
17364 
17365 /* "View.MemoryView":1048
17366  *
17367  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17368  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
17369  *                                                    __Pyx_memviewslice *mslice):
17370  *     cdef _memoryviewslice obj
17371  */
17372 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)17373 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17374   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17375   __Pyx_memviewslice *__pyx_r;
17376   __Pyx_RefNannyDeclarations
17377   int __pyx_t_1;
17378   int __pyx_t_2;
17379   PyObject *__pyx_t_3 = NULL;
17380   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17381 
17382   /* "View.MemoryView":1051
17383  *                                                    __Pyx_memviewslice *mslice):
17384  *     cdef _memoryviewslice obj
17385  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
17386  *         obj = memview
17387  *         return &obj.from_slice
17388  */
17389   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17390   __pyx_t_2 = (__pyx_t_1 != 0);
17391   if (__pyx_t_2) {
17392 
17393     /* "View.MemoryView":1052
17394  *     cdef _memoryviewslice obj
17395  *     if isinstance(memview, _memoryviewslice):
17396  *         obj = memview             # <<<<<<<<<<<<<<
17397  *         return &obj.from_slice
17398  *     else:
17399  */
17400     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(3, 1052, __pyx_L1_error)
17401     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17402     __Pyx_INCREF(__pyx_t_3);
17403     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17404     __pyx_t_3 = 0;
17405 
17406     /* "View.MemoryView":1053
17407  *     if isinstance(memview, _memoryviewslice):
17408  *         obj = memview
17409  *         return &obj.from_slice             # <<<<<<<<<<<<<<
17410  *     else:
17411  *         slice_copy(memview, mslice)
17412  */
17413     __pyx_r = (&__pyx_v_obj->from_slice);
17414     goto __pyx_L0;
17415 
17416     /* "View.MemoryView":1051
17417  *                                                    __Pyx_memviewslice *mslice):
17418  *     cdef _memoryviewslice obj
17419  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
17420  *         obj = memview
17421  *         return &obj.from_slice
17422  */
17423   }
17424 
17425   /* "View.MemoryView":1055
17426  *         return &obj.from_slice
17427  *     else:
17428  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
17429  *         return mslice
17430  *
17431  */
17432   /*else*/ {
17433     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17434 
17435     /* "View.MemoryView":1056
17436  *     else:
17437  *         slice_copy(memview, mslice)
17438  *         return mslice             # <<<<<<<<<<<<<<
17439  *
17440  * @cname('__pyx_memoryview_slice_copy')
17441  */
17442     __pyx_r = __pyx_v_mslice;
17443     goto __pyx_L0;
17444   }
17445 
17446   /* "View.MemoryView":1048
17447  *
17448  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17449  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
17450  *                                                    __Pyx_memviewslice *mslice):
17451  *     cdef _memoryviewslice obj
17452  */
17453 
17454   /* function exit code */
17455   __pyx_L1_error:;
17456   __Pyx_XDECREF(__pyx_t_3);
17457   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17458   __pyx_r = 0;
17459   __pyx_L0:;
17460   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17461   __Pyx_RefNannyFinishContext();
17462   return __pyx_r;
17463 }
17464 
17465 /* "View.MemoryView":1059
17466  *
17467  * @cname('__pyx_memoryview_slice_copy')
17468  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
17469  *     cdef int dim
17470  *     cdef (Py_ssize_t*) shape, strides, suboffsets
17471  */
17472 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)17473 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17474   int __pyx_v_dim;
17475   Py_ssize_t *__pyx_v_shape;
17476   Py_ssize_t *__pyx_v_strides;
17477   Py_ssize_t *__pyx_v_suboffsets;
17478   __Pyx_RefNannyDeclarations
17479   Py_ssize_t *__pyx_t_1;
17480   int __pyx_t_2;
17481   int __pyx_t_3;
17482   int __pyx_t_4;
17483   Py_ssize_t __pyx_t_5;
17484   __Pyx_RefNannySetupContext("slice_copy", 0);
17485 
17486   /* "View.MemoryView":1063
17487  *     cdef (Py_ssize_t*) shape, strides, suboffsets
17488  *
17489  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
17490  *     strides = memview.view.strides
17491  *     suboffsets = memview.view.suboffsets
17492  */
17493   __pyx_t_1 = __pyx_v_memview->view.shape;
17494   __pyx_v_shape = __pyx_t_1;
17495 
17496   /* "View.MemoryView":1064
17497  *
17498  *     shape = memview.view.shape
17499  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
17500  *     suboffsets = memview.view.suboffsets
17501  *
17502  */
17503   __pyx_t_1 = __pyx_v_memview->view.strides;
17504   __pyx_v_strides = __pyx_t_1;
17505 
17506   /* "View.MemoryView":1065
17507  *     shape = memview.view.shape
17508  *     strides = memview.view.strides
17509  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
17510  *
17511  *     dst.memview = <__pyx_memoryview *> memview
17512  */
17513   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17514   __pyx_v_suboffsets = __pyx_t_1;
17515 
17516   /* "View.MemoryView":1067
17517  *     suboffsets = memview.view.suboffsets
17518  *
17519  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
17520  *     dst.data = <char *> memview.view.buf
17521  *
17522  */
17523   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17524 
17525   /* "View.MemoryView":1068
17526  *
17527  *     dst.memview = <__pyx_memoryview *> memview
17528  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
17529  *
17530  *     for dim in range(memview.view.ndim):
17531  */
17532   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17533 
17534   /* "View.MemoryView":1070
17535  *     dst.data = <char *> memview.view.buf
17536  *
17537  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
17538  *         dst.shape[dim] = shape[dim]
17539  *         dst.strides[dim] = strides[dim]
17540  */
17541   __pyx_t_2 = __pyx_v_memview->view.ndim;
17542   __pyx_t_3 = __pyx_t_2;
17543   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17544     __pyx_v_dim = __pyx_t_4;
17545 
17546     /* "View.MemoryView":1071
17547  *
17548  *     for dim in range(memview.view.ndim):
17549  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
17550  *         dst.strides[dim] = strides[dim]
17551  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17552  */
17553     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17554 
17555     /* "View.MemoryView":1072
17556  *     for dim in range(memview.view.ndim):
17557  *         dst.shape[dim] = shape[dim]
17558  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
17559  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17560  *
17561  */
17562     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17563 
17564     /* "View.MemoryView":1073
17565  *         dst.shape[dim] = shape[dim]
17566  *         dst.strides[dim] = strides[dim]
17567  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
17568  *
17569  * @cname('__pyx_memoryview_copy_object')
17570  */
17571     if ((__pyx_v_suboffsets != 0)) {
17572       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17573     } else {
17574       __pyx_t_5 = -1L;
17575     }
17576     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17577   }
17578 
17579   /* "View.MemoryView":1059
17580  *
17581  * @cname('__pyx_memoryview_slice_copy')
17582  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
17583  *     cdef int dim
17584  *     cdef (Py_ssize_t*) shape, strides, suboffsets
17585  */
17586 
17587   /* function exit code */
17588   __Pyx_RefNannyFinishContext();
17589 }
17590 
17591 /* "View.MemoryView":1076
17592  *
17593  * @cname('__pyx_memoryview_copy_object')
17594  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
17595  *     "Create a new memoryview object"
17596  *     cdef __Pyx_memviewslice memviewslice
17597  */
17598 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)17599 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17600   __Pyx_memviewslice __pyx_v_memviewslice;
17601   PyObject *__pyx_r = NULL;
17602   __Pyx_RefNannyDeclarations
17603   PyObject *__pyx_t_1 = NULL;
17604   __Pyx_RefNannySetupContext("memoryview_copy", 0);
17605 
17606   /* "View.MemoryView":1079
17607  *     "Create a new memoryview object"
17608  *     cdef __Pyx_memviewslice memviewslice
17609  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
17610  *     return memoryview_copy_from_slice(memview, &memviewslice)
17611  *
17612  */
17613   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17614 
17615   /* "View.MemoryView":1080
17616  *     cdef __Pyx_memviewslice memviewslice
17617  *     slice_copy(memview, &memviewslice)
17618  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
17619  *
17620  * @cname('__pyx_memoryview_copy_object_from_slice')
17621  */
17622   __Pyx_XDECREF(__pyx_r);
17623   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1080, __pyx_L1_error)
17624   __Pyx_GOTREF(__pyx_t_1);
17625   __pyx_r = __pyx_t_1;
17626   __pyx_t_1 = 0;
17627   goto __pyx_L0;
17628 
17629   /* "View.MemoryView":1076
17630  *
17631  * @cname('__pyx_memoryview_copy_object')
17632  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
17633  *     "Create a new memoryview object"
17634  *     cdef __Pyx_memviewslice memviewslice
17635  */
17636 
17637   /* function exit code */
17638   __pyx_L1_error:;
17639   __Pyx_XDECREF(__pyx_t_1);
17640   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17641   __pyx_r = 0;
17642   __pyx_L0:;
17643   __Pyx_XGIVEREF(__pyx_r);
17644   __Pyx_RefNannyFinishContext();
17645   return __pyx_r;
17646 }
17647 
17648 /* "View.MemoryView":1083
17649  *
17650  * @cname('__pyx_memoryview_copy_object_from_slice')
17651  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
17652  *     """
17653  *     Create a new memoryview object from a given memoryview object and slice.
17654  */
17655 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)17656 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17657   PyObject *(*__pyx_v_to_object_func)(char *);
17658   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17659   PyObject *__pyx_r = NULL;
17660   __Pyx_RefNannyDeclarations
17661   int __pyx_t_1;
17662   int __pyx_t_2;
17663   PyObject *(*__pyx_t_3)(char *);
17664   int (*__pyx_t_4)(char *, PyObject *);
17665   PyObject *__pyx_t_5 = NULL;
17666   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17667 
17668   /* "View.MemoryView":1090
17669  *     cdef int (*to_dtype_func)(char *, object) except 0
17670  *
17671  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
17672  *         to_object_func = (<_memoryviewslice> memview).to_object_func
17673  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17674  */
17675   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17676   __pyx_t_2 = (__pyx_t_1 != 0);
17677   if (__pyx_t_2) {
17678 
17679     /* "View.MemoryView":1091
17680  *
17681  *     if isinstance(memview, _memoryviewslice):
17682  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
17683  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17684  *     else:
17685  */
17686     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17687     __pyx_v_to_object_func = __pyx_t_3;
17688 
17689     /* "View.MemoryView":1092
17690  *     if isinstance(memview, _memoryviewslice):
17691  *         to_object_func = (<_memoryviewslice> memview).to_object_func
17692  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
17693  *     else:
17694  *         to_object_func = NULL
17695  */
17696     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17697     __pyx_v_to_dtype_func = __pyx_t_4;
17698 
17699     /* "View.MemoryView":1090
17700  *     cdef int (*to_dtype_func)(char *, object) except 0
17701  *
17702  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
17703  *         to_object_func = (<_memoryviewslice> memview).to_object_func
17704  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17705  */
17706     goto __pyx_L3;
17707   }
17708 
17709   /* "View.MemoryView":1094
17710  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17711  *     else:
17712  *         to_object_func = NULL             # <<<<<<<<<<<<<<
17713  *         to_dtype_func = NULL
17714  *
17715  */
17716   /*else*/ {
17717     __pyx_v_to_object_func = NULL;
17718 
17719     /* "View.MemoryView":1095
17720  *     else:
17721  *         to_object_func = NULL
17722  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
17723  *
17724  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17725  */
17726     __pyx_v_to_dtype_func = NULL;
17727   }
17728   __pyx_L3:;
17729 
17730   /* "View.MemoryView":1097
17731  *         to_dtype_func = NULL
17732  *
17733  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
17734  *                                 to_object_func, to_dtype_func,
17735  *                                 memview.dtype_is_object)
17736  */
17737   __Pyx_XDECREF(__pyx_r);
17738 
17739   /* "View.MemoryView":1099
17740  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17741  *                                 to_object_func, to_dtype_func,
17742  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
17743  *
17744  *
17745  */
17746   __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(3, 1097, __pyx_L1_error)
17747   __Pyx_GOTREF(__pyx_t_5);
17748   __pyx_r = __pyx_t_5;
17749   __pyx_t_5 = 0;
17750   goto __pyx_L0;
17751 
17752   /* "View.MemoryView":1083
17753  *
17754  * @cname('__pyx_memoryview_copy_object_from_slice')
17755  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
17756  *     """
17757  *     Create a new memoryview object from a given memoryview object and slice.
17758  */
17759 
17760   /* function exit code */
17761   __pyx_L1_error:;
17762   __Pyx_XDECREF(__pyx_t_5);
17763   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17764   __pyx_r = 0;
17765   __pyx_L0:;
17766   __Pyx_XGIVEREF(__pyx_r);
17767   __Pyx_RefNannyFinishContext();
17768   return __pyx_r;
17769 }
17770 
17771 /* "View.MemoryView":1105
17772  *
17773  *
17774  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
17775  *     if arg < 0:
17776  *         return -arg
17777  */
17778 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)17779 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17780   Py_ssize_t __pyx_r;
17781   int __pyx_t_1;
17782 
17783   /* "View.MemoryView":1106
17784  *
17785  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17786  *     if arg < 0:             # <<<<<<<<<<<<<<
17787  *         return -arg
17788  *     else:
17789  */
17790   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17791   if (__pyx_t_1) {
17792 
17793     /* "View.MemoryView":1107
17794  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17795  *     if arg < 0:
17796  *         return -arg             # <<<<<<<<<<<<<<
17797  *     else:
17798  *         return arg
17799  */
17800     __pyx_r = (-__pyx_v_arg);
17801     goto __pyx_L0;
17802 
17803     /* "View.MemoryView":1106
17804  *
17805  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17806  *     if arg < 0:             # <<<<<<<<<<<<<<
17807  *         return -arg
17808  *     else:
17809  */
17810   }
17811 
17812   /* "View.MemoryView":1109
17813  *         return -arg
17814  *     else:
17815  *         return arg             # <<<<<<<<<<<<<<
17816  *
17817  * @cname('__pyx_get_best_slice_order')
17818  */
17819   /*else*/ {
17820     __pyx_r = __pyx_v_arg;
17821     goto __pyx_L0;
17822   }
17823 
17824   /* "View.MemoryView":1105
17825  *
17826  *
17827  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
17828  *     if arg < 0:
17829  *         return -arg
17830  */
17831 
17832   /* function exit code */
17833   __pyx_L0:;
17834   return __pyx_r;
17835 }
17836 
17837 /* "View.MemoryView":1112
17838  *
17839  * @cname('__pyx_get_best_slice_order')
17840  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
17841  *     """
17842  *     Figure out the best memory access order for a given slice.
17843  */
17844 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)17845 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17846   int __pyx_v_i;
17847   Py_ssize_t __pyx_v_c_stride;
17848   Py_ssize_t __pyx_v_f_stride;
17849   char __pyx_r;
17850   int __pyx_t_1;
17851   int __pyx_t_2;
17852   int __pyx_t_3;
17853   int __pyx_t_4;
17854 
17855   /* "View.MemoryView":1117
17856  *     """
17857  *     cdef int i
17858  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
17859  *     cdef Py_ssize_t f_stride = 0
17860  *
17861  */
17862   __pyx_v_c_stride = 0;
17863 
17864   /* "View.MemoryView":1118
17865  *     cdef int i
17866  *     cdef Py_ssize_t c_stride = 0
17867  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
17868  *
17869  *     for i in range(ndim - 1, -1, -1):
17870  */
17871   __pyx_v_f_stride = 0;
17872 
17873   /* "View.MemoryView":1120
17874  *     cdef Py_ssize_t f_stride = 0
17875  *
17876  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
17877  *         if mslice.shape[i] > 1:
17878  *             c_stride = mslice.strides[i]
17879  */
17880   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17881     __pyx_v_i = __pyx_t_1;
17882 
17883     /* "View.MemoryView":1121
17884  *
17885  *     for i in range(ndim - 1, -1, -1):
17886  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
17887  *             c_stride = mslice.strides[i]
17888  *             break
17889  */
17890     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17891     if (__pyx_t_2) {
17892 
17893       /* "View.MemoryView":1122
17894  *     for i in range(ndim - 1, -1, -1):
17895  *         if mslice.shape[i] > 1:
17896  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
17897  *             break
17898  *
17899  */
17900       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17901 
17902       /* "View.MemoryView":1123
17903  *         if mslice.shape[i] > 1:
17904  *             c_stride = mslice.strides[i]
17905  *             break             # <<<<<<<<<<<<<<
17906  *
17907  *     for i in range(ndim):
17908  */
17909       goto __pyx_L4_break;
17910 
17911       /* "View.MemoryView":1121
17912  *
17913  *     for i in range(ndim - 1, -1, -1):
17914  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
17915  *             c_stride = mslice.strides[i]
17916  *             break
17917  */
17918     }
17919   }
17920   __pyx_L4_break:;
17921 
17922   /* "View.MemoryView":1125
17923  *             break
17924  *
17925  *     for i in range(ndim):             # <<<<<<<<<<<<<<
17926  *         if mslice.shape[i] > 1:
17927  *             f_stride = mslice.strides[i]
17928  */
17929   __pyx_t_1 = __pyx_v_ndim;
17930   __pyx_t_3 = __pyx_t_1;
17931   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17932     __pyx_v_i = __pyx_t_4;
17933 
17934     /* "View.MemoryView":1126
17935  *
17936  *     for i in range(ndim):
17937  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
17938  *             f_stride = mslice.strides[i]
17939  *             break
17940  */
17941     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17942     if (__pyx_t_2) {
17943 
17944       /* "View.MemoryView":1127
17945  *     for i in range(ndim):
17946  *         if mslice.shape[i] > 1:
17947  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
17948  *             break
17949  *
17950  */
17951       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17952 
17953       /* "View.MemoryView":1128
17954  *         if mslice.shape[i] > 1:
17955  *             f_stride = mslice.strides[i]
17956  *             break             # <<<<<<<<<<<<<<
17957  *
17958  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17959  */
17960       goto __pyx_L7_break;
17961 
17962       /* "View.MemoryView":1126
17963  *
17964  *     for i in range(ndim):
17965  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
17966  *             f_stride = mslice.strides[i]
17967  *             break
17968  */
17969     }
17970   }
17971   __pyx_L7_break:;
17972 
17973   /* "View.MemoryView":1130
17974  *             break
17975  *
17976  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
17977  *         return 'C'
17978  *     else:
17979  */
17980   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17981   if (__pyx_t_2) {
17982 
17983     /* "View.MemoryView":1131
17984  *
17985  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17986  *         return 'C'             # <<<<<<<<<<<<<<
17987  *     else:
17988  *         return 'F'
17989  */
17990     __pyx_r = 'C';
17991     goto __pyx_L0;
17992 
17993     /* "View.MemoryView":1130
17994  *             break
17995  *
17996  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
17997  *         return 'C'
17998  *     else:
17999  */
18000   }
18001 
18002   /* "View.MemoryView":1133
18003  *         return 'C'
18004  *     else:
18005  *         return 'F'             # <<<<<<<<<<<<<<
18006  *
18007  * @cython.cdivision(True)
18008  */
18009   /*else*/ {
18010     __pyx_r = 'F';
18011     goto __pyx_L0;
18012   }
18013 
18014   /* "View.MemoryView":1112
18015  *
18016  * @cname('__pyx_get_best_slice_order')
18017  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
18018  *     """
18019  *     Figure out the best memory access order for a given slice.
18020  */
18021 
18022   /* function exit code */
18023   __pyx_L0:;
18024   return __pyx_r;
18025 }
18026 
18027 /* "View.MemoryView":1136
18028  *
18029  * @cython.cdivision(True)
18030  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
18031  *                                    char *dst_data, Py_ssize_t *dst_strides,
18032  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18033  */
18034 
_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)18035 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) {
18036   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18037   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18038   Py_ssize_t __pyx_v_dst_extent;
18039   Py_ssize_t __pyx_v_src_stride;
18040   Py_ssize_t __pyx_v_dst_stride;
18041   int __pyx_t_1;
18042   int __pyx_t_2;
18043   int __pyx_t_3;
18044   Py_ssize_t __pyx_t_4;
18045   Py_ssize_t __pyx_t_5;
18046   Py_ssize_t __pyx_t_6;
18047 
18048   /* "View.MemoryView":1143
18049  *
18050  *     cdef Py_ssize_t i
18051  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
18052  *     cdef Py_ssize_t dst_extent = dst_shape[0]
18053  *     cdef Py_ssize_t src_stride = src_strides[0]
18054  */
18055   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18056 
18057   /* "View.MemoryView":1144
18058  *     cdef Py_ssize_t i
18059  *     cdef Py_ssize_t src_extent = src_shape[0]
18060  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
18061  *     cdef Py_ssize_t src_stride = src_strides[0]
18062  *     cdef Py_ssize_t dst_stride = dst_strides[0]
18063  */
18064   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18065 
18066   /* "View.MemoryView":1145
18067  *     cdef Py_ssize_t src_extent = src_shape[0]
18068  *     cdef Py_ssize_t dst_extent = dst_shape[0]
18069  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
18070  *     cdef Py_ssize_t dst_stride = dst_strides[0]
18071  *
18072  */
18073   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18074 
18075   /* "View.MemoryView":1146
18076  *     cdef Py_ssize_t dst_extent = dst_shape[0]
18077  *     cdef Py_ssize_t src_stride = src_strides[0]
18078  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
18079  *
18080  *     if ndim == 1:
18081  */
18082   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18083 
18084   /* "View.MemoryView":1148
18085  *     cdef Py_ssize_t dst_stride = dst_strides[0]
18086  *
18087  *     if ndim == 1:             # <<<<<<<<<<<<<<
18088  *        if (src_stride > 0 and dst_stride > 0 and
18089  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18090  */
18091   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18092   if (__pyx_t_1) {
18093 
18094     /* "View.MemoryView":1149
18095  *
18096  *     if ndim == 1:
18097  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
18098  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18099  *            memcpy(dst_data, src_data, itemsize * dst_extent)
18100  */
18101     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18102     if (__pyx_t_2) {
18103     } else {
18104       __pyx_t_1 = __pyx_t_2;
18105       goto __pyx_L5_bool_binop_done;
18106     }
18107     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18108     if (__pyx_t_2) {
18109     } else {
18110       __pyx_t_1 = __pyx_t_2;
18111       goto __pyx_L5_bool_binop_done;
18112     }
18113 
18114     /* "View.MemoryView":1150
18115  *     if ndim == 1:
18116  *        if (src_stride > 0 and dst_stride > 0 and
18117  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
18118  *            memcpy(dst_data, src_data, itemsize * dst_extent)
18119  *        else:
18120  */
18121     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18122     if (__pyx_t_2) {
18123       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18124     }
18125     __pyx_t_3 = (__pyx_t_2 != 0);
18126     __pyx_t_1 = __pyx_t_3;
18127     __pyx_L5_bool_binop_done:;
18128 
18129     /* "View.MemoryView":1149
18130  *
18131  *     if ndim == 1:
18132  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
18133  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18134  *            memcpy(dst_data, src_data, itemsize * dst_extent)
18135  */
18136     if (__pyx_t_1) {
18137 
18138       /* "View.MemoryView":1151
18139  *        if (src_stride > 0 and dst_stride > 0 and
18140  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18141  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
18142  *        else:
18143  *            for i in range(dst_extent):
18144  */
18145       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18146 
18147       /* "View.MemoryView":1149
18148  *
18149  *     if ndim == 1:
18150  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
18151  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18152  *            memcpy(dst_data, src_data, itemsize * dst_extent)
18153  */
18154       goto __pyx_L4;
18155     }
18156 
18157     /* "View.MemoryView":1153
18158  *            memcpy(dst_data, src_data, itemsize * dst_extent)
18159  *        else:
18160  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
18161  *                memcpy(dst_data, src_data, itemsize)
18162  *                src_data += src_stride
18163  */
18164     /*else*/ {
18165       __pyx_t_4 = __pyx_v_dst_extent;
18166       __pyx_t_5 = __pyx_t_4;
18167       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18168         __pyx_v_i = __pyx_t_6;
18169 
18170         /* "View.MemoryView":1154
18171  *        else:
18172  *            for i in range(dst_extent):
18173  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
18174  *                src_data += src_stride
18175  *                dst_data += dst_stride
18176  */
18177         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18178 
18179         /* "View.MemoryView":1155
18180  *            for i in range(dst_extent):
18181  *                memcpy(dst_data, src_data, itemsize)
18182  *                src_data += src_stride             # <<<<<<<<<<<<<<
18183  *                dst_data += dst_stride
18184  *     else:
18185  */
18186         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18187 
18188         /* "View.MemoryView":1156
18189  *                memcpy(dst_data, src_data, itemsize)
18190  *                src_data += src_stride
18191  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
18192  *     else:
18193  *         for i in range(dst_extent):
18194  */
18195         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18196       }
18197     }
18198     __pyx_L4:;
18199 
18200     /* "View.MemoryView":1148
18201  *     cdef Py_ssize_t dst_stride = dst_strides[0]
18202  *
18203  *     if ndim == 1:             # <<<<<<<<<<<<<<
18204  *        if (src_stride > 0 and dst_stride > 0 and
18205  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
18206  */
18207     goto __pyx_L3;
18208   }
18209 
18210   /* "View.MemoryView":1158
18211  *                dst_data += dst_stride
18212  *     else:
18213  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
18214  *             _copy_strided_to_strided(src_data, src_strides + 1,
18215  *                                      dst_data, dst_strides + 1,
18216  */
18217   /*else*/ {
18218     __pyx_t_4 = __pyx_v_dst_extent;
18219     __pyx_t_5 = __pyx_t_4;
18220     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18221       __pyx_v_i = __pyx_t_6;
18222 
18223       /* "View.MemoryView":1159
18224  *     else:
18225  *         for i in range(dst_extent):
18226  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
18227  *                                      dst_data, dst_strides + 1,
18228  *                                      src_shape + 1, dst_shape + 1,
18229  */
18230       _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);
18231 
18232       /* "View.MemoryView":1163
18233  *                                      src_shape + 1, dst_shape + 1,
18234  *                                      ndim - 1, itemsize)
18235  *             src_data += src_stride             # <<<<<<<<<<<<<<
18236  *             dst_data += dst_stride
18237  *
18238  */
18239       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18240 
18241       /* "View.MemoryView":1164
18242  *                                      ndim - 1, itemsize)
18243  *             src_data += src_stride
18244  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
18245  *
18246  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18247  */
18248       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18249     }
18250   }
18251   __pyx_L3:;
18252 
18253   /* "View.MemoryView":1136
18254  *
18255  * @cython.cdivision(True)
18256  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
18257  *                                    char *dst_data, Py_ssize_t *dst_strides,
18258  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18259  */
18260 
18261   /* function exit code */
18262 }
18263 
18264 /* "View.MemoryView":1166
18265  *             dst_data += dst_stride
18266  *
18267  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
18268  *                                   __Pyx_memviewslice *dst,
18269  *                                   int ndim, size_t itemsize) nogil:
18270  */
18271 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)18272 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) {
18273 
18274   /* "View.MemoryView":1169
18275  *                                   __Pyx_memviewslice *dst,
18276  *                                   int ndim, size_t itemsize) nogil:
18277  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
18278  *                              src.shape, dst.shape, ndim, itemsize)
18279  *
18280  */
18281   _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);
18282 
18283   /* "View.MemoryView":1166
18284  *             dst_data += dst_stride
18285  *
18286  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
18287  *                                   __Pyx_memviewslice *dst,
18288  *                                   int ndim, size_t itemsize) nogil:
18289  */
18290 
18291   /* function exit code */
18292 }
18293 
18294 /* "View.MemoryView":1173
18295  *
18296  * @cname('__pyx_memoryview_slice_get_size')
18297  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
18298  *     "Return the size of the memory occupied by the slice in number of bytes"
18299  *     cdef int i
18300  */
18301 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)18302 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18303   int __pyx_v_i;
18304   Py_ssize_t __pyx_v_size;
18305   Py_ssize_t __pyx_r;
18306   Py_ssize_t __pyx_t_1;
18307   int __pyx_t_2;
18308   int __pyx_t_3;
18309   int __pyx_t_4;
18310 
18311   /* "View.MemoryView":1176
18312  *     "Return the size of the memory occupied by the slice in number of bytes"
18313  *     cdef int i
18314  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
18315  *
18316  *     for i in range(ndim):
18317  */
18318   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18319   __pyx_v_size = __pyx_t_1;
18320 
18321   /* "View.MemoryView":1178
18322  *     cdef Py_ssize_t size = src.memview.view.itemsize
18323  *
18324  *     for i in range(ndim):             # <<<<<<<<<<<<<<
18325  *         size *= src.shape[i]
18326  *
18327  */
18328   __pyx_t_2 = __pyx_v_ndim;
18329   __pyx_t_3 = __pyx_t_2;
18330   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18331     __pyx_v_i = __pyx_t_4;
18332 
18333     /* "View.MemoryView":1179
18334  *
18335  *     for i in range(ndim):
18336  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
18337  *
18338  *     return size
18339  */
18340     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
18341   }
18342 
18343   /* "View.MemoryView":1181
18344  *         size *= src.shape[i]
18345  *
18346  *     return size             # <<<<<<<<<<<<<<
18347  *
18348  * @cname('__pyx_fill_contig_strides_array')
18349  */
18350   __pyx_r = __pyx_v_size;
18351   goto __pyx_L0;
18352 
18353   /* "View.MemoryView":1173
18354  *
18355  * @cname('__pyx_memoryview_slice_get_size')
18356  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
18357  *     "Return the size of the memory occupied by the slice in number of bytes"
18358  *     cdef int i
18359  */
18360 
18361   /* function exit code */
18362   __pyx_L0:;
18363   return __pyx_r;
18364 }
18365 
18366 /* "View.MemoryView":1184
18367  *
18368  * @cname('__pyx_fill_contig_strides_array')
18369  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
18370  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18371  *                 int ndim, char order) nogil:
18372  */
18373 
__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)18374 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) {
18375   int __pyx_v_idx;
18376   Py_ssize_t __pyx_r;
18377   int __pyx_t_1;
18378   int __pyx_t_2;
18379   int __pyx_t_3;
18380   int __pyx_t_4;
18381 
18382   /* "View.MemoryView":1193
18383  *     cdef int idx
18384  *
18385  *     if order == 'F':             # <<<<<<<<<<<<<<
18386  *         for idx in range(ndim):
18387  *             strides[idx] = stride
18388  */
18389   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18390   if (__pyx_t_1) {
18391 
18392     /* "View.MemoryView":1194
18393  *
18394  *     if order == 'F':
18395  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
18396  *             strides[idx] = stride
18397  *             stride = stride * shape[idx]
18398  */
18399     __pyx_t_2 = __pyx_v_ndim;
18400     __pyx_t_3 = __pyx_t_2;
18401     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18402       __pyx_v_idx = __pyx_t_4;
18403 
18404       /* "View.MemoryView":1195
18405  *     if order == 'F':
18406  *         for idx in range(ndim):
18407  *             strides[idx] = stride             # <<<<<<<<<<<<<<
18408  *             stride = stride * shape[idx]
18409  *     else:
18410  */
18411       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18412 
18413       /* "View.MemoryView":1196
18414  *         for idx in range(ndim):
18415  *             strides[idx] = stride
18416  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
18417  *     else:
18418  *         for idx in range(ndim - 1, -1, -1):
18419  */
18420       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18421     }
18422 
18423     /* "View.MemoryView":1193
18424  *     cdef int idx
18425  *
18426  *     if order == 'F':             # <<<<<<<<<<<<<<
18427  *         for idx in range(ndim):
18428  *             strides[idx] = stride
18429  */
18430     goto __pyx_L3;
18431   }
18432 
18433   /* "View.MemoryView":1198
18434  *             stride = stride * shape[idx]
18435  *     else:
18436  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
18437  *             strides[idx] = stride
18438  *             stride = stride * shape[idx]
18439  */
18440   /*else*/ {
18441     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18442       __pyx_v_idx = __pyx_t_2;
18443 
18444       /* "View.MemoryView":1199
18445  *     else:
18446  *         for idx in range(ndim - 1, -1, -1):
18447  *             strides[idx] = stride             # <<<<<<<<<<<<<<
18448  *             stride = stride * shape[idx]
18449  *
18450  */
18451       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18452 
18453       /* "View.MemoryView":1200
18454  *         for idx in range(ndim - 1, -1, -1):
18455  *             strides[idx] = stride
18456  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
18457  *
18458  *     return stride
18459  */
18460       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18461     }
18462   }
18463   __pyx_L3:;
18464 
18465   /* "View.MemoryView":1202
18466  *             stride = stride * shape[idx]
18467  *
18468  *     return stride             # <<<<<<<<<<<<<<
18469  *
18470  * @cname('__pyx_memoryview_copy_data_to_temp')
18471  */
18472   __pyx_r = __pyx_v_stride;
18473   goto __pyx_L0;
18474 
18475   /* "View.MemoryView":1184
18476  *
18477  * @cname('__pyx_fill_contig_strides_array')
18478  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
18479  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18480  *                 int ndim, char order) nogil:
18481  */
18482 
18483   /* function exit code */
18484   __pyx_L0:;
18485   return __pyx_r;
18486 }
18487 
18488 /* "View.MemoryView":1205
18489  *
18490  * @cname('__pyx_memoryview_copy_data_to_temp')
18491  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
18492  *                              __Pyx_memviewslice *tmpslice,
18493  *                              char order,
18494  */
18495 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)18496 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) {
18497   int __pyx_v_i;
18498   void *__pyx_v_result;
18499   size_t __pyx_v_itemsize;
18500   size_t __pyx_v_size;
18501   void *__pyx_r;
18502   Py_ssize_t __pyx_t_1;
18503   int __pyx_t_2;
18504   int __pyx_t_3;
18505   struct __pyx_memoryview_obj *__pyx_t_4;
18506   int __pyx_t_5;
18507   int __pyx_t_6;
18508 
18509   /* "View.MemoryView":1216
18510  *     cdef void *result
18511  *
18512  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
18513  *     cdef size_t size = slice_get_size(src, ndim)
18514  *
18515  */
18516   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18517   __pyx_v_itemsize = __pyx_t_1;
18518 
18519   /* "View.MemoryView":1217
18520  *
18521  *     cdef size_t itemsize = src.memview.view.itemsize
18522  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
18523  *
18524  *     result = malloc(size)
18525  */
18526   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18527 
18528   /* "View.MemoryView":1219
18529  *     cdef size_t size = slice_get_size(src, ndim)
18530  *
18531  *     result = malloc(size)             # <<<<<<<<<<<<<<
18532  *     if not result:
18533  *         _err(MemoryError, NULL)
18534  */
18535   __pyx_v_result = malloc(__pyx_v_size);
18536 
18537   /* "View.MemoryView":1220
18538  *
18539  *     result = malloc(size)
18540  *     if not result:             # <<<<<<<<<<<<<<
18541  *         _err(MemoryError, NULL)
18542  *
18543  */
18544   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18545   if (__pyx_t_2) {
18546 
18547     /* "View.MemoryView":1221
18548  *     result = malloc(size)
18549  *     if not result:
18550  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
18551  *
18552  *
18553  */
18554     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 1221, __pyx_L1_error)
18555 
18556     /* "View.MemoryView":1220
18557  *
18558  *     result = malloc(size)
18559  *     if not result:             # <<<<<<<<<<<<<<
18560  *         _err(MemoryError, NULL)
18561  *
18562  */
18563   }
18564 
18565   /* "View.MemoryView":1224
18566  *
18567  *
18568  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
18569  *     tmpslice.memview = src.memview
18570  *     for i in range(ndim):
18571  */
18572   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18573 
18574   /* "View.MemoryView":1225
18575  *
18576  *     tmpslice.data = <char *> result
18577  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
18578  *     for i in range(ndim):
18579  *         tmpslice.shape[i] = src.shape[i]
18580  */
18581   __pyx_t_4 = __pyx_v_src->memview;
18582   __pyx_v_tmpslice->memview = __pyx_t_4;
18583 
18584   /* "View.MemoryView":1226
18585  *     tmpslice.data = <char *> result
18586  *     tmpslice.memview = src.memview
18587  *     for i in range(ndim):             # <<<<<<<<<<<<<<
18588  *         tmpslice.shape[i] = src.shape[i]
18589  *         tmpslice.suboffsets[i] = -1
18590  */
18591   __pyx_t_3 = __pyx_v_ndim;
18592   __pyx_t_5 = __pyx_t_3;
18593   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18594     __pyx_v_i = __pyx_t_6;
18595 
18596     /* "View.MemoryView":1227
18597  *     tmpslice.memview = src.memview
18598  *     for i in range(ndim):
18599  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
18600  *         tmpslice.suboffsets[i] = -1
18601  *
18602  */
18603     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18604 
18605     /* "View.MemoryView":1228
18606  *     for i in range(ndim):
18607  *         tmpslice.shape[i] = src.shape[i]
18608  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
18609  *
18610  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18611  */
18612     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18613   }
18614 
18615   /* "View.MemoryView":1230
18616  *         tmpslice.suboffsets[i] = -1
18617  *
18618  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
18619  *                               ndim, order)
18620  *
18621  */
18622   (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));
18623 
18624   /* "View.MemoryView":1234
18625  *
18626  *
18627  *     for i in range(ndim):             # <<<<<<<<<<<<<<
18628  *         if tmpslice.shape[i] == 1:
18629  *             tmpslice.strides[i] = 0
18630  */
18631   __pyx_t_3 = __pyx_v_ndim;
18632   __pyx_t_5 = __pyx_t_3;
18633   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18634     __pyx_v_i = __pyx_t_6;
18635 
18636     /* "View.MemoryView":1235
18637  *
18638  *     for i in range(ndim):
18639  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
18640  *             tmpslice.strides[i] = 0
18641  *
18642  */
18643     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18644     if (__pyx_t_2) {
18645 
18646       /* "View.MemoryView":1236
18647  *     for i in range(ndim):
18648  *         if tmpslice.shape[i] == 1:
18649  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
18650  *
18651  *     if slice_is_contig(src[0], order, ndim):
18652  */
18653       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18654 
18655       /* "View.MemoryView":1235
18656  *
18657  *     for i in range(ndim):
18658  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
18659  *             tmpslice.strides[i] = 0
18660  *
18661  */
18662     }
18663   }
18664 
18665   /* "View.MemoryView":1238
18666  *             tmpslice.strides[i] = 0
18667  *
18668  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
18669  *         memcpy(result, src.data, size)
18670  *     else:
18671  */
18672   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18673   if (__pyx_t_2) {
18674 
18675     /* "View.MemoryView":1239
18676  *
18677  *     if slice_is_contig(src[0], order, ndim):
18678  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
18679  *     else:
18680  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18681  */
18682     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18683 
18684     /* "View.MemoryView":1238
18685  *             tmpslice.strides[i] = 0
18686  *
18687  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
18688  *         memcpy(result, src.data, size)
18689  *     else:
18690  */
18691     goto __pyx_L9;
18692   }
18693 
18694   /* "View.MemoryView":1241
18695  *         memcpy(result, src.data, size)
18696  *     else:
18697  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
18698  *
18699  *     return result
18700  */
18701   /*else*/ {
18702     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18703   }
18704   __pyx_L9:;
18705 
18706   /* "View.MemoryView":1243
18707  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18708  *
18709  *     return result             # <<<<<<<<<<<<<<
18710  *
18711  *
18712  */
18713   __pyx_r = __pyx_v_result;
18714   goto __pyx_L0;
18715 
18716   /* "View.MemoryView":1205
18717  *
18718  * @cname('__pyx_memoryview_copy_data_to_temp')
18719  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
18720  *                              __Pyx_memviewslice *tmpslice,
18721  *                              char order,
18722  */
18723 
18724   /* function exit code */
18725   __pyx_L1_error:;
18726   {
18727     #ifdef WITH_THREAD
18728     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18729     #endif
18730     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18731     #ifdef WITH_THREAD
18732     __Pyx_PyGILState_Release(__pyx_gilstate_save);
18733     #endif
18734   }
18735   __pyx_r = NULL;
18736   __pyx_L0:;
18737   return __pyx_r;
18738 }
18739 
18740 /* "View.MemoryView":1248
18741  *
18742  * @cname('__pyx_memoryview_err_extents')
18743  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
18744  *                              Py_ssize_t extent2) except -1 with gil:
18745  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18746  */
18747 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)18748 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18749   int __pyx_r;
18750   __Pyx_RefNannyDeclarations
18751   PyObject *__pyx_t_1 = NULL;
18752   PyObject *__pyx_t_2 = NULL;
18753   PyObject *__pyx_t_3 = NULL;
18754   PyObject *__pyx_t_4 = NULL;
18755   #ifdef WITH_THREAD
18756   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18757   #endif
18758   __Pyx_RefNannySetupContext("_err_extents", 0);
18759 
18760   /* "View.MemoryView":1251
18761  *                              Py_ssize_t extent2) except -1 with gil:
18762  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18763  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
18764  *
18765  * @cname('__pyx_memoryview_err_dim')
18766  */
18767   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1251, __pyx_L1_error)
18768   __Pyx_GOTREF(__pyx_t_1);
18769   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1251, __pyx_L1_error)
18770   __Pyx_GOTREF(__pyx_t_2);
18771   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1251, __pyx_L1_error)
18772   __Pyx_GOTREF(__pyx_t_3);
18773   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1251, __pyx_L1_error)
18774   __Pyx_GOTREF(__pyx_t_4);
18775   __Pyx_GIVEREF(__pyx_t_1);
18776   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18777   __Pyx_GIVEREF(__pyx_t_2);
18778   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18779   __Pyx_GIVEREF(__pyx_t_3);
18780   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18781   __pyx_t_1 = 0;
18782   __pyx_t_2 = 0;
18783   __pyx_t_3 = 0;
18784 
18785   /* "View.MemoryView":1250
18786  * cdef int _err_extents(int i, Py_ssize_t extent1,
18787  *                              Py_ssize_t extent2) except -1 with gil:
18788  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
18789  *                                                         (i, extent1, extent2))
18790  *
18791  */
18792   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1250, __pyx_L1_error)
18793   __Pyx_GOTREF(__pyx_t_3);
18794   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18795   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1250, __pyx_L1_error)
18796   __Pyx_GOTREF(__pyx_t_4);
18797   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18798   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18799   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18800   __PYX_ERR(3, 1250, __pyx_L1_error)
18801 
18802   /* "View.MemoryView":1248
18803  *
18804  * @cname('__pyx_memoryview_err_extents')
18805  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
18806  *                              Py_ssize_t extent2) except -1 with gil:
18807  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18808  */
18809 
18810   /* function exit code */
18811   __pyx_L1_error:;
18812   __Pyx_XDECREF(__pyx_t_1);
18813   __Pyx_XDECREF(__pyx_t_2);
18814   __Pyx_XDECREF(__pyx_t_3);
18815   __Pyx_XDECREF(__pyx_t_4);
18816   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18817   __pyx_r = -1;
18818   __Pyx_RefNannyFinishContext();
18819   #ifdef WITH_THREAD
18820   __Pyx_PyGILState_Release(__pyx_gilstate_save);
18821   #endif
18822   return __pyx_r;
18823 }
18824 
18825 /* "View.MemoryView":1254
18826  *
18827  * @cname('__pyx_memoryview_err_dim')
18828  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
18829  *     raise error(msg.decode('ascii') % dim)
18830  *
18831  */
18832 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)18833 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18834   int __pyx_r;
18835   __Pyx_RefNannyDeclarations
18836   PyObject *__pyx_t_1 = NULL;
18837   PyObject *__pyx_t_2 = NULL;
18838   PyObject *__pyx_t_3 = NULL;
18839   PyObject *__pyx_t_4 = NULL;
18840   #ifdef WITH_THREAD
18841   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18842   #endif
18843   __Pyx_RefNannySetupContext("_err_dim", 0);
18844   __Pyx_INCREF(__pyx_v_error);
18845 
18846   /* "View.MemoryView":1255
18847  * @cname('__pyx_memoryview_err_dim')
18848  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18849  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
18850  *
18851  * @cname('__pyx_memoryview_err')
18852  */
18853   __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(3, 1255, __pyx_L1_error)
18854   __Pyx_GOTREF(__pyx_t_2);
18855   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1255, __pyx_L1_error)
18856   __Pyx_GOTREF(__pyx_t_3);
18857   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1255, __pyx_L1_error)
18858   __Pyx_GOTREF(__pyx_t_4);
18859   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18860   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18861   __Pyx_INCREF(__pyx_v_error);
18862   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18863   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18864     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18865     if (likely(__pyx_t_2)) {
18866       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18867       __Pyx_INCREF(__pyx_t_2);
18868       __Pyx_INCREF(function);
18869       __Pyx_DECREF_SET(__pyx_t_3, function);
18870     }
18871   }
18872   __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);
18873   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18874   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18875   if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1255, __pyx_L1_error)
18876   __Pyx_GOTREF(__pyx_t_1);
18877   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18878   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18879   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18880   __PYX_ERR(3, 1255, __pyx_L1_error)
18881 
18882   /* "View.MemoryView":1254
18883  *
18884  * @cname('__pyx_memoryview_err_dim')
18885  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
18886  *     raise error(msg.decode('ascii') % dim)
18887  *
18888  */
18889 
18890   /* function exit code */
18891   __pyx_L1_error:;
18892   __Pyx_XDECREF(__pyx_t_1);
18893   __Pyx_XDECREF(__pyx_t_2);
18894   __Pyx_XDECREF(__pyx_t_3);
18895   __Pyx_XDECREF(__pyx_t_4);
18896   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18897   __pyx_r = -1;
18898   __Pyx_XDECREF(__pyx_v_error);
18899   __Pyx_RefNannyFinishContext();
18900   #ifdef WITH_THREAD
18901   __Pyx_PyGILState_Release(__pyx_gilstate_save);
18902   #endif
18903   return __pyx_r;
18904 }
18905 
18906 /* "View.MemoryView":1258
18907  *
18908  * @cname('__pyx_memoryview_err')
18909  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
18910  *     if msg != NULL:
18911  *         raise error(msg.decode('ascii'))
18912  */
18913 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)18914 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
18915   int __pyx_r;
18916   __Pyx_RefNannyDeclarations
18917   int __pyx_t_1;
18918   PyObject *__pyx_t_2 = NULL;
18919   PyObject *__pyx_t_3 = NULL;
18920   PyObject *__pyx_t_4 = NULL;
18921   PyObject *__pyx_t_5 = NULL;
18922   #ifdef WITH_THREAD
18923   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18924   #endif
18925   __Pyx_RefNannySetupContext("_err", 0);
18926   __Pyx_INCREF(__pyx_v_error);
18927 
18928   /* "View.MemoryView":1259
18929  * @cname('__pyx_memoryview_err')
18930  * cdef int _err(object error, char *msg) except -1 with gil:
18931  *     if msg != NULL:             # <<<<<<<<<<<<<<
18932  *         raise error(msg.decode('ascii'))
18933  *     else:
18934  */
18935   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18936   if (unlikely(__pyx_t_1)) {
18937 
18938     /* "View.MemoryView":1260
18939  * cdef int _err(object error, char *msg) except -1 with gil:
18940  *     if msg != NULL:
18941  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
18942  *     else:
18943  *         raise error
18944  */
18945     __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(3, 1260, __pyx_L1_error)
18946     __Pyx_GOTREF(__pyx_t_3);
18947     __Pyx_INCREF(__pyx_v_error);
18948     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18949     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18950       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18951       if (likely(__pyx_t_5)) {
18952         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18953         __Pyx_INCREF(__pyx_t_5);
18954         __Pyx_INCREF(function);
18955         __Pyx_DECREF_SET(__pyx_t_4, function);
18956       }
18957     }
18958     __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);
18959     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18960     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18961     if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1260, __pyx_L1_error)
18962     __Pyx_GOTREF(__pyx_t_2);
18963     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18964     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18965     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18966     __PYX_ERR(3, 1260, __pyx_L1_error)
18967 
18968     /* "View.MemoryView":1259
18969  * @cname('__pyx_memoryview_err')
18970  * cdef int _err(object error, char *msg) except -1 with gil:
18971  *     if msg != NULL:             # <<<<<<<<<<<<<<
18972  *         raise error(msg.decode('ascii'))
18973  *     else:
18974  */
18975   }
18976 
18977   /* "View.MemoryView":1262
18978  *         raise error(msg.decode('ascii'))
18979  *     else:
18980  *         raise error             # <<<<<<<<<<<<<<
18981  *
18982  * @cname('__pyx_memoryview_copy_contents')
18983  */
18984   /*else*/ {
18985     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18986     __PYX_ERR(3, 1262, __pyx_L1_error)
18987   }
18988 
18989   /* "View.MemoryView":1258
18990  *
18991  * @cname('__pyx_memoryview_err')
18992  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
18993  *     if msg != NULL:
18994  *         raise error(msg.decode('ascii'))
18995  */
18996 
18997   /* function exit code */
18998   __pyx_L1_error:;
18999   __Pyx_XDECREF(__pyx_t_2);
19000   __Pyx_XDECREF(__pyx_t_3);
19001   __Pyx_XDECREF(__pyx_t_4);
19002   __Pyx_XDECREF(__pyx_t_5);
19003   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19004   __pyx_r = -1;
19005   __Pyx_XDECREF(__pyx_v_error);
19006   __Pyx_RefNannyFinishContext();
19007   #ifdef WITH_THREAD
19008   __Pyx_PyGILState_Release(__pyx_gilstate_save);
19009   #endif
19010   return __pyx_r;
19011 }
19012 
19013 /* "View.MemoryView":1265
19014  *
19015  * @cname('__pyx_memoryview_copy_contents')
19016  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
19017  *                                   __Pyx_memviewslice dst,
19018  *                                   int src_ndim, int dst_ndim,
19019  */
19020 
__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)19021 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) {
19022   void *__pyx_v_tmpdata;
19023   size_t __pyx_v_itemsize;
19024   int __pyx_v_i;
19025   char __pyx_v_order;
19026   int __pyx_v_broadcasting;
19027   int __pyx_v_direct_copy;
19028   __Pyx_memviewslice __pyx_v_tmp;
19029   int __pyx_v_ndim;
19030   int __pyx_r;
19031   Py_ssize_t __pyx_t_1;
19032   int __pyx_t_2;
19033   int __pyx_t_3;
19034   int __pyx_t_4;
19035   int __pyx_t_5;
19036   int __pyx_t_6;
19037   void *__pyx_t_7;
19038   int __pyx_t_8;
19039 
19040   /* "View.MemoryView":1273
19041  *     Check for overlapping memory and verify the shapes.
19042  *     """
19043  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
19044  *     cdef size_t itemsize = src.memview.view.itemsize
19045  *     cdef int i
19046  */
19047   __pyx_v_tmpdata = NULL;
19048 
19049   /* "View.MemoryView":1274
19050  *     """
19051  *     cdef void *tmpdata = NULL
19052  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
19053  *     cdef int i
19054  *     cdef char order = get_best_order(&src, src_ndim)
19055  */
19056   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19057   __pyx_v_itemsize = __pyx_t_1;
19058 
19059   /* "View.MemoryView":1276
19060  *     cdef size_t itemsize = src.memview.view.itemsize
19061  *     cdef int i
19062  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
19063  *     cdef bint broadcasting = False
19064  *     cdef bint direct_copy = False
19065  */
19066   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19067 
19068   /* "View.MemoryView":1277
19069  *     cdef int i
19070  *     cdef char order = get_best_order(&src, src_ndim)
19071  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
19072  *     cdef bint direct_copy = False
19073  *     cdef __Pyx_memviewslice tmp
19074  */
19075   __pyx_v_broadcasting = 0;
19076 
19077   /* "View.MemoryView":1278
19078  *     cdef char order = get_best_order(&src, src_ndim)
19079  *     cdef bint broadcasting = False
19080  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
19081  *     cdef __Pyx_memviewslice tmp
19082  *
19083  */
19084   __pyx_v_direct_copy = 0;
19085 
19086   /* "View.MemoryView":1281
19087  *     cdef __Pyx_memviewslice tmp
19088  *
19089  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
19090  *         broadcast_leading(&src, src_ndim, dst_ndim)
19091  *     elif dst_ndim < src_ndim:
19092  */
19093   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19094   if (__pyx_t_2) {
19095 
19096     /* "View.MemoryView":1282
19097  *
19098  *     if src_ndim < dst_ndim:
19099  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
19100  *     elif dst_ndim < src_ndim:
19101  *         broadcast_leading(&dst, dst_ndim, src_ndim)
19102  */
19103     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19104 
19105     /* "View.MemoryView":1281
19106  *     cdef __Pyx_memviewslice tmp
19107  *
19108  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
19109  *         broadcast_leading(&src, src_ndim, dst_ndim)
19110  *     elif dst_ndim < src_ndim:
19111  */
19112     goto __pyx_L3;
19113   }
19114 
19115   /* "View.MemoryView":1283
19116  *     if src_ndim < dst_ndim:
19117  *         broadcast_leading(&src, src_ndim, dst_ndim)
19118  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
19119  *         broadcast_leading(&dst, dst_ndim, src_ndim)
19120  *
19121  */
19122   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19123   if (__pyx_t_2) {
19124 
19125     /* "View.MemoryView":1284
19126  *         broadcast_leading(&src, src_ndim, dst_ndim)
19127  *     elif dst_ndim < src_ndim:
19128  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
19129  *
19130  *     cdef int ndim = max(src_ndim, dst_ndim)
19131  */
19132     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19133 
19134     /* "View.MemoryView":1283
19135  *     if src_ndim < dst_ndim:
19136  *         broadcast_leading(&src, src_ndim, dst_ndim)
19137  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
19138  *         broadcast_leading(&dst, dst_ndim, src_ndim)
19139  *
19140  */
19141   }
19142   __pyx_L3:;
19143 
19144   /* "View.MemoryView":1286
19145  *         broadcast_leading(&dst, dst_ndim, src_ndim)
19146  *
19147  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
19148  *
19149  *     for i in range(ndim):
19150  */
19151   __pyx_t_3 = __pyx_v_dst_ndim;
19152   __pyx_t_4 = __pyx_v_src_ndim;
19153   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19154     __pyx_t_5 = __pyx_t_3;
19155   } else {
19156     __pyx_t_5 = __pyx_t_4;
19157   }
19158   __pyx_v_ndim = __pyx_t_5;
19159 
19160   /* "View.MemoryView":1288
19161  *     cdef int ndim = max(src_ndim, dst_ndim)
19162  *
19163  *     for i in range(ndim):             # <<<<<<<<<<<<<<
19164  *         if src.shape[i] != dst.shape[i]:
19165  *             if src.shape[i] == 1:
19166  */
19167   __pyx_t_5 = __pyx_v_ndim;
19168   __pyx_t_3 = __pyx_t_5;
19169   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19170     __pyx_v_i = __pyx_t_4;
19171 
19172     /* "View.MemoryView":1289
19173  *
19174  *     for i in range(ndim):
19175  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
19176  *             if src.shape[i] == 1:
19177  *                 broadcasting = True
19178  */
19179     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19180     if (__pyx_t_2) {
19181 
19182       /* "View.MemoryView":1290
19183  *     for i in range(ndim):
19184  *         if src.shape[i] != dst.shape[i]:
19185  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
19186  *                 broadcasting = True
19187  *                 src.strides[i] = 0
19188  */
19189       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19190       if (__pyx_t_2) {
19191 
19192         /* "View.MemoryView":1291
19193  *         if src.shape[i] != dst.shape[i]:
19194  *             if src.shape[i] == 1:
19195  *                 broadcasting = True             # <<<<<<<<<<<<<<
19196  *                 src.strides[i] = 0
19197  *             else:
19198  */
19199         __pyx_v_broadcasting = 1;
19200 
19201         /* "View.MemoryView":1292
19202  *             if src.shape[i] == 1:
19203  *                 broadcasting = True
19204  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
19205  *             else:
19206  *                 _err_extents(i, dst.shape[i], src.shape[i])
19207  */
19208         (__pyx_v_src.strides[__pyx_v_i]) = 0;
19209 
19210         /* "View.MemoryView":1290
19211  *     for i in range(ndim):
19212  *         if src.shape[i] != dst.shape[i]:
19213  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
19214  *                 broadcasting = True
19215  *                 src.strides[i] = 0
19216  */
19217         goto __pyx_L7;
19218       }
19219 
19220       /* "View.MemoryView":1294
19221  *                 src.strides[i] = 0
19222  *             else:
19223  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
19224  *
19225  *         if src.suboffsets[i] >= 0:
19226  */
19227       /*else*/ {
19228         __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(3, 1294, __pyx_L1_error)
19229       }
19230       __pyx_L7:;
19231 
19232       /* "View.MemoryView":1289
19233  *
19234  *     for i in range(ndim):
19235  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
19236  *             if src.shape[i] == 1:
19237  *                 broadcasting = True
19238  */
19239     }
19240 
19241     /* "View.MemoryView":1296
19242  *                 _err_extents(i, dst.shape[i], src.shape[i])
19243  *
19244  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
19245  *             _err_dim(ValueError, "Dimension %d is not direct", i)
19246  *
19247  */
19248     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19249     if (__pyx_t_2) {
19250 
19251       /* "View.MemoryView":1297
19252  *
19253  *         if src.suboffsets[i] >= 0:
19254  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
19255  *
19256  *     if slices_overlap(&src, &dst, ndim, itemsize):
19257  */
19258       __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(3, 1297, __pyx_L1_error)
19259 
19260       /* "View.MemoryView":1296
19261  *                 _err_extents(i, dst.shape[i], src.shape[i])
19262  *
19263  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
19264  *             _err_dim(ValueError, "Dimension %d is not direct", i)
19265  *
19266  */
19267     }
19268   }
19269 
19270   /* "View.MemoryView":1299
19271  *             _err_dim(ValueError, "Dimension %d is not direct", i)
19272  *
19273  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
19274  *
19275  *         if not slice_is_contig(src, order, ndim):
19276  */
19277   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19278   if (__pyx_t_2) {
19279 
19280     /* "View.MemoryView":1301
19281  *     if slices_overlap(&src, &dst, ndim, itemsize):
19282  *
19283  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
19284  *             order = get_best_order(&dst, ndim)
19285  *
19286  */
19287     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19288     if (__pyx_t_2) {
19289 
19290       /* "View.MemoryView":1302
19291  *
19292  *         if not slice_is_contig(src, order, ndim):
19293  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
19294  *
19295  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19296  */
19297       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19298 
19299       /* "View.MemoryView":1301
19300  *     if slices_overlap(&src, &dst, ndim, itemsize):
19301  *
19302  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
19303  *             order = get_best_order(&dst, ndim)
19304  *
19305  */
19306     }
19307 
19308     /* "View.MemoryView":1304
19309  *             order = get_best_order(&dst, ndim)
19310  *
19311  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
19312  *         src = tmp
19313  *
19314  */
19315     __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(3, 1304, __pyx_L1_error)
19316     __pyx_v_tmpdata = __pyx_t_7;
19317 
19318     /* "View.MemoryView":1305
19319  *
19320  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19321  *         src = tmp             # <<<<<<<<<<<<<<
19322  *
19323  *     if not broadcasting:
19324  */
19325     __pyx_v_src = __pyx_v_tmp;
19326 
19327     /* "View.MemoryView":1299
19328  *             _err_dim(ValueError, "Dimension %d is not direct", i)
19329  *
19330  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
19331  *
19332  *         if not slice_is_contig(src, order, ndim):
19333  */
19334   }
19335 
19336   /* "View.MemoryView":1307
19337  *         src = tmp
19338  *
19339  *     if not broadcasting:             # <<<<<<<<<<<<<<
19340  *
19341  *
19342  */
19343   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19344   if (__pyx_t_2) {
19345 
19346     /* "View.MemoryView":1310
19347  *
19348  *
19349  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
19350  *             direct_copy = slice_is_contig(dst, 'C', ndim)
19351  *         elif slice_is_contig(src, 'F', ndim):
19352  */
19353     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19354     if (__pyx_t_2) {
19355 
19356       /* "View.MemoryView":1311
19357  *
19358  *         if slice_is_contig(src, 'C', ndim):
19359  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
19360  *         elif slice_is_contig(src, 'F', ndim):
19361  *             direct_copy = slice_is_contig(dst, 'F', ndim)
19362  */
19363       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19364 
19365       /* "View.MemoryView":1310
19366  *
19367  *
19368  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
19369  *             direct_copy = slice_is_contig(dst, 'C', ndim)
19370  *         elif slice_is_contig(src, 'F', ndim):
19371  */
19372       goto __pyx_L12;
19373     }
19374 
19375     /* "View.MemoryView":1312
19376  *         if slice_is_contig(src, 'C', ndim):
19377  *             direct_copy = slice_is_contig(dst, 'C', ndim)
19378  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
19379  *             direct_copy = slice_is_contig(dst, 'F', ndim)
19380  *
19381  */
19382     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19383     if (__pyx_t_2) {
19384 
19385       /* "View.MemoryView":1313
19386  *             direct_copy = slice_is_contig(dst, 'C', ndim)
19387  *         elif slice_is_contig(src, 'F', ndim):
19388  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
19389  *
19390  *         if direct_copy:
19391  */
19392       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19393 
19394       /* "View.MemoryView":1312
19395  *         if slice_is_contig(src, 'C', ndim):
19396  *             direct_copy = slice_is_contig(dst, 'C', ndim)
19397  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
19398  *             direct_copy = slice_is_contig(dst, 'F', ndim)
19399  *
19400  */
19401     }
19402     __pyx_L12:;
19403 
19404     /* "View.MemoryView":1315
19405  *             direct_copy = slice_is_contig(dst, 'F', ndim)
19406  *
19407  *         if direct_copy:             # <<<<<<<<<<<<<<
19408  *
19409  *             refcount_copying(&dst, dtype_is_object, ndim, False)
19410  */
19411     __pyx_t_2 = (__pyx_v_direct_copy != 0);
19412     if (__pyx_t_2) {
19413 
19414       /* "View.MemoryView":1317
19415  *         if direct_copy:
19416  *
19417  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
19418  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19419  *             refcount_copying(&dst, dtype_is_object, ndim, True)
19420  */
19421       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19422 
19423       /* "View.MemoryView":1318
19424  *
19425  *             refcount_copying(&dst, dtype_is_object, ndim, False)
19426  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
19427  *             refcount_copying(&dst, dtype_is_object, ndim, True)
19428  *             free(tmpdata)
19429  */
19430       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19431 
19432       /* "View.MemoryView":1319
19433  *             refcount_copying(&dst, dtype_is_object, ndim, False)
19434  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19435  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
19436  *             free(tmpdata)
19437  *             return 0
19438  */
19439       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19440 
19441       /* "View.MemoryView":1320
19442  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19443  *             refcount_copying(&dst, dtype_is_object, ndim, True)
19444  *             free(tmpdata)             # <<<<<<<<<<<<<<
19445  *             return 0
19446  *
19447  */
19448       free(__pyx_v_tmpdata);
19449 
19450       /* "View.MemoryView":1321
19451  *             refcount_copying(&dst, dtype_is_object, ndim, True)
19452  *             free(tmpdata)
19453  *             return 0             # <<<<<<<<<<<<<<
19454  *
19455  *     if order == 'F' == get_best_order(&dst, ndim):
19456  */
19457       __pyx_r = 0;
19458       goto __pyx_L0;
19459 
19460       /* "View.MemoryView":1315
19461  *             direct_copy = slice_is_contig(dst, 'F', ndim)
19462  *
19463  *         if direct_copy:             # <<<<<<<<<<<<<<
19464  *
19465  *             refcount_copying(&dst, dtype_is_object, ndim, False)
19466  */
19467     }
19468 
19469     /* "View.MemoryView":1307
19470  *         src = tmp
19471  *
19472  *     if not broadcasting:             # <<<<<<<<<<<<<<
19473  *
19474  *
19475  */
19476   }
19477 
19478   /* "View.MemoryView":1323
19479  *             return 0
19480  *
19481  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
19482  *
19483  *
19484  */
19485   __pyx_t_2 = (__pyx_v_order == 'F');
19486   if (__pyx_t_2) {
19487     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19488   }
19489   __pyx_t_8 = (__pyx_t_2 != 0);
19490   if (__pyx_t_8) {
19491 
19492     /* "View.MemoryView":1326
19493  *
19494  *
19495  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
19496  *         transpose_memslice(&dst)
19497  *
19498  */
19499     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(3, 1326, __pyx_L1_error)
19500 
19501     /* "View.MemoryView":1327
19502  *
19503  *         transpose_memslice(&src)
19504  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
19505  *
19506  *     refcount_copying(&dst, dtype_is_object, ndim, False)
19507  */
19508     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(3, 1327, __pyx_L1_error)
19509 
19510     /* "View.MemoryView":1323
19511  *             return 0
19512  *
19513  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
19514  *
19515  *
19516  */
19517   }
19518 
19519   /* "View.MemoryView":1329
19520  *         transpose_memslice(&dst)
19521  *
19522  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
19523  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
19524  *     refcount_copying(&dst, dtype_is_object, ndim, True)
19525  */
19526   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19527 
19528   /* "View.MemoryView":1330
19529  *
19530  *     refcount_copying(&dst, dtype_is_object, ndim, False)
19531  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
19532  *     refcount_copying(&dst, dtype_is_object, ndim, True)
19533  *
19534  */
19535   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19536 
19537   /* "View.MemoryView":1331
19538  *     refcount_copying(&dst, dtype_is_object, ndim, False)
19539  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
19540  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
19541  *
19542  *     free(tmpdata)
19543  */
19544   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19545 
19546   /* "View.MemoryView":1333
19547  *     refcount_copying(&dst, dtype_is_object, ndim, True)
19548  *
19549  *     free(tmpdata)             # <<<<<<<<<<<<<<
19550  *     return 0
19551  *
19552  */
19553   free(__pyx_v_tmpdata);
19554 
19555   /* "View.MemoryView":1334
19556  *
19557  *     free(tmpdata)
19558  *     return 0             # <<<<<<<<<<<<<<
19559  *
19560  * @cname('__pyx_memoryview_broadcast_leading')
19561  */
19562   __pyx_r = 0;
19563   goto __pyx_L0;
19564 
19565   /* "View.MemoryView":1265
19566  *
19567  * @cname('__pyx_memoryview_copy_contents')
19568  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
19569  *                                   __Pyx_memviewslice dst,
19570  *                                   int src_ndim, int dst_ndim,
19571  */
19572 
19573   /* function exit code */
19574   __pyx_L1_error:;
19575   {
19576     #ifdef WITH_THREAD
19577     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19578     #endif
19579     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19580     #ifdef WITH_THREAD
19581     __Pyx_PyGILState_Release(__pyx_gilstate_save);
19582     #endif
19583   }
19584   __pyx_r = -1;
19585   __pyx_L0:;
19586   return __pyx_r;
19587 }
19588 
19589 /* "View.MemoryView":1337
19590  *
19591  * @cname('__pyx_memoryview_broadcast_leading')
19592  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
19593  *                             int ndim,
19594  *                             int ndim_other) nogil:
19595  */
19596 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)19597 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19598   int __pyx_v_i;
19599   int __pyx_v_offset;
19600   int __pyx_t_1;
19601   int __pyx_t_2;
19602   int __pyx_t_3;
19603 
19604   /* "View.MemoryView":1341
19605  *                             int ndim_other) nogil:
19606  *     cdef int i
19607  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
19608  *
19609  *     for i in range(ndim - 1, -1, -1):
19610  */
19611   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19612 
19613   /* "View.MemoryView":1343
19614  *     cdef int offset = ndim_other - ndim
19615  *
19616  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
19617  *         mslice.shape[i + offset] = mslice.shape[i]
19618  *         mslice.strides[i + offset] = mslice.strides[i]
19619  */
19620   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19621     __pyx_v_i = __pyx_t_1;
19622 
19623     /* "View.MemoryView":1344
19624  *
19625  *     for i in range(ndim - 1, -1, -1):
19626  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
19627  *         mslice.strides[i + offset] = mslice.strides[i]
19628  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19629  */
19630     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19631 
19632     /* "View.MemoryView":1345
19633  *     for i in range(ndim - 1, -1, -1):
19634  *         mslice.shape[i + offset] = mslice.shape[i]
19635  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
19636  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19637  *
19638  */
19639     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19640 
19641     /* "View.MemoryView":1346
19642  *         mslice.shape[i + offset] = mslice.shape[i]
19643  *         mslice.strides[i + offset] = mslice.strides[i]
19644  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
19645  *
19646  *     for i in range(offset):
19647  */
19648     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19649   }
19650 
19651   /* "View.MemoryView":1348
19652  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19653  *
19654  *     for i in range(offset):             # <<<<<<<<<<<<<<
19655  *         mslice.shape[i] = 1
19656  *         mslice.strides[i] = mslice.strides[0]
19657  */
19658   __pyx_t_1 = __pyx_v_offset;
19659   __pyx_t_2 = __pyx_t_1;
19660   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19661     __pyx_v_i = __pyx_t_3;
19662 
19663     /* "View.MemoryView":1349
19664  *
19665  *     for i in range(offset):
19666  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
19667  *         mslice.strides[i] = mslice.strides[0]
19668  *         mslice.suboffsets[i] = -1
19669  */
19670     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19671 
19672     /* "View.MemoryView":1350
19673  *     for i in range(offset):
19674  *         mslice.shape[i] = 1
19675  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
19676  *         mslice.suboffsets[i] = -1
19677  *
19678  */
19679     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19680 
19681     /* "View.MemoryView":1351
19682  *         mslice.shape[i] = 1
19683  *         mslice.strides[i] = mslice.strides[0]
19684  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
19685  *
19686  *
19687  */
19688     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19689   }
19690 
19691   /* "View.MemoryView":1337
19692  *
19693  * @cname('__pyx_memoryview_broadcast_leading')
19694  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
19695  *                             int ndim,
19696  *                             int ndim_other) nogil:
19697  */
19698 
19699   /* function exit code */
19700 }
19701 
19702 /* "View.MemoryView":1359
19703  *
19704  * @cname('__pyx_memoryview_refcount_copying')
19705  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
19706  *                            int ndim, bint inc) nogil:
19707  *
19708  */
19709 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)19710 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) {
19711   int __pyx_t_1;
19712 
19713   /* "View.MemoryView":1363
19714  *
19715  *
19716  *     if dtype_is_object:             # <<<<<<<<<<<<<<
19717  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19718  *                                            dst.strides, ndim, inc)
19719  */
19720   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19721   if (__pyx_t_1) {
19722 
19723     /* "View.MemoryView":1364
19724  *
19725  *     if dtype_is_object:
19726  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
19727  *                                            dst.strides, ndim, inc)
19728  *
19729  */
19730     __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);
19731 
19732     /* "View.MemoryView":1363
19733  *
19734  *
19735  *     if dtype_is_object:             # <<<<<<<<<<<<<<
19736  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19737  *                                            dst.strides, ndim, inc)
19738  */
19739   }
19740 
19741   /* "View.MemoryView":1359
19742  *
19743  * @cname('__pyx_memoryview_refcount_copying')
19744  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
19745  *                            int ndim, bint inc) nogil:
19746  *
19747  */
19748 
19749   /* function exit code */
19750 }
19751 
19752 /* "View.MemoryView":1368
19753  *
19754  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19755  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
19756  *                                              Py_ssize_t *strides, int ndim,
19757  *                                              bint inc) with gil:
19758  */
19759 
__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)19760 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) {
19761   __Pyx_RefNannyDeclarations
19762   #ifdef WITH_THREAD
19763   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19764   #endif
19765   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19766 
19767   /* "View.MemoryView":1371
19768  *                                              Py_ssize_t *strides, int ndim,
19769  *                                              bint inc) with gil:
19770  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
19771  *
19772  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19773  */
19774   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19775 
19776   /* "View.MemoryView":1368
19777  *
19778  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19779  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
19780  *                                              Py_ssize_t *strides, int ndim,
19781  *                                              bint inc) with gil:
19782  */
19783 
19784   /* function exit code */
19785   __Pyx_RefNannyFinishContext();
19786   #ifdef WITH_THREAD
19787   __Pyx_PyGILState_Release(__pyx_gilstate_save);
19788   #endif
19789 }
19790 
19791 /* "View.MemoryView":1374
19792  *
19793  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19794  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
19795  *                                     Py_ssize_t *strides, int ndim, bint inc):
19796  *     cdef Py_ssize_t i
19797  */
19798 
__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)19799 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) {
19800   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19801   __Pyx_RefNannyDeclarations
19802   Py_ssize_t __pyx_t_1;
19803   Py_ssize_t __pyx_t_2;
19804   Py_ssize_t __pyx_t_3;
19805   int __pyx_t_4;
19806   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19807 
19808   /* "View.MemoryView":1378
19809  *     cdef Py_ssize_t i
19810  *
19811  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
19812  *         if ndim == 1:
19813  *             if inc:
19814  */
19815   __pyx_t_1 = (__pyx_v_shape[0]);
19816   __pyx_t_2 = __pyx_t_1;
19817   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19818     __pyx_v_i = __pyx_t_3;
19819 
19820     /* "View.MemoryView":1379
19821  *
19822  *     for i in range(shape[0]):
19823  *         if ndim == 1:             # <<<<<<<<<<<<<<
19824  *             if inc:
19825  *                 Py_INCREF((<PyObject **> data)[0])
19826  */
19827     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19828     if (__pyx_t_4) {
19829 
19830       /* "View.MemoryView":1380
19831  *     for i in range(shape[0]):
19832  *         if ndim == 1:
19833  *             if inc:             # <<<<<<<<<<<<<<
19834  *                 Py_INCREF((<PyObject **> data)[0])
19835  *             else:
19836  */
19837       __pyx_t_4 = (__pyx_v_inc != 0);
19838       if (__pyx_t_4) {
19839 
19840         /* "View.MemoryView":1381
19841  *         if ndim == 1:
19842  *             if inc:
19843  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
19844  *             else:
19845  *                 Py_DECREF((<PyObject **> data)[0])
19846  */
19847         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19848 
19849         /* "View.MemoryView":1380
19850  *     for i in range(shape[0]):
19851  *         if ndim == 1:
19852  *             if inc:             # <<<<<<<<<<<<<<
19853  *                 Py_INCREF((<PyObject **> data)[0])
19854  *             else:
19855  */
19856         goto __pyx_L6;
19857       }
19858 
19859       /* "View.MemoryView":1383
19860  *                 Py_INCREF((<PyObject **> data)[0])
19861  *             else:
19862  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
19863  *         else:
19864  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
19865  */
19866       /*else*/ {
19867         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19868       }
19869       __pyx_L6:;
19870 
19871       /* "View.MemoryView":1379
19872  *
19873  *     for i in range(shape[0]):
19874  *         if ndim == 1:             # <<<<<<<<<<<<<<
19875  *             if inc:
19876  *                 Py_INCREF((<PyObject **> data)[0])
19877  */
19878       goto __pyx_L5;
19879     }
19880 
19881     /* "View.MemoryView":1385
19882  *                 Py_DECREF((<PyObject **> data)[0])
19883  *         else:
19884  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
19885  *                                       ndim - 1, inc)
19886  *
19887  */
19888     /*else*/ {
19889 
19890       /* "View.MemoryView":1386
19891  *         else:
19892  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
19893  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
19894  *
19895  *         data += strides[0]
19896  */
19897       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19898     }
19899     __pyx_L5:;
19900 
19901     /* "View.MemoryView":1388
19902  *                                       ndim - 1, inc)
19903  *
19904  *         data += strides[0]             # <<<<<<<<<<<<<<
19905  *
19906  *
19907  */
19908     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19909   }
19910 
19911   /* "View.MemoryView":1374
19912  *
19913  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19914  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
19915  *                                     Py_ssize_t *strides, int ndim, bint inc):
19916  *     cdef Py_ssize_t i
19917  */
19918 
19919   /* function exit code */
19920   __Pyx_RefNannyFinishContext();
19921 }
19922 
19923 /* "View.MemoryView":1394
19924  *
19925  * @cname('__pyx_memoryview_slice_assign_scalar')
19926  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
19927  *                               size_t itemsize, void *item,
19928  *                               bint dtype_is_object) nogil:
19929  */
19930 
__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)19931 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) {
19932 
19933   /* "View.MemoryView":1397
19934  *                               size_t itemsize, void *item,
19935  *                               bint dtype_is_object) nogil:
19936  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
19937  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19938  *                          itemsize, item)
19939  */
19940   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19941 
19942   /* "View.MemoryView":1398
19943  *                               bint dtype_is_object) nogil:
19944  *     refcount_copying(dst, dtype_is_object, ndim, False)
19945  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
19946  *                          itemsize, item)
19947  *     refcount_copying(dst, dtype_is_object, ndim, True)
19948  */
19949   __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);
19950 
19951   /* "View.MemoryView":1400
19952  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19953  *                          itemsize, item)
19954  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
19955  *
19956  *
19957  */
19958   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19959 
19960   /* "View.MemoryView":1394
19961  *
19962  * @cname('__pyx_memoryview_slice_assign_scalar')
19963  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
19964  *                               size_t itemsize, void *item,
19965  *                               bint dtype_is_object) nogil:
19966  */
19967 
19968   /* function exit code */
19969 }
19970 
19971 /* "View.MemoryView":1404
19972  *
19973  * @cname('__pyx_memoryview__slice_assign_scalar')
19974  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
19975  *                               Py_ssize_t *strides, int ndim,
19976  *                               size_t itemsize, void *item) nogil:
19977  */
19978 
__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)19979 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) {
19980   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19981   Py_ssize_t __pyx_v_stride;
19982   Py_ssize_t __pyx_v_extent;
19983   int __pyx_t_1;
19984   Py_ssize_t __pyx_t_2;
19985   Py_ssize_t __pyx_t_3;
19986   Py_ssize_t __pyx_t_4;
19987 
19988   /* "View.MemoryView":1408
19989  *                               size_t itemsize, void *item) nogil:
19990  *     cdef Py_ssize_t i
19991  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
19992  *     cdef Py_ssize_t extent = shape[0]
19993  *
19994  */
19995   __pyx_v_stride = (__pyx_v_strides[0]);
19996 
19997   /* "View.MemoryView":1409
19998  *     cdef Py_ssize_t i
19999  *     cdef Py_ssize_t stride = strides[0]
20000  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
20001  *
20002  *     if ndim == 1:
20003  */
20004   __pyx_v_extent = (__pyx_v_shape[0]);
20005 
20006   /* "View.MemoryView":1411
20007  *     cdef Py_ssize_t extent = shape[0]
20008  *
20009  *     if ndim == 1:             # <<<<<<<<<<<<<<
20010  *         for i in range(extent):
20011  *             memcpy(data, item, itemsize)
20012  */
20013   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20014   if (__pyx_t_1) {
20015 
20016     /* "View.MemoryView":1412
20017  *
20018  *     if ndim == 1:
20019  *         for i in range(extent):             # <<<<<<<<<<<<<<
20020  *             memcpy(data, item, itemsize)
20021  *             data += stride
20022  */
20023     __pyx_t_2 = __pyx_v_extent;
20024     __pyx_t_3 = __pyx_t_2;
20025     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20026       __pyx_v_i = __pyx_t_4;
20027 
20028       /* "View.MemoryView":1413
20029  *     if ndim == 1:
20030  *         for i in range(extent):
20031  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
20032  *             data += stride
20033  *     else:
20034  */
20035       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20036 
20037       /* "View.MemoryView":1414
20038  *         for i in range(extent):
20039  *             memcpy(data, item, itemsize)
20040  *             data += stride             # <<<<<<<<<<<<<<
20041  *     else:
20042  *         for i in range(extent):
20043  */
20044       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20045     }
20046 
20047     /* "View.MemoryView":1411
20048  *     cdef Py_ssize_t extent = shape[0]
20049  *
20050  *     if ndim == 1:             # <<<<<<<<<<<<<<
20051  *         for i in range(extent):
20052  *             memcpy(data, item, itemsize)
20053  */
20054     goto __pyx_L3;
20055   }
20056 
20057   /* "View.MemoryView":1416
20058  *             data += stride
20059  *     else:
20060  *         for i in range(extent):             # <<<<<<<<<<<<<<
20061  *             _slice_assign_scalar(data, shape + 1, strides + 1,
20062  *                                 ndim - 1, itemsize, item)
20063  */
20064   /*else*/ {
20065     __pyx_t_2 = __pyx_v_extent;
20066     __pyx_t_3 = __pyx_t_2;
20067     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20068       __pyx_v_i = __pyx_t_4;
20069 
20070       /* "View.MemoryView":1417
20071  *     else:
20072  *         for i in range(extent):
20073  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
20074  *                                 ndim - 1, itemsize, item)
20075  *             data += stride
20076  */
20077       __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);
20078 
20079       /* "View.MemoryView":1419
20080  *             _slice_assign_scalar(data, shape + 1, strides + 1,
20081  *                                 ndim - 1, itemsize, item)
20082  *             data += stride             # <<<<<<<<<<<<<<
20083  *
20084  *
20085  */
20086       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20087     }
20088   }
20089   __pyx_L3:;
20090 
20091   /* "View.MemoryView":1404
20092  *
20093  * @cname('__pyx_memoryview__slice_assign_scalar')
20094  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
20095  *                               Py_ssize_t *strides, int ndim,
20096  *                               size_t itemsize, void *item) nogil:
20097  */
20098 
20099   /* function exit code */
20100 }
20101 
20102 /* "(tree fragment)":1
20103  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
20104  *     cdef object __pyx_PickleError
20105  *     cdef object __pyx_result
20106  */
20107 
20108 /* Python wrapper */
20109 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20110 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)20111 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20112   PyObject *__pyx_v___pyx_type = 0;
20113   long __pyx_v___pyx_checksum;
20114   PyObject *__pyx_v___pyx_state = 0;
20115   PyObject *__pyx_r = 0;
20116   __Pyx_RefNannyDeclarations
20117   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20118   {
20119     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20120     PyObject* values[3] = {0,0,0};
20121     if (unlikely(__pyx_kwds)) {
20122       Py_ssize_t kw_args;
20123       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20124       switch (pos_args) {
20125         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20126         CYTHON_FALLTHROUGH;
20127         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20128         CYTHON_FALLTHROUGH;
20129         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20130         CYTHON_FALLTHROUGH;
20131         case  0: break;
20132         default: goto __pyx_L5_argtuple_error;
20133       }
20134       kw_args = PyDict_Size(__pyx_kwds);
20135       switch (pos_args) {
20136         case  0:
20137         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20138         else goto __pyx_L5_argtuple_error;
20139         CYTHON_FALLTHROUGH;
20140         case  1:
20141         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20142         else {
20143           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(3, 1, __pyx_L3_error)
20144         }
20145         CYTHON_FALLTHROUGH;
20146         case  2:
20147         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20148         else {
20149           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(3, 1, __pyx_L3_error)
20150         }
20151       }
20152       if (unlikely(kw_args > 0)) {
20153         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(3, 1, __pyx_L3_error)
20154       }
20155     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20156       goto __pyx_L5_argtuple_error;
20157     } else {
20158       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20159       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20160       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20161     }
20162     __pyx_v___pyx_type = values[0];
20163     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(3, 1, __pyx_L3_error)
20164     __pyx_v___pyx_state = values[2];
20165   }
20166   goto __pyx_L4_argument_unpacking_done;
20167   __pyx_L5_argtuple_error:;
20168   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1, __pyx_L3_error)
20169   __pyx_L3_error:;
20170   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20171   __Pyx_RefNannyFinishContext();
20172   return NULL;
20173   __pyx_L4_argument_unpacking_done:;
20174   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20175 
20176   /* function exit code */
20177   __Pyx_RefNannyFinishContext();
20178   return __pyx_r;
20179 }
20180 
__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)20181 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) {
20182   PyObject *__pyx_v___pyx_PickleError = 0;
20183   PyObject *__pyx_v___pyx_result = 0;
20184   PyObject *__pyx_r = NULL;
20185   __Pyx_RefNannyDeclarations
20186   int __pyx_t_1;
20187   PyObject *__pyx_t_2 = NULL;
20188   PyObject *__pyx_t_3 = NULL;
20189   PyObject *__pyx_t_4 = NULL;
20190   PyObject *__pyx_t_5 = NULL;
20191   int __pyx_t_6;
20192   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20193 
20194   /* "(tree fragment)":4
20195  *     cdef object __pyx_PickleError
20196  *     cdef object __pyx_result
20197  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
20198  *         from pickle import PickleError as __pyx_PickleError
20199  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20200  */
20201   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20202   if (__pyx_t_1) {
20203 
20204     /* "(tree fragment)":5
20205  *     cdef object __pyx_result
20206  *     if __pyx_checksum != 0xb068931:
20207  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
20208  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20209  *     __pyx_result = Enum.__new__(__pyx_type)
20210  */
20211     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
20212     __Pyx_GOTREF(__pyx_t_2);
20213     __Pyx_INCREF(__pyx_n_s_PickleError);
20214     __Pyx_GIVEREF(__pyx_n_s_PickleError);
20215     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20216     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5, __pyx_L1_error)
20217     __Pyx_GOTREF(__pyx_t_3);
20218     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20219     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
20220     __Pyx_GOTREF(__pyx_t_2);
20221     __Pyx_INCREF(__pyx_t_2);
20222     __pyx_v___pyx_PickleError = __pyx_t_2;
20223     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20224     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20225 
20226     /* "(tree fragment)":6
20227  *     if __pyx_checksum != 0xb068931:
20228  *         from pickle import PickleError as __pyx_PickleError
20229  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
20230  *     __pyx_result = Enum.__new__(__pyx_type)
20231  *     if __pyx_state is not None:
20232  */
20233     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error)
20234     __Pyx_GOTREF(__pyx_t_2);
20235     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6, __pyx_L1_error)
20236     __Pyx_GOTREF(__pyx_t_4);
20237     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20238     __Pyx_INCREF(__pyx_v___pyx_PickleError);
20239     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20240     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20241       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20242       if (likely(__pyx_t_5)) {
20243         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20244         __Pyx_INCREF(__pyx_t_5);
20245         __Pyx_INCREF(function);
20246         __Pyx_DECREF_SET(__pyx_t_2, function);
20247       }
20248     }
20249     __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);
20250     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20251     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20252     if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6, __pyx_L1_error)
20253     __Pyx_GOTREF(__pyx_t_3);
20254     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20255     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20256     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20257     __PYX_ERR(3, 6, __pyx_L1_error)
20258 
20259     /* "(tree fragment)":4
20260  *     cdef object __pyx_PickleError
20261  *     cdef object __pyx_result
20262  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
20263  *         from pickle import PickleError as __pyx_PickleError
20264  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20265  */
20266   }
20267 
20268   /* "(tree fragment)":7
20269  *         from pickle import PickleError as __pyx_PickleError
20270  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20271  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
20272  *     if __pyx_state is not None:
20273  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20274  */
20275   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
20276   __Pyx_GOTREF(__pyx_t_2);
20277   __pyx_t_4 = NULL;
20278   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20279     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20280     if (likely(__pyx_t_4)) {
20281       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20282       __Pyx_INCREF(__pyx_t_4);
20283       __Pyx_INCREF(function);
20284       __Pyx_DECREF_SET(__pyx_t_2, function);
20285     }
20286   }
20287   __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);
20288   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20289   if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7, __pyx_L1_error)
20290   __Pyx_GOTREF(__pyx_t_3);
20291   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20292   __pyx_v___pyx_result = __pyx_t_3;
20293   __pyx_t_3 = 0;
20294 
20295   /* "(tree fragment)":8
20296  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20297  *     __pyx_result = Enum.__new__(__pyx_type)
20298  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
20299  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20300  *     return __pyx_result
20301  */
20302   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20303   __pyx_t_6 = (__pyx_t_1 != 0);
20304   if (__pyx_t_6) {
20305 
20306     /* "(tree fragment)":9
20307  *     __pyx_result = Enum.__new__(__pyx_type)
20308  *     if __pyx_state is not None:
20309  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
20310  *     return __pyx_result
20311  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20312  */
20313     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(3, 9, __pyx_L1_error)
20314     __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(3, 9, __pyx_L1_error)
20315     __Pyx_GOTREF(__pyx_t_3);
20316     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20317 
20318     /* "(tree fragment)":8
20319  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20320  *     __pyx_result = Enum.__new__(__pyx_type)
20321  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
20322  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20323  *     return __pyx_result
20324  */
20325   }
20326 
20327   /* "(tree fragment)":10
20328  *     if __pyx_state is not None:
20329  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20330  *     return __pyx_result             # <<<<<<<<<<<<<<
20331  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20332  *     __pyx_result.name = __pyx_state[0]
20333  */
20334   __Pyx_XDECREF(__pyx_r);
20335   __Pyx_INCREF(__pyx_v___pyx_result);
20336   __pyx_r = __pyx_v___pyx_result;
20337   goto __pyx_L0;
20338 
20339   /* "(tree fragment)":1
20340  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
20341  *     cdef object __pyx_PickleError
20342  *     cdef object __pyx_result
20343  */
20344 
20345   /* function exit code */
20346   __pyx_L1_error:;
20347   __Pyx_XDECREF(__pyx_t_2);
20348   __Pyx_XDECREF(__pyx_t_3);
20349   __Pyx_XDECREF(__pyx_t_4);
20350   __Pyx_XDECREF(__pyx_t_5);
20351   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20352   __pyx_r = NULL;
20353   __pyx_L0:;
20354   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20355   __Pyx_XDECREF(__pyx_v___pyx_result);
20356   __Pyx_XGIVEREF(__pyx_r);
20357   __Pyx_RefNannyFinishContext();
20358   return __pyx_r;
20359 }
20360 
20361 /* "(tree fragment)":11
20362  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20363  *     return __pyx_result
20364  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
20365  *     __pyx_result.name = __pyx_state[0]
20366  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20367  */
20368 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)20369 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20370   PyObject *__pyx_r = NULL;
20371   __Pyx_RefNannyDeclarations
20372   PyObject *__pyx_t_1 = NULL;
20373   int __pyx_t_2;
20374   Py_ssize_t __pyx_t_3;
20375   int __pyx_t_4;
20376   int __pyx_t_5;
20377   PyObject *__pyx_t_6 = NULL;
20378   PyObject *__pyx_t_7 = NULL;
20379   PyObject *__pyx_t_8 = NULL;
20380   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20381 
20382   /* "(tree fragment)":12
20383  *     return __pyx_result
20384  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20385  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
20386  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20387  *         __pyx_result.__dict__.update(__pyx_state[1])
20388  */
20389   if (unlikely(__pyx_v___pyx_state == Py_None)) {
20390     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20391     __PYX_ERR(3, 12, __pyx_L1_error)
20392   }
20393   __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(3, 12, __pyx_L1_error)
20394   __Pyx_GOTREF(__pyx_t_1);
20395   __Pyx_GIVEREF(__pyx_t_1);
20396   __Pyx_GOTREF(__pyx_v___pyx_result->name);
20397   __Pyx_DECREF(__pyx_v___pyx_result->name);
20398   __pyx_v___pyx_result->name = __pyx_t_1;
20399   __pyx_t_1 = 0;
20400 
20401   /* "(tree fragment)":13
20402  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20403  *     __pyx_result.name = __pyx_state[0]
20404  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
20405  *         __pyx_result.__dict__.update(__pyx_state[1])
20406  */
20407   if (unlikely(__pyx_v___pyx_state == Py_None)) {
20408     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20409     __PYX_ERR(3, 13, __pyx_L1_error)
20410   }
20411   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 13, __pyx_L1_error)
20412   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20413   if (__pyx_t_4) {
20414   } else {
20415     __pyx_t_2 = __pyx_t_4;
20416     goto __pyx_L4_bool_binop_done;
20417   }
20418   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 13, __pyx_L1_error)
20419   __pyx_t_5 = (__pyx_t_4 != 0);
20420   __pyx_t_2 = __pyx_t_5;
20421   __pyx_L4_bool_binop_done:;
20422   if (__pyx_t_2) {
20423 
20424     /* "(tree fragment)":14
20425  *     __pyx_result.name = __pyx_state[0]
20426  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20427  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
20428  */
20429     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 14, __pyx_L1_error)
20430     __Pyx_GOTREF(__pyx_t_6);
20431     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 14, __pyx_L1_error)
20432     __Pyx_GOTREF(__pyx_t_7);
20433     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20434     if (unlikely(__pyx_v___pyx_state == Py_None)) {
20435       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20436       __PYX_ERR(3, 14, __pyx_L1_error)
20437     }
20438     __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(3, 14, __pyx_L1_error)
20439     __Pyx_GOTREF(__pyx_t_6);
20440     __pyx_t_8 = NULL;
20441     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20442       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20443       if (likely(__pyx_t_8)) {
20444         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20445         __Pyx_INCREF(__pyx_t_8);
20446         __Pyx_INCREF(function);
20447         __Pyx_DECREF_SET(__pyx_t_7, function);
20448       }
20449     }
20450     __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);
20451     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20452     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20453     if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 14, __pyx_L1_error)
20454     __Pyx_GOTREF(__pyx_t_1);
20455     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20456     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20457 
20458     /* "(tree fragment)":13
20459  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20460  *     __pyx_result.name = __pyx_state[0]
20461  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
20462  *         __pyx_result.__dict__.update(__pyx_state[1])
20463  */
20464   }
20465 
20466   /* "(tree fragment)":11
20467  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20468  *     return __pyx_result
20469  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
20470  *     __pyx_result.name = __pyx_state[0]
20471  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20472  */
20473 
20474   /* function exit code */
20475   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20476   goto __pyx_L0;
20477   __pyx_L1_error:;
20478   __Pyx_XDECREF(__pyx_t_1);
20479   __Pyx_XDECREF(__pyx_t_6);
20480   __Pyx_XDECREF(__pyx_t_7);
20481   __Pyx_XDECREF(__pyx_t_8);
20482   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20483   __pyx_r = 0;
20484   __pyx_L0:;
20485   __Pyx_XGIVEREF(__pyx_r);
20486   __Pyx_RefNannyFinishContext();
20487   return __pyx_r;
20488 }
20489 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20490 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)20491 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20492   struct __pyx_array_obj *p;
20493   PyObject *o;
20494   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20495     o = (*t->tp_alloc)(t, 0);
20496   } else {
20497     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20498   }
20499   if (unlikely(!o)) return 0;
20500   p = ((struct __pyx_array_obj *)o);
20501   p->__pyx_vtab = __pyx_vtabptr_array;
20502   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20503   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20504   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20505   return o;
20506   bad:
20507   Py_DECREF(o); o = 0;
20508   return NULL;
20509 }
20510 
__pyx_tp_dealloc_array(PyObject * o)20511 static void __pyx_tp_dealloc_array(PyObject *o) {
20512   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20513   #if CYTHON_USE_TP_FINALIZE
20514   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))) {
20515     if (PyObject_CallFinalizerFromDealloc(o)) return;
20516   }
20517   #endif
20518   {
20519     PyObject *etype, *eval, *etb;
20520     PyErr_Fetch(&etype, &eval, &etb);
20521     ++Py_REFCNT(o);
20522     __pyx_array___dealloc__(o);
20523     --Py_REFCNT(o);
20524     PyErr_Restore(etype, eval, etb);
20525   }
20526   Py_CLEAR(p->mode);
20527   Py_CLEAR(p->_format);
20528   (*Py_TYPE(o)->tp_free)(o);
20529 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)20530 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20531   PyObject *r;
20532   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20533   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20534   Py_DECREF(x);
20535   return r;
20536 }
20537 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)20538 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20539   if (v) {
20540     return __pyx_array___setitem__(o, i, v);
20541   }
20542   else {
20543     PyErr_Format(PyExc_NotImplementedError,
20544       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20545     return -1;
20546   }
20547 }
20548 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)20549 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20550   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20551   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20552     PyErr_Clear();
20553     v = __pyx_array___getattr__(o, n);
20554   }
20555   return v;
20556 }
20557 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)20558 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
20559   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20560 }
20561 
20562 static PyMethodDef __pyx_methods_array[] = {
20563   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20564   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20565   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20566   {0, 0, 0, 0}
20567 };
20568 
20569 static struct PyGetSetDef __pyx_getsets_array[] = {
20570   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20571   {0, 0, 0, 0, 0}
20572 };
20573 
20574 static PySequenceMethods __pyx_tp_as_sequence_array = {
20575   __pyx_array___len__, /*sq_length*/
20576   0, /*sq_concat*/
20577   0, /*sq_repeat*/
20578   __pyx_sq_item_array, /*sq_item*/
20579   0, /*sq_slice*/
20580   0, /*sq_ass_item*/
20581   0, /*sq_ass_slice*/
20582   0, /*sq_contains*/
20583   0, /*sq_inplace_concat*/
20584   0, /*sq_inplace_repeat*/
20585 };
20586 
20587 static PyMappingMethods __pyx_tp_as_mapping_array = {
20588   __pyx_array___len__, /*mp_length*/
20589   __pyx_array___getitem__, /*mp_subscript*/
20590   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20591 };
20592 
20593 static PyBufferProcs __pyx_tp_as_buffer_array = {
20594   #if PY_MAJOR_VERSION < 3
20595   0, /*bf_getreadbuffer*/
20596   #endif
20597   #if PY_MAJOR_VERSION < 3
20598   0, /*bf_getwritebuffer*/
20599   #endif
20600   #if PY_MAJOR_VERSION < 3
20601   0, /*bf_getsegcount*/
20602   #endif
20603   #if PY_MAJOR_VERSION < 3
20604   0, /*bf_getcharbuffer*/
20605   #endif
20606   __pyx_array_getbuffer, /*bf_getbuffer*/
20607   0, /*bf_releasebuffer*/
20608 };
20609 
20610 static PyTypeObject __pyx_type___pyx_array = {
20611   PyVarObject_HEAD_INIT(0, 0)
20612   "yt.utilities.lib.lenses.array", /*tp_name*/
20613   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
20614   0, /*tp_itemsize*/
20615   __pyx_tp_dealloc_array, /*tp_dealloc*/
20616   0, /*tp_print*/
20617   0, /*tp_getattr*/
20618   0, /*tp_setattr*/
20619   #if PY_MAJOR_VERSION < 3
20620   0, /*tp_compare*/
20621   #endif
20622   #if PY_MAJOR_VERSION >= 3
20623   0, /*tp_as_async*/
20624   #endif
20625   0, /*tp_repr*/
20626   0, /*tp_as_number*/
20627   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
20628   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
20629   0, /*tp_hash*/
20630   0, /*tp_call*/
20631   0, /*tp_str*/
20632   __pyx_tp_getattro_array, /*tp_getattro*/
20633   0, /*tp_setattro*/
20634   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
20635   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20636   0, /*tp_doc*/
20637   0, /*tp_traverse*/
20638   0, /*tp_clear*/
20639   0, /*tp_richcompare*/
20640   0, /*tp_weaklistoffset*/
20641   0, /*tp_iter*/
20642   0, /*tp_iternext*/
20643   __pyx_methods_array, /*tp_methods*/
20644   0, /*tp_members*/
20645   __pyx_getsets_array, /*tp_getset*/
20646   0, /*tp_base*/
20647   0, /*tp_dict*/
20648   0, /*tp_descr_get*/
20649   0, /*tp_descr_set*/
20650   0, /*tp_dictoffset*/
20651   0, /*tp_init*/
20652   0, /*tp_alloc*/
20653   __pyx_tp_new_array, /*tp_new*/
20654   0, /*tp_free*/
20655   0, /*tp_is_gc*/
20656   0, /*tp_bases*/
20657   0, /*tp_mro*/
20658   0, /*tp_cache*/
20659   0, /*tp_subclasses*/
20660   0, /*tp_weaklist*/
20661   0, /*tp_del*/
20662   0, /*tp_version_tag*/
20663   #if PY_VERSION_HEX >= 0x030400a1
20664   0, /*tp_finalize*/
20665   #endif
20666   #if PY_VERSION_HEX >= 0x030800b1
20667   0, /*tp_vectorcall*/
20668   #endif
20669 };
20670 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)20671 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20672   struct __pyx_MemviewEnum_obj *p;
20673   PyObject *o;
20674   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20675     o = (*t->tp_alloc)(t, 0);
20676   } else {
20677     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20678   }
20679   if (unlikely(!o)) return 0;
20680   p = ((struct __pyx_MemviewEnum_obj *)o);
20681   p->name = Py_None; Py_INCREF(Py_None);
20682   return o;
20683 }
20684 
__pyx_tp_dealloc_Enum(PyObject * o)20685 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20686   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20687   #if CYTHON_USE_TP_FINALIZE
20688   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20689     if (PyObject_CallFinalizerFromDealloc(o)) return;
20690   }
20691   #endif
20692   PyObject_GC_UnTrack(o);
20693   Py_CLEAR(p->name);
20694   (*Py_TYPE(o)->tp_free)(o);
20695 }
20696 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)20697 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20698   int e;
20699   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20700   if (p->name) {
20701     e = (*v)(p->name, a); if (e) return e;
20702   }
20703   return 0;
20704 }
20705 
__pyx_tp_clear_Enum(PyObject * o)20706 static int __pyx_tp_clear_Enum(PyObject *o) {
20707   PyObject* tmp;
20708   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20709   tmp = ((PyObject*)p->name);
20710   p->name = Py_None; Py_INCREF(Py_None);
20711   Py_XDECREF(tmp);
20712   return 0;
20713 }
20714 
20715 static PyMethodDef __pyx_methods_Enum[] = {
20716   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20717   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20718   {0, 0, 0, 0}
20719 };
20720 
20721 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20722   PyVarObject_HEAD_INIT(0, 0)
20723   "yt.utilities.lib.lenses.Enum", /*tp_name*/
20724   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20725   0, /*tp_itemsize*/
20726   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20727   0, /*tp_print*/
20728   0, /*tp_getattr*/
20729   0, /*tp_setattr*/
20730   #if PY_MAJOR_VERSION < 3
20731   0, /*tp_compare*/
20732   #endif
20733   #if PY_MAJOR_VERSION >= 3
20734   0, /*tp_as_async*/
20735   #endif
20736   __pyx_MemviewEnum___repr__, /*tp_repr*/
20737   0, /*tp_as_number*/
20738   0, /*tp_as_sequence*/
20739   0, /*tp_as_mapping*/
20740   0, /*tp_hash*/
20741   0, /*tp_call*/
20742   0, /*tp_str*/
20743   0, /*tp_getattro*/
20744   0, /*tp_setattro*/
20745   0, /*tp_as_buffer*/
20746   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20747   0, /*tp_doc*/
20748   __pyx_tp_traverse_Enum, /*tp_traverse*/
20749   __pyx_tp_clear_Enum, /*tp_clear*/
20750   0, /*tp_richcompare*/
20751   0, /*tp_weaklistoffset*/
20752   0, /*tp_iter*/
20753   0, /*tp_iternext*/
20754   __pyx_methods_Enum, /*tp_methods*/
20755   0, /*tp_members*/
20756   0, /*tp_getset*/
20757   0, /*tp_base*/
20758   0, /*tp_dict*/
20759   0, /*tp_descr_get*/
20760   0, /*tp_descr_set*/
20761   0, /*tp_dictoffset*/
20762   __pyx_MemviewEnum___init__, /*tp_init*/
20763   0, /*tp_alloc*/
20764   __pyx_tp_new_Enum, /*tp_new*/
20765   0, /*tp_free*/
20766   0, /*tp_is_gc*/
20767   0, /*tp_bases*/
20768   0, /*tp_mro*/
20769   0, /*tp_cache*/
20770   0, /*tp_subclasses*/
20771   0, /*tp_weaklist*/
20772   0, /*tp_del*/
20773   0, /*tp_version_tag*/
20774   #if PY_VERSION_HEX >= 0x030400a1
20775   0, /*tp_finalize*/
20776   #endif
20777   #if PY_VERSION_HEX >= 0x030800b1
20778   0, /*tp_vectorcall*/
20779   #endif
20780 };
20781 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20782 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)20783 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20784   struct __pyx_memoryview_obj *p;
20785   PyObject *o;
20786   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20787     o = (*t->tp_alloc)(t, 0);
20788   } else {
20789     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20790   }
20791   if (unlikely(!o)) return 0;
20792   p = ((struct __pyx_memoryview_obj *)o);
20793   p->__pyx_vtab = __pyx_vtabptr_memoryview;
20794   p->obj = Py_None; Py_INCREF(Py_None);
20795   p->_size = Py_None; Py_INCREF(Py_None);
20796   p->_array_interface = Py_None; Py_INCREF(Py_None);
20797   p->view.obj = NULL;
20798   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
20799   return o;
20800   bad:
20801   Py_DECREF(o); o = 0;
20802   return NULL;
20803 }
20804 
__pyx_tp_dealloc_memoryview(PyObject * o)20805 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20806   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20807   #if CYTHON_USE_TP_FINALIZE
20808   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20809     if (PyObject_CallFinalizerFromDealloc(o)) return;
20810   }
20811   #endif
20812   PyObject_GC_UnTrack(o);
20813   {
20814     PyObject *etype, *eval, *etb;
20815     PyErr_Fetch(&etype, &eval, &etb);
20816     ++Py_REFCNT(o);
20817     __pyx_memoryview___dealloc__(o);
20818     --Py_REFCNT(o);
20819     PyErr_Restore(etype, eval, etb);
20820   }
20821   Py_CLEAR(p->obj);
20822   Py_CLEAR(p->_size);
20823   Py_CLEAR(p->_array_interface);
20824   (*Py_TYPE(o)->tp_free)(o);
20825 }
20826 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)20827 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20828   int e;
20829   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20830   if (p->obj) {
20831     e = (*v)(p->obj, a); if (e) return e;
20832   }
20833   if (p->_size) {
20834     e = (*v)(p->_size, a); if (e) return e;
20835   }
20836   if (p->_array_interface) {
20837     e = (*v)(p->_array_interface, a); if (e) return e;
20838   }
20839   if (p->view.obj) {
20840     e = (*v)(p->view.obj, a); if (e) return e;
20841   }
20842   return 0;
20843 }
20844 
__pyx_tp_clear_memoryview(PyObject * o)20845 static int __pyx_tp_clear_memoryview(PyObject *o) {
20846   PyObject* tmp;
20847   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20848   tmp = ((PyObject*)p->obj);
20849   p->obj = Py_None; Py_INCREF(Py_None);
20850   Py_XDECREF(tmp);
20851   tmp = ((PyObject*)p->_size);
20852   p->_size = Py_None; Py_INCREF(Py_None);
20853   Py_XDECREF(tmp);
20854   tmp = ((PyObject*)p->_array_interface);
20855   p->_array_interface = Py_None; Py_INCREF(Py_None);
20856   Py_XDECREF(tmp);
20857   Py_CLEAR(p->view.obj);
20858   return 0;
20859 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)20860 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20861   PyObject *r;
20862   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20863   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20864   Py_DECREF(x);
20865   return r;
20866 }
20867 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)20868 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20869   if (v) {
20870     return __pyx_memoryview___setitem__(o, i, v);
20871   }
20872   else {
20873     PyErr_Format(PyExc_NotImplementedError,
20874       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20875     return -1;
20876   }
20877 }
20878 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)20879 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
20880   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20881 }
20882 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)20883 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
20884   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20885 }
20886 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)20887 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
20888   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20889 }
20890 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)20891 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
20892   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20893 }
20894 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)20895 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
20896   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20897 }
20898 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)20899 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
20900   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20901 }
20902 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)20903 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
20904   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20905 }
20906 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)20907 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
20908   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20909 }
20910 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)20911 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
20912   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20913 }
20914 
20915 static PyMethodDef __pyx_methods_memoryview[] = {
20916   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20917   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20918   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20919   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20920   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20921   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20922   {0, 0, 0, 0}
20923 };
20924 
20925 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20926   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
20927   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
20928   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
20929   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
20930   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
20931   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
20932   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
20933   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
20934   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
20935   {0, 0, 0, 0, 0}
20936 };
20937 
20938 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20939   __pyx_memoryview___len__, /*sq_length*/
20940   0, /*sq_concat*/
20941   0, /*sq_repeat*/
20942   __pyx_sq_item_memoryview, /*sq_item*/
20943   0, /*sq_slice*/
20944   0, /*sq_ass_item*/
20945   0, /*sq_ass_slice*/
20946   0, /*sq_contains*/
20947   0, /*sq_inplace_concat*/
20948   0, /*sq_inplace_repeat*/
20949 };
20950 
20951 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20952   __pyx_memoryview___len__, /*mp_length*/
20953   __pyx_memoryview___getitem__, /*mp_subscript*/
20954   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20955 };
20956 
20957 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20958   #if PY_MAJOR_VERSION < 3
20959   0, /*bf_getreadbuffer*/
20960   #endif
20961   #if PY_MAJOR_VERSION < 3
20962   0, /*bf_getwritebuffer*/
20963   #endif
20964   #if PY_MAJOR_VERSION < 3
20965   0, /*bf_getsegcount*/
20966   #endif
20967   #if PY_MAJOR_VERSION < 3
20968   0, /*bf_getcharbuffer*/
20969   #endif
20970   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20971   0, /*bf_releasebuffer*/
20972 };
20973 
20974 static PyTypeObject __pyx_type___pyx_memoryview = {
20975   PyVarObject_HEAD_INIT(0, 0)
20976   "yt.utilities.lib.lenses.memoryview", /*tp_name*/
20977   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20978   0, /*tp_itemsize*/
20979   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20980   0, /*tp_print*/
20981   0, /*tp_getattr*/
20982   0, /*tp_setattr*/
20983   #if PY_MAJOR_VERSION < 3
20984   0, /*tp_compare*/
20985   #endif
20986   #if PY_MAJOR_VERSION >= 3
20987   0, /*tp_as_async*/
20988   #endif
20989   __pyx_memoryview___repr__, /*tp_repr*/
20990   0, /*tp_as_number*/
20991   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20992   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20993   0, /*tp_hash*/
20994   0, /*tp_call*/
20995   __pyx_memoryview___str__, /*tp_str*/
20996   0, /*tp_getattro*/
20997   0, /*tp_setattro*/
20998   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20999   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21000   0, /*tp_doc*/
21001   __pyx_tp_traverse_memoryview, /*tp_traverse*/
21002   __pyx_tp_clear_memoryview, /*tp_clear*/
21003   0, /*tp_richcompare*/
21004   0, /*tp_weaklistoffset*/
21005   0, /*tp_iter*/
21006   0, /*tp_iternext*/
21007   __pyx_methods_memoryview, /*tp_methods*/
21008   0, /*tp_members*/
21009   __pyx_getsets_memoryview, /*tp_getset*/
21010   0, /*tp_base*/
21011   0, /*tp_dict*/
21012   0, /*tp_descr_get*/
21013   0, /*tp_descr_set*/
21014   0, /*tp_dictoffset*/
21015   0, /*tp_init*/
21016   0, /*tp_alloc*/
21017   __pyx_tp_new_memoryview, /*tp_new*/
21018   0, /*tp_free*/
21019   0, /*tp_is_gc*/
21020   0, /*tp_bases*/
21021   0, /*tp_mro*/
21022   0, /*tp_cache*/
21023   0, /*tp_subclasses*/
21024   0, /*tp_weaklist*/
21025   0, /*tp_del*/
21026   0, /*tp_version_tag*/
21027   #if PY_VERSION_HEX >= 0x030400a1
21028   0, /*tp_finalize*/
21029   #endif
21030   #if PY_VERSION_HEX >= 0x030800b1
21031   0, /*tp_vectorcall*/
21032   #endif
21033 };
21034 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21035 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)21036 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21037   struct __pyx_memoryviewslice_obj *p;
21038   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21039   if (unlikely(!o)) return 0;
21040   p = ((struct __pyx_memoryviewslice_obj *)o);
21041   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21042   p->from_object = Py_None; Py_INCREF(Py_None);
21043   p->from_slice.memview = NULL;
21044   return o;
21045 }
21046 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)21047 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21048   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21049   #if CYTHON_USE_TP_FINALIZE
21050   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21051     if (PyObject_CallFinalizerFromDealloc(o)) return;
21052   }
21053   #endif
21054   PyObject_GC_UnTrack(o);
21055   {
21056     PyObject *etype, *eval, *etb;
21057     PyErr_Fetch(&etype, &eval, &etb);
21058     ++Py_REFCNT(o);
21059     __pyx_memoryviewslice___dealloc__(o);
21060     --Py_REFCNT(o);
21061     PyErr_Restore(etype, eval, etb);
21062   }
21063   Py_CLEAR(p->from_object);
21064   PyObject_GC_Track(o);
21065   __pyx_tp_dealloc_memoryview(o);
21066 }
21067 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)21068 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21069   int e;
21070   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21071   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21072   if (p->from_object) {
21073     e = (*v)(p->from_object, a); if (e) return e;
21074   }
21075   return 0;
21076 }
21077 
__pyx_tp_clear__memoryviewslice(PyObject * o)21078 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21079   PyObject* tmp;
21080   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21081   __pyx_tp_clear_memoryview(o);
21082   tmp = ((PyObject*)p->from_object);
21083   p->from_object = Py_None; Py_INCREF(Py_None);
21084   Py_XDECREF(tmp);
21085   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21086   return 0;
21087 }
21088 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)21089 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21090   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21091 }
21092 
21093 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21094   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21095   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21096   {0, 0, 0, 0}
21097 };
21098 
21099 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21100   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21101   {0, 0, 0, 0, 0}
21102 };
21103 
21104 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21105   PyVarObject_HEAD_INIT(0, 0)
21106   "yt.utilities.lib.lenses._memoryviewslice", /*tp_name*/
21107   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21108   0, /*tp_itemsize*/
21109   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21110   0, /*tp_print*/
21111   0, /*tp_getattr*/
21112   0, /*tp_setattr*/
21113   #if PY_MAJOR_VERSION < 3
21114   0, /*tp_compare*/
21115   #endif
21116   #if PY_MAJOR_VERSION >= 3
21117   0, /*tp_as_async*/
21118   #endif
21119   #if CYTHON_COMPILING_IN_PYPY
21120   __pyx_memoryview___repr__, /*tp_repr*/
21121   #else
21122   0, /*tp_repr*/
21123   #endif
21124   0, /*tp_as_number*/
21125   0, /*tp_as_sequence*/
21126   0, /*tp_as_mapping*/
21127   0, /*tp_hash*/
21128   0, /*tp_call*/
21129   #if CYTHON_COMPILING_IN_PYPY
21130   __pyx_memoryview___str__, /*tp_str*/
21131   #else
21132   0, /*tp_str*/
21133   #endif
21134   0, /*tp_getattro*/
21135   0, /*tp_setattro*/
21136   0, /*tp_as_buffer*/
21137   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21138   "Internal class for passing memoryview slices to Python", /*tp_doc*/
21139   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21140   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21141   0, /*tp_richcompare*/
21142   0, /*tp_weaklistoffset*/
21143   0, /*tp_iter*/
21144   0, /*tp_iternext*/
21145   __pyx_methods__memoryviewslice, /*tp_methods*/
21146   0, /*tp_members*/
21147   __pyx_getsets__memoryviewslice, /*tp_getset*/
21148   0, /*tp_base*/
21149   0, /*tp_dict*/
21150   0, /*tp_descr_get*/
21151   0, /*tp_descr_set*/
21152   0, /*tp_dictoffset*/
21153   0, /*tp_init*/
21154   0, /*tp_alloc*/
21155   __pyx_tp_new__memoryviewslice, /*tp_new*/
21156   0, /*tp_free*/
21157   0, /*tp_is_gc*/
21158   0, /*tp_bases*/
21159   0, /*tp_mro*/
21160   0, /*tp_cache*/
21161   0, /*tp_subclasses*/
21162   0, /*tp_weaklist*/
21163   0, /*tp_del*/
21164   0, /*tp_version_tag*/
21165   #if PY_VERSION_HEX >= 0x030400a1
21166   0, /*tp_finalize*/
21167   #endif
21168   #if PY_VERSION_HEX >= 0x030800b1
21169   0, /*tp_vectorcall*/
21170   #endif
21171 };
21172 
21173 static PyMethodDef __pyx_methods[] = {
21174   {0, 0, 0, 0}
21175 };
21176 
21177 #if PY_MAJOR_VERSION >= 3
21178 #if CYTHON_PEP489_MULTI_PHASE_INIT
21179 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21180 static int __pyx_pymod_exec_lenses(PyObject* module); /*proto*/
21181 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21182   {Py_mod_create, (void*)__pyx_pymod_create},
21183   {Py_mod_exec, (void*)__pyx_pymod_exec_lenses},
21184   {0, NULL}
21185 };
21186 #endif
21187 
21188 static struct PyModuleDef __pyx_moduledef = {
21189     PyModuleDef_HEAD_INIT,
21190     "lenses",
21191     __pyx_k_Functions_for_computing_the_ext, /* m_doc */
21192   #if CYTHON_PEP489_MULTI_PHASE_INIT
21193     0, /* m_size */
21194   #else
21195     -1, /* m_size */
21196   #endif
21197     __pyx_methods /* m_methods */,
21198   #if CYTHON_PEP489_MULTI_PHASE_INIT
21199     __pyx_moduledef_slots, /* m_slots */
21200   #else
21201     NULL, /* m_reload */
21202   #endif
21203     NULL, /* m_traverse */
21204     NULL, /* m_clear */
21205     NULL /* m_free */
21206 };
21207 #endif
21208 #ifndef CYTHON_SMALL_CODE
21209 #if defined(__clang__)
21210     #define CYTHON_SMALL_CODE
21211 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21212     #define CYTHON_SMALL_CODE __attribute__((cold))
21213 #else
21214     #define CYTHON_SMALL_CODE
21215 #endif
21216 #endif
21217 
21218 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21219   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21220   {&__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},
21221   {&__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},
21222   {&__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},
21223   {&__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},
21224   {&__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},
21225   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21226   {&__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},
21227   {&__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},
21228   {&__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},
21229   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
21230   {&__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},
21231   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21232   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21233   {&__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},
21234   {&__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},
21235   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21236   {&__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},
21237   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21238   {&__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},
21239   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
21240   {&__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},
21241   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21242   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
21243   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21244   {&__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},
21245   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21246   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21247   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21248   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
21249   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
21250   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
21251   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
21252   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21253   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
21254   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21255   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21256   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
21257   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
21258   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21259   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
21260   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21261   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
21262   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
21263   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
21264   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21265   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21266   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21267   {&__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},
21268   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
21269   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
21270   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21271   {&__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},
21272   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
21273   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
21274   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
21275   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
21276   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21277   {&__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},
21278   {&__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},
21279   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21280   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
21281   {&__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},
21282   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
21283   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21284   {&__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},
21285   {&__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},
21286   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
21287   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
21288   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21289   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21290   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21291   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21292   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21293   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21294   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21295   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21296   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21297   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
21298   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21299   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21300   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21301   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21302   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21303   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
21304   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
21305   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21306   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
21307   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
21308   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21309   {&__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},
21310   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21311   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21312   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
21313   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21314   {&__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},
21315   {&__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},
21316   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
21317   {&__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},
21318   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21319   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21320   {0, 0, 0, 0, 0, 0, 0}
21321 };
__Pyx_InitCachedBuiltins(void)21322 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21323   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 33, __pyx_L1_error)
21324   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
21325   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
21326   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
21327   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 148, __pyx_L1_error)
21328   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 151, __pyx_L1_error)
21329   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 2, __pyx_L1_error)
21330   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 400, __pyx_L1_error)
21331   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(3, 609, __pyx_L1_error)
21332   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(3, 828, __pyx_L1_error)
21333   return 0;
21334   __pyx_L1_error:;
21335   return -1;
21336 }
21337 
__Pyx_InitCachedConstants(void)21338 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21339   __Pyx_RefNannyDeclarations
21340   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21341 
21342   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
21343  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
21344  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
21345  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
21346  *
21347  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
21348  */
21349   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
21350   __Pyx_GOTREF(__pyx_tuple_);
21351   __Pyx_GIVEREF(__pyx_tuple_);
21352 
21353   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
21354  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
21355  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
21356  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
21357  *
21358  *             info.buf = PyArray_DATA(self)
21359  */
21360   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
21361   __Pyx_GOTREF(__pyx_tuple__2);
21362   __Pyx_GIVEREF(__pyx_tuple__2);
21363 
21364   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
21365  *                 if ((descr.byteorder == c'>' and little_endian) or
21366  *                     (descr.byteorder == c'<' and not little_endian)):
21367  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
21368  *                 if   t == NPY_BYTE:        f = "b"
21369  *                 elif t == NPY_UBYTE:       f = "B"
21370  */
21371   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
21372   __Pyx_GOTREF(__pyx_tuple__3);
21373   __Pyx_GIVEREF(__pyx_tuple__3);
21374 
21375   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
21376  *
21377  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
21378  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
21379  *
21380  *         if ((child.byteorder == c'>' and little_endian) or
21381  */
21382   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 856, __pyx_L1_error)
21383   __Pyx_GOTREF(__pyx_tuple__4);
21384   __Pyx_GIVEREF(__pyx_tuple__4);
21385 
21386   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
21387  *             t = child.type_num
21388  *             if end - f < 5:
21389  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
21390  *
21391  *             # Until ticket #99 is fixed, use integers to avoid warnings
21392  */
21393   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 880, __pyx_L1_error)
21394   __Pyx_GOTREF(__pyx_tuple__5);
21395   __Pyx_GIVEREF(__pyx_tuple__5);
21396 
21397   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
21398  *         _import_array()
21399  *     except Exception:
21400  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
21401  *
21402  * cdef inline int import_umath() except -1:
21403  */
21404   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1038, __pyx_L1_error)
21405   __Pyx_GOTREF(__pyx_tuple__6);
21406   __Pyx_GIVEREF(__pyx_tuple__6);
21407 
21408   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
21409  *         _import_umath()
21410  *     except Exception:
21411  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
21412  *
21413  * cdef inline int import_ufunc() except -1:
21414  */
21415   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1044, __pyx_L1_error)
21416   __Pyx_GOTREF(__pyx_tuple__7);
21417   __Pyx_GIVEREF(__pyx_tuple__7);
21418 
21419   /* "View.MemoryView":133
21420  *
21421  *         if not self.ndim:
21422  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
21423  *
21424  *         if itemsize <= 0:
21425  */
21426   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 133, __pyx_L1_error)
21427   __Pyx_GOTREF(__pyx_tuple__8);
21428   __Pyx_GIVEREF(__pyx_tuple__8);
21429 
21430   /* "View.MemoryView":136
21431  *
21432  *         if itemsize <= 0:
21433  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
21434  *
21435  *         if not isinstance(format, bytes):
21436  */
21437   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 136, __pyx_L1_error)
21438   __Pyx_GOTREF(__pyx_tuple__9);
21439   __Pyx_GIVEREF(__pyx_tuple__9);
21440 
21441   /* "View.MemoryView":148
21442  *
21443  *         if not self._shape:
21444  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
21445  *
21446  *
21447  */
21448   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 148, __pyx_L1_error)
21449   __Pyx_GOTREF(__pyx_tuple__10);
21450   __Pyx_GIVEREF(__pyx_tuple__10);
21451 
21452   /* "View.MemoryView":176
21453  *             self.data = <char *>malloc(self.len)
21454  *             if not self.data:
21455  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
21456  *
21457  *             if self.dtype_is_object:
21458  */
21459   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 176, __pyx_L1_error)
21460   __Pyx_GOTREF(__pyx_tuple__11);
21461   __Pyx_GIVEREF(__pyx_tuple__11);
21462 
21463   /* "View.MemoryView":192
21464  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21465  *         if not (flags & bufmode):
21466  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
21467  *         info.buf = self.data
21468  *         info.len = self.len
21469  */
21470   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 192, __pyx_L1_error)
21471   __Pyx_GOTREF(__pyx_tuple__12);
21472   __Pyx_GIVEREF(__pyx_tuple__12);
21473 
21474   /* "(tree fragment)":2
21475  * def __reduce_cython__(self):
21476  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21477  * def __setstate_cython__(self, __pyx_state):
21478  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21479  */
21480   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 2, __pyx_L1_error)
21481   __Pyx_GOTREF(__pyx_tuple__13);
21482   __Pyx_GIVEREF(__pyx_tuple__13);
21483 
21484   /* "(tree fragment)":4
21485  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21486  * def __setstate_cython__(self, __pyx_state):
21487  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21488  */
21489   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 4, __pyx_L1_error)
21490   __Pyx_GOTREF(__pyx_tuple__14);
21491   __Pyx_GIVEREF(__pyx_tuple__14);
21492 
21493   /* "View.MemoryView":414
21494  *     def __setitem__(memoryview self, object index, object value):
21495  *         if self.view.readonly:
21496  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
21497  *
21498  *         have_slices, index = _unellipsify(index, self.view.ndim)
21499  */
21500   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 414, __pyx_L1_error)
21501   __Pyx_GOTREF(__pyx_tuple__15);
21502   __Pyx_GIVEREF(__pyx_tuple__15);
21503 
21504   /* "View.MemoryView":491
21505  *             result = struct.unpack(self.view.format, bytesitem)
21506  *         except struct.error:
21507  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
21508  *         else:
21509  *             if len(self.view.format) == 1:
21510  */
21511   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 491, __pyx_L1_error)
21512   __Pyx_GOTREF(__pyx_tuple__16);
21513   __Pyx_GIVEREF(__pyx_tuple__16);
21514 
21515   /* "View.MemoryView":516
21516  *     def __getbuffer__(self, Py_buffer *info, int flags):
21517  *         if flags & PyBUF_WRITABLE and self.view.readonly:
21518  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
21519  *
21520  *         if flags & PyBUF_ND:
21521  */
21522   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 516, __pyx_L1_error)
21523   __Pyx_GOTREF(__pyx_tuple__17);
21524   __Pyx_GIVEREF(__pyx_tuple__17);
21525 
21526   /* "View.MemoryView":566
21527  *         if self.view.strides == NULL:
21528  *
21529  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
21530  *
21531  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21532  */
21533   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 566, __pyx_L1_error)
21534   __Pyx_GOTREF(__pyx_tuple__18);
21535   __Pyx_GIVEREF(__pyx_tuple__18);
21536 
21537   /* "View.MemoryView":573
21538  *     def suboffsets(self):
21539  *         if self.view.suboffsets == NULL:
21540  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
21541  *
21542  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21543  */
21544   __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 573, __pyx_L1_error)
21545   __Pyx_GOTREF(__pyx_tuple__19);
21546   __Pyx_INCREF(__pyx_int_neg_1);
21547   __Pyx_GIVEREF(__pyx_int_neg_1);
21548   PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
21549   __Pyx_GIVEREF(__pyx_tuple__19);
21550 
21551   /* "(tree fragment)":2
21552  * def __reduce_cython__(self):
21553  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21554  * def __setstate_cython__(self, __pyx_state):
21555  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21556  */
21557   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 2, __pyx_L1_error)
21558   __Pyx_GOTREF(__pyx_tuple__20);
21559   __Pyx_GIVEREF(__pyx_tuple__20);
21560 
21561   /* "(tree fragment)":4
21562  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21563  * def __setstate_cython__(self, __pyx_state):
21564  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21565  */
21566   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 4, __pyx_L1_error)
21567   __Pyx_GOTREF(__pyx_tuple__21);
21568   __Pyx_GIVEREF(__pyx_tuple__21);
21569 
21570   /* "View.MemoryView":678
21571  *         if item is Ellipsis:
21572  *             if not seen_ellipsis:
21573  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
21574  *                 seen_ellipsis = True
21575  *             else:
21576  */
21577   __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(3, 678, __pyx_L1_error)
21578   __Pyx_GOTREF(__pyx_slice__22);
21579   __Pyx_GIVEREF(__pyx_slice__22);
21580 
21581   /* "View.MemoryView":699
21582  *     for suboffset in suboffsets[:ndim]:
21583  *         if suboffset >= 0:
21584  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
21585  *
21586  *
21587  */
21588   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 699, __pyx_L1_error)
21589   __Pyx_GOTREF(__pyx_tuple__23);
21590   __Pyx_GIVEREF(__pyx_tuple__23);
21591 
21592   /* "(tree fragment)":2
21593  * def __reduce_cython__(self):
21594  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21595  * def __setstate_cython__(self, __pyx_state):
21596  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21597  */
21598   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 2, __pyx_L1_error)
21599   __Pyx_GOTREF(__pyx_tuple__24);
21600   __Pyx_GIVEREF(__pyx_tuple__24);
21601 
21602   /* "(tree fragment)":4
21603  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21604  * def __setstate_cython__(self, __pyx_state):
21605  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21606  */
21607   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 4, __pyx_L1_error)
21608   __Pyx_GOTREF(__pyx_tuple__25);
21609   __Pyx_GIVEREF(__pyx_tuple__25);
21610 
21611   /* "View.MemoryView":286
21612  *         return self.name
21613  *
21614  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
21615  * cdef strided = Enum("<strided and direct>") # default
21616  * cdef indirect = Enum("<strided and indirect>")
21617  */
21618   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 286, __pyx_L1_error)
21619   __Pyx_GOTREF(__pyx_tuple__26);
21620   __Pyx_GIVEREF(__pyx_tuple__26);
21621 
21622   /* "View.MemoryView":287
21623  *
21624  * cdef generic = Enum("<strided and direct or indirect>")
21625  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
21626  * cdef indirect = Enum("<strided and indirect>")
21627  *
21628  */
21629   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 287, __pyx_L1_error)
21630   __Pyx_GOTREF(__pyx_tuple__27);
21631   __Pyx_GIVEREF(__pyx_tuple__27);
21632 
21633   /* "View.MemoryView":288
21634  * cdef generic = Enum("<strided and direct or indirect>")
21635  * cdef strided = Enum("<strided and direct>") # default
21636  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
21637  *
21638  *
21639  */
21640   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 288, __pyx_L1_error)
21641   __Pyx_GOTREF(__pyx_tuple__28);
21642   __Pyx_GIVEREF(__pyx_tuple__28);
21643 
21644   /* "View.MemoryView":291
21645  *
21646  *
21647  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
21648  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21649  *
21650  */
21651   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 291, __pyx_L1_error)
21652   __Pyx_GOTREF(__pyx_tuple__29);
21653   __Pyx_GIVEREF(__pyx_tuple__29);
21654 
21655   /* "View.MemoryView":292
21656  *
21657  * cdef contiguous = Enum("<contiguous and direct>")
21658  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
21659  *
21660  *
21661  */
21662   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(3, 292, __pyx_L1_error)
21663   __Pyx_GOTREF(__pyx_tuple__30);
21664   __Pyx_GIVEREF(__pyx_tuple__30);
21665 
21666   /* "(tree fragment)":1
21667  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
21668  *     cdef object __pyx_PickleError
21669  *     cdef object __pyx_result
21670  */
21671   __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(3, 1, __pyx_L1_error)
21672   __Pyx_GOTREF(__pyx_tuple__31);
21673   __Pyx_GIVEREF(__pyx_tuple__31);
21674   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(3, 1, __pyx_L1_error)
21675   __Pyx_RefNannyFinishContext();
21676   return 0;
21677   __pyx_L1_error:;
21678   __Pyx_RefNannyFinishContext();
21679   return -1;
21680 }
21681 
__Pyx_InitGlobals(void)21682 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21683   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 2, __pyx_L1_error);
21684   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 2, __pyx_L1_error)
21685   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 2, __pyx_L1_error)
21686   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 2, __pyx_L1_error)
21687   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 2, __pyx_L1_error)
21688   return 0;
21689   __pyx_L1_error:;
21690   return -1;
21691 }
21692 
21693 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21694 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21695 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21696 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21697 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21698 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21699 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21700 
__Pyx_modinit_global_init_code(void)21701 static int __Pyx_modinit_global_init_code(void) {
21702   __Pyx_RefNannyDeclarations
21703   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21704   /*--- Global init code ---*/
21705   generic = Py_None; Py_INCREF(Py_None);
21706   strided = Py_None; Py_INCREF(Py_None);
21707   indirect = Py_None; Py_INCREF(Py_None);
21708   contiguous = Py_None; Py_INCREF(Py_None);
21709   indirect_contiguous = Py_None; Py_INCREF(Py_None);
21710   __Pyx_RefNannyFinishContext();
21711   return 0;
21712 }
21713 
__Pyx_modinit_variable_export_code(void)21714 static int __Pyx_modinit_variable_export_code(void) {
21715   __Pyx_RefNannyDeclarations
21716   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21717   /*--- Variable export code ---*/
21718   __Pyx_RefNannyFinishContext();
21719   return 0;
21720 }
21721 
__Pyx_modinit_function_export_code(void)21722 static int __Pyx_modinit_function_export_code(void) {
21723   __Pyx_RefNannyDeclarations
21724   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21725   /*--- Function export code ---*/
21726   if (__Pyx_ExportFunction("generate_vector_info_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_plane_parallel, "void (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 *)") < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21727   if (__Pyx_ExportFunction("generate_vector_info_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_generate_vector_info_null, "void (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 *)") < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21728   if (__Pyx_ExportFunction("calculate_extent_plane_parallel", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_plane_parallel, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21729   if (__Pyx_ExportFunction("calculate_extent_perspective", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_perspective, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21730   if (__Pyx_ExportFunction("calculate_extent_null", (void (*)(void))__pyx_f_2yt_9utilities_3lib_6lenses_calculate_extent_null, "int (struct __pyx_obj_2yt_9utilities_3lib_14image_samplers_ImageSampler *, struct __pyx_t_2yt_9utilities_3lib_16volume_container_VolumeContainer *, __pyx_t_5numpy_int64_t *)") < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21731   __Pyx_RefNannyFinishContext();
21732   return 0;
21733   __pyx_L1_error:;
21734   __Pyx_RefNannyFinishContext();
21735   return -1;
21736 }
21737 
__Pyx_modinit_type_init_code(void)21738 static int __Pyx_modinit_type_init_code(void) {
21739   __Pyx_RefNannyDeclarations
21740   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21741   /*--- Type init code ---*/
21742   __pyx_vtabptr_array = &__pyx_vtable_array;
21743   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
21744   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(3, 105, __pyx_L1_error)
21745   #if PY_VERSION_HEX < 0x030800B1
21746   __pyx_type___pyx_array.tp_print = 0;
21747   #endif
21748   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(3, 105, __pyx_L1_error)
21749   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(3, 105, __pyx_L1_error)
21750   __pyx_array_type = &__pyx_type___pyx_array;
21751   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 279, __pyx_L1_error)
21752   #if PY_VERSION_HEX < 0x030800B1
21753   __pyx_type___pyx_MemviewEnum.tp_print = 0;
21754   #endif
21755   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21756     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21757   }
21758   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(3, 279, __pyx_L1_error)
21759   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21760   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21761   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21762   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21763   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21764   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21765   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21766   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
21767   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21768   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(3, 330, __pyx_L1_error)
21769   #if PY_VERSION_HEX < 0x030800B1
21770   __pyx_type___pyx_memoryview.tp_print = 0;
21771   #endif
21772   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21773     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21774   }
21775   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(3, 330, __pyx_L1_error)
21776   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(3, 330, __pyx_L1_error)
21777   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21778   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21779   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21780   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
21781   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21782   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21783   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 961, __pyx_L1_error)
21784   #if PY_VERSION_HEX < 0x030800B1
21785   __pyx_type___pyx_memoryviewslice.tp_print = 0;
21786   #endif
21787   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21788     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21789   }
21790   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(3, 961, __pyx_L1_error)
21791   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(3, 961, __pyx_L1_error)
21792   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21793   __Pyx_RefNannyFinishContext();
21794   return 0;
21795   __pyx_L1_error:;
21796   __Pyx_RefNannyFinishContext();
21797   return -1;
21798 }
21799 
__Pyx_modinit_type_import_code(void)21800 static int __Pyx_modinit_type_import_code(void) {
21801   __Pyx_RefNannyDeclarations
21802   PyObject *__pyx_t_1 = NULL;
21803   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21804   /*--- Type import code ---*/
21805   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
21806   __Pyx_GOTREF(__pyx_t_1);
21807   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
21808   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21809   sizeof(PyTypeObject),
21810   #else
21811   sizeof(PyHeapTypeObject),
21812   #endif
21813   __Pyx_ImportType_CheckSize_Warn);
21814    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
21815   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21816   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
21817   __Pyx_GOTREF(__pyx_t_1);
21818   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21819    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
21820   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
21821    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
21822   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
21823    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
21824   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21825    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
21826   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
21827    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
21828   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21829   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.partitioned_grid"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 18, __pyx_L1_error)
21830   __Pyx_GOTREF(__pyx_t_1);
21831   __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);
21832    if (!__pyx_ptype_2yt_9utilities_3lib_16partitioned_grid_PartitionedGrid) __PYX_ERR(5, 18, __pyx_L1_error)
21833   __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(5, 18, __pyx_L1_error)
21834   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21835   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.image_samplers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 37, __pyx_L1_error)
21836   __Pyx_GOTREF(__pyx_t_1);
21837   __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);
21838    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ImageSampler) __PYX_ERR(6, 37, __pyx_L1_error)
21839   __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(6, 37, __pyx_L1_error)
21840   __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);
21841    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_ProjectionSampler) __PYX_ERR(6, 71, __pyx_L1_error)
21842   __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(6, 71, __pyx_L1_error)
21843   __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);
21844    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_InterpolatedProjectionSampler) __PYX_ERR(6, 74, __pyx_L1_error)
21845   __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(6, 74, __pyx_L1_error)
21846   __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);
21847    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_VolumeRenderSampler) __PYX_ERR(6, 79, __pyx_L1_error)
21848   __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(6, 79, __pyx_L1_error)
21849   __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);
21850    if (!__pyx_ptype_2yt_9utilities_3lib_14image_samplers_LightSourceRenderSampler) __PYX_ERR(6, 85, __pyx_L1_error)
21851   __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(6, 85, __pyx_L1_error)
21852   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21853   __Pyx_RefNannyFinishContext();
21854   return 0;
21855   __pyx_L1_error:;
21856   __Pyx_XDECREF(__pyx_t_1);
21857   __Pyx_RefNannyFinishContext();
21858   return -1;
21859 }
21860 
__Pyx_modinit_variable_import_code(void)21861 static int __Pyx_modinit_variable_import_code(void) {
21862   __Pyx_RefNannyDeclarations
21863   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21864   /*--- Variable import code ---*/
21865   __Pyx_RefNannyFinishContext();
21866   return 0;
21867 }
21868 
__Pyx_modinit_function_import_code(void)21869 static int __Pyx_modinit_function_import_code(void) {
21870   __Pyx_RefNannyDeclarations
21871   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21872   /*--- Function import code ---*/
21873   __Pyx_RefNannyFinishContext();
21874   return 0;
21875 }
21876 
21877 
21878 #if PY_MAJOR_VERSION < 3
21879 #ifdef CYTHON_NO_PYINIT_EXPORT
21880 #define __Pyx_PyMODINIT_FUNC void
21881 #else
21882 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21883 #endif
21884 #else
21885 #ifdef CYTHON_NO_PYINIT_EXPORT
21886 #define __Pyx_PyMODINIT_FUNC PyObject *
21887 #else
21888 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21889 #endif
21890 #endif
21891 
21892 
21893 #if PY_MAJOR_VERSION < 3
21894 __Pyx_PyMODINIT_FUNC initlenses(void) CYTHON_SMALL_CODE; /*proto*/
initlenses(void)21895 __Pyx_PyMODINIT_FUNC initlenses(void)
21896 #else
21897 __Pyx_PyMODINIT_FUNC PyInit_lenses(void) CYTHON_SMALL_CODE; /*proto*/
21898 __Pyx_PyMODINIT_FUNC PyInit_lenses(void)
21899 #if CYTHON_PEP489_MULTI_PHASE_INIT
21900 {
21901   return PyModuleDef_Init(&__pyx_moduledef);
21902 }
21903 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21904     #if PY_VERSION_HEX >= 0x030700A1
21905     static PY_INT64_T main_interpreter_id = -1;
21906     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21907     if (main_interpreter_id == -1) {
21908         main_interpreter_id = current_id;
21909         return (unlikely(current_id == -1)) ? -1 : 0;
21910     } else if (unlikely(main_interpreter_id != current_id))
21911     #else
21912     static PyInterpreterState *main_interpreter = NULL;
21913     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21914     if (!main_interpreter) {
21915         main_interpreter = current_interpreter;
21916     } else if (unlikely(main_interpreter != current_interpreter))
21917     #endif
21918     {
21919         PyErr_SetString(
21920             PyExc_ImportError,
21921             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21922         return -1;
21923     }
21924     return 0;
21925 }
21926 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) {
21927     PyObject *value = PyObject_GetAttrString(spec, from_name);
21928     int result = 0;
21929     if (likely(value)) {
21930         if (allow_none || value != Py_None) {
21931             result = PyDict_SetItemString(moddict, to_name, value);
21932         }
21933         Py_DECREF(value);
21934     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21935         PyErr_Clear();
21936     } else {
21937         result = -1;
21938     }
21939     return result;
21940 }
21941 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21942     PyObject *module = NULL, *moddict, *modname;
21943     if (__Pyx_check_single_interpreter())
21944         return NULL;
21945     if (__pyx_m)
21946         return __Pyx_NewRef(__pyx_m);
21947     modname = PyObject_GetAttrString(spec, "name");
21948     if (unlikely(!modname)) goto bad;
21949     module = PyModule_NewObject(modname);
21950     Py_DECREF(modname);
21951     if (unlikely(!module)) goto bad;
21952     moddict = PyModule_GetDict(module);
21953     if (unlikely(!moddict)) goto bad;
21954     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21955     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21956     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21957     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21958     return module;
21959 bad:
21960     Py_XDECREF(module);
21961     return NULL;
21962 }
21963 
21964 
21965 static CYTHON_SMALL_CODE int __pyx_pymod_exec_lenses(PyObject *__pyx_pyinit_module)
21966 #endif
21967 #endif
21968 {
21969   PyObject *__pyx_t_1 = NULL;
21970   static PyThread_type_lock __pyx_t_2[8];
21971   __Pyx_RefNannyDeclarations
21972   #if CYTHON_PEP489_MULTI_PHASE_INIT
21973   if (__pyx_m) {
21974     if (__pyx_m == __pyx_pyinit_module) return 0;
21975     PyErr_SetString(PyExc_RuntimeError, "Module 'lenses' has already been imported. Re-initialisation is not supported.");
21976     return -1;
21977   }
21978   #elif PY_MAJOR_VERSION >= 3
21979   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21980   #endif
21981   #if CYTHON_REFNANNY
21982 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21983 if (!__Pyx_RefNanny) {
21984   PyErr_Clear();
21985   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21986   if (!__Pyx_RefNanny)
21987       Py_FatalError("failed to import 'refnanny' module");
21988 }
21989 #endif
21990   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_lenses(void)", 0);
21991   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
21992   #ifdef __Pxy_PyFrame_Initialize_Offsets
21993   __Pxy_PyFrame_Initialize_Offsets();
21994   #endif
21995   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 2, __pyx_L1_error)
21996   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 2, __pyx_L1_error)
21997   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 2, __pyx_L1_error)
21998   #ifdef __Pyx_CyFunction_USED
21999   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22000   #endif
22001   #ifdef __Pyx_FusedFunction_USED
22002   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22003   #endif
22004   #ifdef __Pyx_Coroutine_USED
22005   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22006   #endif
22007   #ifdef __Pyx_Generator_USED
22008   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22009   #endif
22010   #ifdef __Pyx_AsyncGen_USED
22011   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22012   #endif
22013   #ifdef __Pyx_StopAsyncIteration_USED
22014   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22015   #endif
22016   /*--- Library function declarations ---*/
22017   /*--- Threads initialization code ---*/
22018   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22019   #ifdef WITH_THREAD /* Python build with threading support? */
22020   PyEval_InitThreads();
22021   #endif
22022   #endif
22023   /*--- Module creation code ---*/
22024   #if CYTHON_PEP489_MULTI_PHASE_INIT
22025   __pyx_m = __pyx_pyinit_module;
22026   Py_INCREF(__pyx_m);
22027   #else
22028   #if PY_MAJOR_VERSION < 3
22029   __pyx_m = Py_InitModule4("lenses", __pyx_methods, __pyx_k_Functions_for_computing_the_ext, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22030   #else
22031   __pyx_m = PyModule_Create(&__pyx_moduledef);
22032   #endif
22033   if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error)
22034   #endif
22035   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 2, __pyx_L1_error)
22036   Py_INCREF(__pyx_d);
22037   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 2, __pyx_L1_error)
22038   Py_INCREF(__pyx_b);
22039   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 2, __pyx_L1_error)
22040   Py_INCREF(__pyx_cython_runtime);
22041   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 2, __pyx_L1_error);
22042   /*--- Initialize various global constants etc. ---*/
22043   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22044   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22045   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22046   #endif
22047   if (__pyx_module_is_main_yt__utilities__lib__lenses) {
22048     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22049   }
22050   #if PY_MAJOR_VERSION >= 3
22051   {
22052     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 2, __pyx_L1_error)
22053     if (!PyDict_GetItemString(modules, "yt.utilities.lib.lenses")) {
22054       if (unlikely(PyDict_SetItemString(modules, "yt.utilities.lib.lenses", __pyx_m) < 0)) __PYX_ERR(0, 2, __pyx_L1_error)
22055     }
22056   }
22057   #endif
22058   /*--- Builtin init code ---*/
22059   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
22060   /*--- Constants init code ---*/
22061   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
22062   /*--- Global type/function init code ---*/
22063   (void)__Pyx_modinit_global_init_code();
22064   (void)__Pyx_modinit_variable_export_code();
22065   if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
22066   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
22067   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
22068   (void)__Pyx_modinit_variable_import_code();
22069   (void)__Pyx_modinit_function_import_code();
22070   /*--- Execution code ---*/
22071   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22072   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22073   #endif
22074 
22075   /* "yt/utilities/lib/lenses.pyx":11
22076  *
22077  *
22078  * import numpy as np             # <<<<<<<<<<<<<<
22079  *
22080  * cimport cython
22081  */
22082   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
22083   __Pyx_GOTREF(__pyx_t_1);
22084   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22085   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22086 
22087   /* "yt/utilities/lib/lenses.pyx":2
22088  *
22089  * # distutils: libraries = STD_LIBS             # <<<<<<<<<<<<<<
22090  * """
22091  * Functions for computing the extent of lenses and whatnot
22092  */
22093   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
22094   __Pyx_GOTREF(__pyx_t_1);
22095   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
22096   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22097 
22098   /* "View.MemoryView":209
22099  *         info.obj = self
22100  *
22101  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
22102  *
22103  *     def __dealloc__(array self):
22104  */
22105   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 209, __pyx_L1_error)
22106   __Pyx_GOTREF(__pyx_t_1);
22107   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
22108   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22109   PyType_Modified(__pyx_array_type);
22110 
22111   /* "View.MemoryView":286
22112  *         return self.name
22113  *
22114  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
22115  * cdef strided = Enum("<strided and direct>") # default
22116  * cdef indirect = Enum("<strided and indirect>")
22117  */
22118   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 286, __pyx_L1_error)
22119   __Pyx_GOTREF(__pyx_t_1);
22120   __Pyx_XGOTREF(generic);
22121   __Pyx_DECREF_SET(generic, __pyx_t_1);
22122   __Pyx_GIVEREF(__pyx_t_1);
22123   __pyx_t_1 = 0;
22124 
22125   /* "View.MemoryView":287
22126  *
22127  * cdef generic = Enum("<strided and direct or indirect>")
22128  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
22129  * cdef indirect = Enum("<strided and indirect>")
22130  *
22131  */
22132   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 287, __pyx_L1_error)
22133   __Pyx_GOTREF(__pyx_t_1);
22134   __Pyx_XGOTREF(strided);
22135   __Pyx_DECREF_SET(strided, __pyx_t_1);
22136   __Pyx_GIVEREF(__pyx_t_1);
22137   __pyx_t_1 = 0;
22138 
22139   /* "View.MemoryView":288
22140  * cdef generic = Enum("<strided and direct or indirect>")
22141  * cdef strided = Enum("<strided and direct>") # default
22142  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
22143  *
22144  *
22145  */
22146   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
22147   __Pyx_GOTREF(__pyx_t_1);
22148   __Pyx_XGOTREF(indirect);
22149   __Pyx_DECREF_SET(indirect, __pyx_t_1);
22150   __Pyx_GIVEREF(__pyx_t_1);
22151   __pyx_t_1 = 0;
22152 
22153   /* "View.MemoryView":291
22154  *
22155  *
22156  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
22157  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22158  *
22159  */
22160   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 291, __pyx_L1_error)
22161   __Pyx_GOTREF(__pyx_t_1);
22162   __Pyx_XGOTREF(contiguous);
22163   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22164   __Pyx_GIVEREF(__pyx_t_1);
22165   __pyx_t_1 = 0;
22166 
22167   /* "View.MemoryView":292
22168  *
22169  * cdef contiguous = Enum("<contiguous and direct>")
22170  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
22171  *
22172  *
22173  */
22174   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 292, __pyx_L1_error)
22175   __Pyx_GOTREF(__pyx_t_1);
22176   __Pyx_XGOTREF(indirect_contiguous);
22177   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22178   __Pyx_GIVEREF(__pyx_t_1);
22179   __pyx_t_1 = 0;
22180 
22181   /* "View.MemoryView":316
22182  *
22183  * DEF THREAD_LOCKS_PREALLOCATED = 8
22184  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
22185  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
22186  *     PyThread_allocate_lock(),
22187  */
22188   __pyx_memoryview_thread_locks_used = 0;
22189 
22190   /* "View.MemoryView":317
22191  * DEF THREAD_LOCKS_PREALLOCATED = 8
22192  * cdef int __pyx_memoryview_thread_locks_used = 0
22193  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
22194  *     PyThread_allocate_lock(),
22195  *     PyThread_allocate_lock(),
22196  */
22197   __pyx_t_2[0] = PyThread_allocate_lock();
22198   __pyx_t_2[1] = PyThread_allocate_lock();
22199   __pyx_t_2[2] = PyThread_allocate_lock();
22200   __pyx_t_2[3] = PyThread_allocate_lock();
22201   __pyx_t_2[4] = PyThread_allocate_lock();
22202   __pyx_t_2[5] = PyThread_allocate_lock();
22203   __pyx_t_2[6] = PyThread_allocate_lock();
22204   __pyx_t_2[7] = PyThread_allocate_lock();
22205   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22206 
22207   /* "View.MemoryView":545
22208  *         info.obj = self
22209  *
22210  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
22211  *
22212  *
22213  */
22214   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 545, __pyx_L1_error)
22215   __Pyx_GOTREF(__pyx_t_1);
22216   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 545, __pyx_L1_error)
22217   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22218   PyType_Modified(__pyx_memoryview_type);
22219 
22220   /* "View.MemoryView":991
22221  *         return self.from_object
22222  *
22223  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
22224  *
22225  *
22226  */
22227   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 991, __pyx_L1_error)
22228   __Pyx_GOTREF(__pyx_t_1);
22229   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(3, 991, __pyx_L1_error)
22230   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22231   PyType_Modified(__pyx_memoryviewslice_type);
22232 
22233   /* "(tree fragment)":1
22234  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
22235  *     cdef object __pyx_PickleError
22236  *     cdef object __pyx_result
22237  */
22238   __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(3, 1, __pyx_L1_error)
22239   __Pyx_GOTREF(__pyx_t_1);
22240   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
22241   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22242 
22243   /* "(tree fragment)":11
22244  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22245  *     return __pyx_result
22246  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
22247  *     __pyx_result.name = __pyx_state[0]
22248  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22249  */
22250 
22251   /*--- Wrapped vars code ---*/
22252 
22253   goto __pyx_L0;
22254   __pyx_L1_error:;
22255   __Pyx_XDECREF(__pyx_t_1);
22256   if (__pyx_m) {
22257     if (__pyx_d) {
22258       __Pyx_AddTraceback("init yt.utilities.lib.lenses", __pyx_clineno, __pyx_lineno, __pyx_filename);
22259     }
22260     Py_CLEAR(__pyx_m);
22261   } else if (!PyErr_Occurred()) {
22262     PyErr_SetString(PyExc_ImportError, "init yt.utilities.lib.lenses");
22263   }
22264   __pyx_L0:;
22265   __Pyx_RefNannyFinishContext();
22266   #if CYTHON_PEP489_MULTI_PHASE_INIT
22267   return (__pyx_m != NULL) ? 0 : -1;
22268   #elif PY_MAJOR_VERSION >= 3
22269   return __pyx_m;
22270   #else
22271   return;
22272   #endif
22273 }
22274 
22275 /* --- Runtime support code --- */
22276 /* Refnanny */
22277 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)22278 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
22279     PyObject *m = NULL, *p = NULL;
22280     void *r = NULL;
22281     m = PyImport_ImportModule(modname);
22282     if (!m) goto end;
22283     p = PyObject_GetAttrString(m, "RefNannyAPI");
22284     if (!p) goto end;
22285     r = PyLong_AsVoidPtr(p);
22286 end:
22287     Py_XDECREF(p);
22288     Py_XDECREF(m);
22289     return (__Pyx_RefNannyAPIStruct *)r;
22290 }
22291 #endif
22292 
22293 /* PyObjectGetAttrStr */
22294 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)22295 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
22296     PyTypeObject* tp = Py_TYPE(obj);
22297     if (likely(tp->tp_getattro))
22298         return tp->tp_getattro(obj, attr_name);
22299 #if PY_MAJOR_VERSION < 3
22300     if (likely(tp->tp_getattr))
22301         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
22302 #endif
22303     return PyObject_GetAttr(obj, attr_name);
22304 }
22305 #endif
22306 
22307 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)22308 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
22309     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
22310     if (unlikely(!result)) {
22311         PyErr_Format(PyExc_NameError,
22312 #if PY_MAJOR_VERSION >= 3
22313             "name '%U' is not defined", name);
22314 #else
22315             "name '%.200s' is not defined", PyString_AS_STRING(name));
22316 #endif
22317     }
22318     return result;
22319 }
22320 
22321 /* PyErrFetchRestore */
22322 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)22323 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22324     PyObject *tmp_type, *tmp_value, *tmp_tb;
22325     tmp_type = tstate->curexc_type;
22326     tmp_value = tstate->curexc_value;
22327     tmp_tb = tstate->curexc_traceback;
22328     tstate->curexc_type = type;
22329     tstate->curexc_value = value;
22330     tstate->curexc_traceback = tb;
22331     Py_XDECREF(tmp_type);
22332     Py_XDECREF(tmp_value);
22333     Py_XDECREF(tmp_tb);
22334 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)22335 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22336     *type = tstate->curexc_type;
22337     *value = tstate->curexc_value;
22338     *tb = tstate->curexc_traceback;
22339     tstate->curexc_type = 0;
22340     tstate->curexc_value = 0;
22341     tstate->curexc_traceback = 0;
22342 }
22343 #endif
22344 
22345 /* 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)22346 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
22347                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
22348                                   int full_traceback, CYTHON_UNUSED int nogil) {
22349     PyObject *old_exc, *old_val, *old_tb;
22350     PyObject *ctx;
22351     __Pyx_PyThreadState_declare
22352 #ifdef WITH_THREAD
22353     PyGILState_STATE state;
22354     if (nogil)
22355         state = PyGILState_Ensure();
22356 #ifdef _MSC_VER
22357     else state = (PyGILState_STATE)-1;
22358 #endif
22359 #endif
22360     __Pyx_PyThreadState_assign
22361     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
22362     if (full_traceback) {
22363         Py_XINCREF(old_exc);
22364         Py_XINCREF(old_val);
22365         Py_XINCREF(old_tb);
22366         __Pyx_ErrRestore(old_exc, old_val, old_tb);
22367         PyErr_PrintEx(1);
22368     }
22369     #if PY_MAJOR_VERSION < 3
22370     ctx = PyString_FromString(name);
22371     #else
22372     ctx = PyUnicode_FromString(name);
22373     #endif
22374     __Pyx_ErrRestore(old_exc, old_val, old_tb);
22375     if (!ctx) {
22376         PyErr_WriteUnraisable(Py_None);
22377     } else {
22378         PyErr_WriteUnraisable(ctx);
22379         Py_DECREF(ctx);
22380     }
22381 #ifdef WITH_THREAD
22382     if (nogil)
22383         PyGILState_Release(state);
22384 #endif
22385 }
22386 
22387 /* PyObjectCall */
22388 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)22389 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22390     PyObject *result;
22391     ternaryfunc call = func->ob_type->tp_call;
22392     if (unlikely(!call))
22393         return PyObject_Call(func, arg, kw);
22394     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22395         return NULL;
22396     result = (*call)(func, arg, kw);
22397     Py_LeaveRecursiveCall();
22398     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22399         PyErr_SetString(
22400             PyExc_SystemError,
22401             "NULL result without error in PyObject_Call");
22402     }
22403     return result;
22404 }
22405 #endif
22406 
22407 /* RaiseException */
22408 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)22409 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22410                         CYTHON_UNUSED PyObject *cause) {
22411     __Pyx_PyThreadState_declare
22412     Py_XINCREF(type);
22413     if (!value || value == Py_None)
22414         value = NULL;
22415     else
22416         Py_INCREF(value);
22417     if (!tb || tb == Py_None)
22418         tb = NULL;
22419     else {
22420         Py_INCREF(tb);
22421         if (!PyTraceBack_Check(tb)) {
22422             PyErr_SetString(PyExc_TypeError,
22423                 "raise: arg 3 must be a traceback or None");
22424             goto raise_error;
22425         }
22426     }
22427     if (PyType_Check(type)) {
22428 #if CYTHON_COMPILING_IN_PYPY
22429         if (!value) {
22430             Py_INCREF(Py_None);
22431             value = Py_None;
22432         }
22433 #endif
22434         PyErr_NormalizeException(&type, &value, &tb);
22435     } else {
22436         if (value) {
22437             PyErr_SetString(PyExc_TypeError,
22438                 "instance exception may not have a separate value");
22439             goto raise_error;
22440         }
22441         value = type;
22442         type = (PyObject*) Py_TYPE(type);
22443         Py_INCREF(type);
22444         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22445             PyErr_SetString(PyExc_TypeError,
22446                 "raise: exception class must be a subclass of BaseException");
22447             goto raise_error;
22448         }
22449     }
22450     __Pyx_PyThreadState_assign
22451     __Pyx_ErrRestore(type, value, tb);
22452     return;
22453 raise_error:
22454     Py_XDECREF(value);
22455     Py_XDECREF(type);
22456     Py_XDECREF(tb);
22457     return;
22458 }
22459 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)22460 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22461     PyObject* owned_instance = NULL;
22462     if (tb == Py_None) {
22463         tb = 0;
22464     } else if (tb && !PyTraceBack_Check(tb)) {
22465         PyErr_SetString(PyExc_TypeError,
22466             "raise: arg 3 must be a traceback or None");
22467         goto bad;
22468     }
22469     if (value == Py_None)
22470         value = 0;
22471     if (PyExceptionInstance_Check(type)) {
22472         if (value) {
22473             PyErr_SetString(PyExc_TypeError,
22474                 "instance exception may not have a separate value");
22475             goto bad;
22476         }
22477         value = type;
22478         type = (PyObject*) Py_TYPE(value);
22479     } else if (PyExceptionClass_Check(type)) {
22480         PyObject *instance_class = NULL;
22481         if (value && PyExceptionInstance_Check(value)) {
22482             instance_class = (PyObject*) Py_TYPE(value);
22483             if (instance_class != type) {
22484                 int is_subclass = PyObject_IsSubclass(instance_class, type);
22485                 if (!is_subclass) {
22486                     instance_class = NULL;
22487                 } else if (unlikely(is_subclass == -1)) {
22488                     goto bad;
22489                 } else {
22490                     type = instance_class;
22491                 }
22492             }
22493         }
22494         if (!instance_class) {
22495             PyObject *args;
22496             if (!value)
22497                 args = PyTuple_New(0);
22498             else if (PyTuple_Check(value)) {
22499                 Py_INCREF(value);
22500                 args = value;
22501             } else
22502                 args = PyTuple_Pack(1, value);
22503             if (!args)
22504                 goto bad;
22505             owned_instance = PyObject_Call(type, args, NULL);
22506             Py_DECREF(args);
22507             if (!owned_instance)
22508                 goto bad;
22509             value = owned_instance;
22510             if (!PyExceptionInstance_Check(value)) {
22511                 PyErr_Format(PyExc_TypeError,
22512                              "calling %R should have returned an instance of "
22513                              "BaseException, not %R",
22514                              type, Py_TYPE(value));
22515                 goto bad;
22516             }
22517         }
22518     } else {
22519         PyErr_SetString(PyExc_TypeError,
22520             "raise: exception class must be a subclass of BaseException");
22521         goto bad;
22522     }
22523     if (cause) {
22524         PyObject *fixed_cause;
22525         if (cause == Py_None) {
22526             fixed_cause = NULL;
22527         } else if (PyExceptionClass_Check(cause)) {
22528             fixed_cause = PyObject_CallObject(cause, NULL);
22529             if (fixed_cause == NULL)
22530                 goto bad;
22531         } else if (PyExceptionInstance_Check(cause)) {
22532             fixed_cause = cause;
22533             Py_INCREF(fixed_cause);
22534         } else {
22535             PyErr_SetString(PyExc_TypeError,
22536                             "exception causes must derive from "
22537                             "BaseException");
22538             goto bad;
22539         }
22540         PyException_SetCause(value, fixed_cause);
22541     }
22542     PyErr_SetObject(type, value);
22543     if (tb) {
22544 #if CYTHON_COMPILING_IN_PYPY
22545         PyObject *tmp_type, *tmp_value, *tmp_tb;
22546         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22547         Py_INCREF(tb);
22548         PyErr_Restore(tmp_type, tmp_value, tb);
22549         Py_XDECREF(tmp_tb);
22550 #else
22551         PyThreadState *tstate = __Pyx_PyThreadState_Current;
22552         PyObject* tmp_tb = tstate->curexc_traceback;
22553         if (tb != tmp_tb) {
22554             Py_INCREF(tb);
22555             tstate->curexc_traceback = tb;
22556             Py_XDECREF(tmp_tb);
22557         }
22558 #endif
22559     }
22560 bad:
22561     Py_XDECREF(owned_instance);
22562     return;
22563 }
22564 #endif
22565 
22566 /* PyCFunctionFastCall */
22567 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)22568 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22569     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22570     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22571     PyObject *self = PyCFunction_GET_SELF(func);
22572     int flags = PyCFunction_GET_FLAGS(func);
22573     assert(PyCFunction_Check(func));
22574     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22575     assert(nargs >= 0);
22576     assert(nargs == 0 || args != NULL);
22577     /* _PyCFunction_FastCallDict() must not be called with an exception set,
22578        because it may clear it (directly or indirectly) and so the
22579        caller loses its exception */
22580     assert(!PyErr_Occurred());
22581     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22582         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
22583     } else {
22584         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
22585     }
22586 }
22587 #endif
22588 
22589 /* PyFunctionFastCall */
22590 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)22591 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22592                                                PyObject *globals) {
22593     PyFrameObject *f;
22594     PyThreadState *tstate = __Pyx_PyThreadState_Current;
22595     PyObject **fastlocals;
22596     Py_ssize_t i;
22597     PyObject *result;
22598     assert(globals != NULL);
22599     /* XXX Perhaps we should create a specialized
22600        PyFrame_New() that doesn't take locals, but does
22601        take builtins without sanity checking them.
22602        */
22603     assert(tstate != NULL);
22604     f = PyFrame_New(tstate, co, globals, NULL);
22605     if (f == NULL) {
22606         return NULL;
22607     }
22608     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22609     for (i = 0; i < na; i++) {
22610         Py_INCREF(*args);
22611         fastlocals[i] = *args++;
22612     }
22613     result = PyEval_EvalFrameEx(f,0);
22614     ++tstate->recursion_depth;
22615     Py_DECREF(f);
22616     --tstate->recursion_depth;
22617     return result;
22618 }
22619 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)22620 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22621     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22622     PyObject *globals = PyFunction_GET_GLOBALS(func);
22623     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22624     PyObject *closure;
22625 #if PY_MAJOR_VERSION >= 3
22626     PyObject *kwdefs;
22627 #endif
22628     PyObject *kwtuple, **k;
22629     PyObject **d;
22630     Py_ssize_t nd;
22631     Py_ssize_t nk;
22632     PyObject *result;
22633     assert(kwargs == NULL || PyDict_Check(kwargs));
22634     nk = kwargs ? PyDict_Size(kwargs) : 0;
22635     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
22636         return NULL;
22637     }
22638     if (
22639 #if PY_MAJOR_VERSION >= 3
22640             co->co_kwonlyargcount == 0 &&
22641 #endif
22642             likely(kwargs == NULL || nk == 0) &&
22643             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22644         if (argdefs == NULL && co->co_argcount == nargs) {
22645             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22646             goto done;
22647         }
22648         else if (nargs == 0 && argdefs != NULL
22649                  && co->co_argcount == Py_SIZE(argdefs)) {
22650             /* function called with no arguments, but all parameters have
22651                a default value: use default values as arguments .*/
22652             args = &PyTuple_GET_ITEM(argdefs, 0);
22653             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22654             goto done;
22655         }
22656     }
22657     if (kwargs != NULL) {
22658         Py_ssize_t pos, i;
22659         kwtuple = PyTuple_New(2 * nk);
22660         if (kwtuple == NULL) {
22661             result = NULL;
22662             goto done;
22663         }
22664         k = &PyTuple_GET_ITEM(kwtuple, 0);
22665         pos = i = 0;
22666         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
22667             Py_INCREF(k[i]);
22668             Py_INCREF(k[i+1]);
22669             i += 2;
22670         }
22671         nk = i / 2;
22672     }
22673     else {
22674         kwtuple = NULL;
22675         k = NULL;
22676     }
22677     closure = PyFunction_GET_CLOSURE(func);
22678 #if PY_MAJOR_VERSION >= 3
22679     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22680 #endif
22681     if (argdefs != NULL) {
22682         d = &PyTuple_GET_ITEM(argdefs, 0);
22683         nd = Py_SIZE(argdefs);
22684     }
22685     else {
22686         d = NULL;
22687         nd = 0;
22688     }
22689 #if PY_MAJOR_VERSION >= 3
22690     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22691                                args, (int)nargs,
22692                                k, (int)nk,
22693                                d, (int)nd, kwdefs, closure);
22694 #else
22695     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22696                                args, (int)nargs,
22697                                k, (int)nk,
22698                                d, (int)nd, closure);
22699 #endif
22700     Py_XDECREF(kwtuple);
22701 done:
22702     Py_LeaveRecursiveCall();
22703     return result;
22704 }
22705 #endif
22706 #endif
22707 
22708 /* PyObjectCallMethO */
22709 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)22710 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22711     PyObject *self, *result;
22712     PyCFunction cfunc;
22713     cfunc = PyCFunction_GET_FUNCTION(func);
22714     self = PyCFunction_GET_SELF(func);
22715     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22716         return NULL;
22717     result = cfunc(self, arg);
22718     Py_LeaveRecursiveCall();
22719     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22720         PyErr_SetString(
22721             PyExc_SystemError,
22722             "NULL result without error in PyObject_Call");
22723     }
22724     return result;
22725 }
22726 #endif
22727 
22728 /* PyObjectCallOneArg */
22729 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)22730 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22731     PyObject *result;
22732     PyObject *args = PyTuple_New(1);
22733     if (unlikely(!args)) return NULL;
22734     Py_INCREF(arg);
22735     PyTuple_SET_ITEM(args, 0, arg);
22736     result = __Pyx_PyObject_Call(func, args, NULL);
22737     Py_DECREF(args);
22738     return result;
22739 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)22740 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22741 #if CYTHON_FAST_PYCALL
22742     if (PyFunction_Check(func)) {
22743         return __Pyx_PyFunction_FastCall(func, &arg, 1);
22744     }
22745 #endif
22746     if (likely(PyCFunction_Check(func))) {
22747         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22748             return __Pyx_PyObject_CallMethO(func, arg);
22749 #if CYTHON_FAST_PYCCALL
22750         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
22751             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22752 #endif
22753         }
22754     }
22755     return __Pyx__PyObject_CallOneArg(func, arg);
22756 }
22757 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)22758 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22759     PyObject *result;
22760     PyObject *args = PyTuple_Pack(1, arg);
22761     if (unlikely(!args)) return NULL;
22762     result = __Pyx_PyObject_Call(func, args, NULL);
22763     Py_DECREF(args);
22764     return result;
22765 }
22766 #endif
22767 
22768 /* DictGetItem */
22769 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)22770 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
22771     PyObject *value;
22772     value = PyDict_GetItemWithError(d, key);
22773     if (unlikely(!value)) {
22774         if (!PyErr_Occurred()) {
22775             if (unlikely(PyTuple_Check(key))) {
22776                 PyObject* args = PyTuple_Pack(1, key);
22777                 if (likely(args)) {
22778                     PyErr_SetObject(PyExc_KeyError, args);
22779                     Py_DECREF(args);
22780                 }
22781             } else {
22782                 PyErr_SetObject(PyExc_KeyError, key);
22783             }
22784         }
22785         return NULL;
22786     }
22787     Py_INCREF(value);
22788     return value;
22789 }
22790 #endif
22791 
22792 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)22793 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
22794     PyErr_Format(PyExc_ValueError,
22795                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
22796 }
22797 
22798 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)22799 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
22800     PyErr_Format(PyExc_ValueError,
22801                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
22802                  index, (index == 1) ? "" : "s");
22803 }
22804 
22805 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)22806 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
22807     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
22808 }
22809 
22810 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)22811 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22812     if (unlikely(!type)) {
22813         PyErr_SetString(PyExc_SystemError, "Missing type object");
22814         return 0;
22815     }
22816     if (likely(__Pyx_TypeCheck(obj, type)))
22817         return 1;
22818     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
22819                  Py_TYPE(obj)->tp_name, type->tp_name);
22820     return 0;
22821 }
22822 
22823 /* GetTopmostException */
22824 #if CYTHON_USE_EXC_INFO_STACK
22825 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)22826 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
22827 {
22828     _PyErr_StackItem *exc_info = tstate->exc_info;
22829     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
22830            exc_info->previous_item != NULL)
22831     {
22832         exc_info = exc_info->previous_item;
22833     }
22834     return exc_info;
22835 }
22836 #endif
22837 
22838 /* SaveResetException */
22839 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)22840 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22841     #if CYTHON_USE_EXC_INFO_STACK
22842     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
22843     *type = exc_info->exc_type;
22844     *value = exc_info->exc_value;
22845     *tb = exc_info->exc_traceback;
22846     #else
22847     *type = tstate->exc_type;
22848     *value = tstate->exc_value;
22849     *tb = tstate->exc_traceback;
22850     #endif
22851     Py_XINCREF(*type);
22852     Py_XINCREF(*value);
22853     Py_XINCREF(*tb);
22854 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)22855 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22856     PyObject *tmp_type, *tmp_value, *tmp_tb;
22857     #if CYTHON_USE_EXC_INFO_STACK
22858     _PyErr_StackItem *exc_info = tstate->exc_info;
22859     tmp_type = exc_info->exc_type;
22860     tmp_value = exc_info->exc_value;
22861     tmp_tb = exc_info->exc_traceback;
22862     exc_info->exc_type = type;
22863     exc_info->exc_value = value;
22864     exc_info->exc_traceback = tb;
22865     #else
22866     tmp_type = tstate->exc_type;
22867     tmp_value = tstate->exc_value;
22868     tmp_tb = tstate->exc_traceback;
22869     tstate->exc_type = type;
22870     tstate->exc_value = value;
22871     tstate->exc_traceback = tb;
22872     #endif
22873     Py_XDECREF(tmp_type);
22874     Py_XDECREF(tmp_value);
22875     Py_XDECREF(tmp_tb);
22876 }
22877 #endif
22878 
22879 /* PyErrExceptionMatches */
22880 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)22881 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22882     Py_ssize_t i, n;
22883     n = PyTuple_GET_SIZE(tuple);
22884 #if PY_MAJOR_VERSION >= 3
22885     for (i=0; i<n; i++) {
22886         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22887     }
22888 #endif
22889     for (i=0; i<n; i++) {
22890         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
22891     }
22892     return 0;
22893 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)22894 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22895     PyObject *exc_type = tstate->curexc_type;
22896     if (exc_type == err) return 1;
22897     if (unlikely(!exc_type)) return 0;
22898     if (unlikely(PyTuple_Check(err)))
22899         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22900     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22901 }
22902 #endif
22903 
22904 /* GetException */
22905 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)22906 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
22907 #else
22908 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
22909 #endif
22910 {
22911     PyObject *local_type, *local_value, *local_tb;
22912 #if CYTHON_FAST_THREAD_STATE
22913     PyObject *tmp_type, *tmp_value, *tmp_tb;
22914     local_type = tstate->curexc_type;
22915     local_value = tstate->curexc_value;
22916     local_tb = tstate->curexc_traceback;
22917     tstate->curexc_type = 0;
22918     tstate->curexc_value = 0;
22919     tstate->curexc_traceback = 0;
22920 #else
22921     PyErr_Fetch(&local_type, &local_value, &local_tb);
22922 #endif
22923     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
22924 #if CYTHON_FAST_THREAD_STATE
22925     if (unlikely(tstate->curexc_type))
22926 #else
22927     if (unlikely(PyErr_Occurred()))
22928 #endif
22929         goto bad;
22930     #if PY_MAJOR_VERSION >= 3
22931     if (local_tb) {
22932         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
22933             goto bad;
22934     }
22935     #endif
22936     Py_XINCREF(local_tb);
22937     Py_XINCREF(local_type);
22938     Py_XINCREF(local_value);
22939     *type = local_type;
22940     *value = local_value;
22941     *tb = local_tb;
22942 #if CYTHON_FAST_THREAD_STATE
22943     #if CYTHON_USE_EXC_INFO_STACK
22944     {
22945         _PyErr_StackItem *exc_info = tstate->exc_info;
22946         tmp_type = exc_info->exc_type;
22947         tmp_value = exc_info->exc_value;
22948         tmp_tb = exc_info->exc_traceback;
22949         exc_info->exc_type = local_type;
22950         exc_info->exc_value = local_value;
22951         exc_info->exc_traceback = local_tb;
22952     }
22953     #else
22954     tmp_type = tstate->exc_type;
22955     tmp_value = tstate->exc_value;
22956     tmp_tb = tstate->exc_traceback;
22957     tstate->exc_type = local_type;
22958     tstate->exc_value = local_value;
22959     tstate->exc_traceback = local_tb;
22960     #endif
22961     Py_XDECREF(tmp_type);
22962     Py_XDECREF(tmp_value);
22963     Py_XDECREF(tmp_tb);
22964 #else
22965     PyErr_SetExcInfo(local_type, local_value, local_tb);
22966 #endif
22967     return 0;
22968 bad:
22969     *type = 0;
22970     *value = 0;
22971     *tb = 0;
22972     Py_XDECREF(local_type);
22973     Py_XDECREF(local_value);
22974     Py_XDECREF(local_tb);
22975     return -1;
22976 }
22977 
22978 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)22979 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
22980 #if CYTHON_USE_TYPE_SLOTS
22981 #if PY_MAJOR_VERSION >= 3
22982     if (likely(PyUnicode_Check(n)))
22983 #else
22984     if (likely(PyString_Check(n)))
22985 #endif
22986         return __Pyx_PyObject_GetAttrStr(o, n);
22987 #endif
22988     return PyObject_GetAttr(o, n);
22989 }
22990 
22991 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)22992 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
22993     PyObject *r;
22994     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
22995         PyErr_SetString(PyExc_TypeError,
22996                         "hasattr(): attribute name must be string");
22997         return -1;
22998     }
22999     r = __Pyx_GetAttr(o, n);
23000     if (unlikely(!r)) {
23001         PyErr_Clear();
23002         return 0;
23003     } else {
23004         Py_DECREF(r);
23005         return 1;
23006     }
23007 }
23008 
23009 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)23010 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
23011 #if CYTHON_COMPILING_IN_PYPY
23012     return PyObject_RichCompareBool(s1, s2, equals);
23013 #else
23014     if (s1 == s2) {
23015         return (equals == Py_EQ);
23016     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23017         const char *ps1, *ps2;
23018         Py_ssize_t length = PyBytes_GET_SIZE(s1);
23019         if (length != PyBytes_GET_SIZE(s2))
23020             return (equals == Py_NE);
23021         ps1 = PyBytes_AS_STRING(s1);
23022         ps2 = PyBytes_AS_STRING(s2);
23023         if (ps1[0] != ps2[0]) {
23024             return (equals == Py_NE);
23025         } else if (length == 1) {
23026             return (equals == Py_EQ);
23027         } else {
23028             int result;
23029 #if CYTHON_USE_UNICODE_INTERNALS
23030             Py_hash_t hash1, hash2;
23031             hash1 = ((PyBytesObject*)s1)->ob_shash;
23032             hash2 = ((PyBytesObject*)s2)->ob_shash;
23033             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23034                 return (equals == Py_NE);
23035             }
23036 #endif
23037             result = memcmp(ps1, ps2, (size_t)length);
23038             return (equals == Py_EQ) ? (result == 0) : (result != 0);
23039         }
23040     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23041         return (equals == Py_NE);
23042     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23043         return (equals == Py_NE);
23044     } else {
23045         int result;
23046         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23047         if (!py_result)
23048             return -1;
23049         result = __Pyx_PyObject_IsTrue(py_result);
23050         Py_DECREF(py_result);
23051         return result;
23052     }
23053 #endif
23054 }
23055 
23056 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)23057 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
23058 #if CYTHON_COMPILING_IN_PYPY
23059     return PyObject_RichCompareBool(s1, s2, equals);
23060 #else
23061 #if PY_MAJOR_VERSION < 3
23062     PyObject* owned_ref = NULL;
23063 #endif
23064     int s1_is_unicode, s2_is_unicode;
23065     if (s1 == s2) {
23066         goto return_eq;
23067     }
23068     s1_is_unicode = PyUnicode_CheckExact(s1);
23069     s2_is_unicode = PyUnicode_CheckExact(s2);
23070 #if PY_MAJOR_VERSION < 3
23071     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23072         owned_ref = PyUnicode_FromObject(s2);
23073         if (unlikely(!owned_ref))
23074             return -1;
23075         s2 = owned_ref;
23076         s2_is_unicode = 1;
23077     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23078         owned_ref = PyUnicode_FromObject(s1);
23079         if (unlikely(!owned_ref))
23080             return -1;
23081         s1 = owned_ref;
23082         s1_is_unicode = 1;
23083     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23084         return __Pyx_PyBytes_Equals(s1, s2, equals);
23085     }
23086 #endif
23087     if (s1_is_unicode & s2_is_unicode) {
23088         Py_ssize_t length;
23089         int kind;
23090         void *data1, *data2;
23091         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23092             return -1;
23093         length = __Pyx_PyUnicode_GET_LENGTH(s1);
23094         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23095             goto return_ne;
23096         }
23097 #if CYTHON_USE_UNICODE_INTERNALS
23098         {
23099             Py_hash_t hash1, hash2;
23100         #if CYTHON_PEP393_ENABLED
23101             hash1 = ((PyASCIIObject*)s1)->hash;
23102             hash2 = ((PyASCIIObject*)s2)->hash;
23103         #else
23104             hash1 = ((PyUnicodeObject*)s1)->hash;
23105             hash2 = ((PyUnicodeObject*)s2)->hash;
23106         #endif
23107             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23108                 goto return_ne;
23109             }
23110         }
23111 #endif
23112         kind = __Pyx_PyUnicode_KIND(s1);
23113         if (kind != __Pyx_PyUnicode_KIND(s2)) {
23114             goto return_ne;
23115         }
23116         data1 = __Pyx_PyUnicode_DATA(s1);
23117         data2 = __Pyx_PyUnicode_DATA(s2);
23118         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23119             goto return_ne;
23120         } else if (length == 1) {
23121             goto return_eq;
23122         } else {
23123             int result = memcmp(data1, data2, (size_t)(length * kind));
23124             #if PY_MAJOR_VERSION < 3
23125             Py_XDECREF(owned_ref);
23126             #endif
23127             return (equals == Py_EQ) ? (result == 0) : (result != 0);
23128         }
23129     } else if ((s1 == Py_None) & s2_is_unicode) {
23130         goto return_ne;
23131     } else if ((s2 == Py_None) & s1_is_unicode) {
23132         goto return_ne;
23133     } else {
23134         int result;
23135         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23136         #if PY_MAJOR_VERSION < 3
23137         Py_XDECREF(owned_ref);
23138         #endif
23139         if (!py_result)
23140             return -1;
23141         result = __Pyx_PyObject_IsTrue(py_result);
23142         Py_DECREF(py_result);
23143         return result;
23144     }
23145 return_eq:
23146     #if PY_MAJOR_VERSION < 3
23147     Py_XDECREF(owned_ref);
23148     #endif
23149     return (equals == Py_EQ);
23150 return_ne:
23151     #if PY_MAJOR_VERSION < 3
23152     Py_XDECREF(owned_ref);
23153     #endif
23154     return (equals == Py_NE);
23155 #endif
23156 }
23157 
23158 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)23159 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
23160     PyObject *args, *result = NULL;
23161     #if CYTHON_FAST_PYCALL
23162     if (PyFunction_Check(function)) {
23163         PyObject *args[2] = {arg1, arg2};
23164         return __Pyx_PyFunction_FastCall(function, args, 2);
23165     }
23166     #endif
23167     #if CYTHON_FAST_PYCCALL
23168     if (__Pyx_PyFastCFunction_Check(function)) {
23169         PyObject *args[2] = {arg1, arg2};
23170         return __Pyx_PyCFunction_FastCall(function, args, 2);
23171     }
23172     #endif
23173     args = PyTuple_New(2);
23174     if (unlikely(!args)) goto done;
23175     Py_INCREF(arg1);
23176     PyTuple_SET_ITEM(args, 0, arg1);
23177     Py_INCREF(arg2);
23178     PyTuple_SET_ITEM(args, 1, arg2);
23179     Py_INCREF(function);
23180     result = __Pyx_PyObject_Call(function, args, NULL);
23181     Py_DECREF(args);
23182     Py_DECREF(function);
23183 done:
23184     return result;
23185 }
23186 
23187 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)23188 static void __Pyx_RaiseArgtupleInvalid(
23189     const char* func_name,
23190     int exact,
23191     Py_ssize_t num_min,
23192     Py_ssize_t num_max,
23193     Py_ssize_t num_found)
23194 {
23195     Py_ssize_t num_expected;
23196     const char *more_or_less;
23197     if (num_found < num_min) {
23198         num_expected = num_min;
23199         more_or_less = "at least";
23200     } else {
23201         num_expected = num_max;
23202         more_or_less = "at most";
23203     }
23204     if (exact) {
23205         more_or_less = "exactly";
23206     }
23207     PyErr_Format(PyExc_TypeError,
23208                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23209                  func_name, more_or_less, num_expected,
23210                  (num_expected == 1) ? "" : "s", num_found);
23211 }
23212 
23213 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)23214 static void __Pyx_RaiseDoubleKeywordsError(
23215     const char* func_name,
23216     PyObject* kw_name)
23217 {
23218     PyErr_Format(PyExc_TypeError,
23219         #if PY_MAJOR_VERSION >= 3
23220         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23221         #else
23222         "%s() got multiple values for keyword argument '%s'", func_name,
23223         PyString_AsString(kw_name));
23224         #endif
23225 }
23226 
23227 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)23228 static int __Pyx_ParseOptionalKeywords(
23229     PyObject *kwds,
23230     PyObject **argnames[],
23231     PyObject *kwds2,
23232     PyObject *values[],
23233     Py_ssize_t num_pos_args,
23234     const char* function_name)
23235 {
23236     PyObject *key = 0, *value = 0;
23237     Py_ssize_t pos = 0;
23238     PyObject*** name;
23239     PyObject*** first_kw_arg = argnames + num_pos_args;
23240     while (PyDict_Next(kwds, &pos, &key, &value)) {
23241         name = first_kw_arg;
23242         while (*name && (**name != key)) name++;
23243         if (*name) {
23244             values[name-argnames] = value;
23245             continue;
23246         }
23247         name = first_kw_arg;
23248         #if PY_MAJOR_VERSION < 3
23249         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23250             while (*name) {
23251                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23252                         && _PyString_Eq(**name, key)) {
23253                     values[name-argnames] = value;
23254                     break;
23255                 }
23256                 name++;
23257             }
23258             if (*name) continue;
23259             else {
23260                 PyObject*** argname = argnames;
23261                 while (argname != first_kw_arg) {
23262                     if ((**argname == key) || (
23263                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23264                              && _PyString_Eq(**argname, key))) {
23265                         goto arg_passed_twice;
23266                     }
23267                     argname++;
23268                 }
23269             }
23270         } else
23271         #endif
23272         if (likely(PyUnicode_Check(key))) {
23273             while (*name) {
23274                 int cmp = (**name == key) ? 0 :
23275                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23276                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23277                 #endif
23278                     PyUnicode_Compare(**name, key);
23279                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23280                 if (cmp == 0) {
23281                     values[name-argnames] = value;
23282                     break;
23283                 }
23284                 name++;
23285             }
23286             if (*name) continue;
23287             else {
23288                 PyObject*** argname = argnames;
23289                 while (argname != first_kw_arg) {
23290                     int cmp = (**argname == key) ? 0 :
23291                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23292                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23293                     #endif
23294                         PyUnicode_Compare(**argname, key);
23295                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23296                     if (cmp == 0) goto arg_passed_twice;
23297                     argname++;
23298                 }
23299             }
23300         } else
23301             goto invalid_keyword_type;
23302         if (kwds2) {
23303             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23304         } else {
23305             goto invalid_keyword;
23306         }
23307     }
23308     return 0;
23309 arg_passed_twice:
23310     __Pyx_RaiseDoubleKeywordsError(function_name, key);
23311     goto bad;
23312 invalid_keyword_type:
23313     PyErr_Format(PyExc_TypeError,
23314         "%.200s() keywords must be strings", function_name);
23315     goto bad;
23316 invalid_keyword:
23317     PyErr_Format(PyExc_TypeError,
23318     #if PY_MAJOR_VERSION < 3
23319         "%.200s() got an unexpected keyword argument '%.200s'",
23320         function_name, PyString_AsString(key));
23321     #else
23322         "%s() got an unexpected keyword argument '%U'",
23323         function_name, key);
23324     #endif
23325 bad:
23326     return -1;
23327 }
23328 
23329 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)23330 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23331 {
23332     if (unlikely(!type)) {
23333         PyErr_SetString(PyExc_SystemError, "Missing type object");
23334         return 0;
23335     }
23336     else if (exact) {
23337         #if PY_MAJOR_VERSION == 2
23338         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23339         #endif
23340     }
23341     else {
23342         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23343     }
23344     PyErr_Format(PyExc_TypeError,
23345         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23346         name, type->tp_name, Py_TYPE(obj)->tp_name);
23347     return 0;
23348 }
23349 
23350 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)23351 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
23352     Py_ssize_t q = a / b;
23353     Py_ssize_t r = a - q*b;
23354     q -= ((r != 0) & ((r ^ b) < 0));
23355     return q;
23356 }
23357 
23358 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)23359 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23360     PyObject *r;
23361     if (!j) return NULL;
23362     r = PyObject_GetItem(o, j);
23363     Py_DECREF(j);
23364     return r;
23365 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)23366 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23367                                                               CYTHON_NCP_UNUSED int wraparound,
23368                                                               CYTHON_NCP_UNUSED int boundscheck) {
23369 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23370     Py_ssize_t wrapped_i = i;
23371     if (wraparound & unlikely(i < 0)) {
23372         wrapped_i += PyList_GET_SIZE(o);
23373     }
23374     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23375         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23376         Py_INCREF(r);
23377         return r;
23378     }
23379     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23380 #else
23381     return PySequence_GetItem(o, i);
23382 #endif
23383 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)23384 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23385                                                               CYTHON_NCP_UNUSED int wraparound,
23386                                                               CYTHON_NCP_UNUSED int boundscheck) {
23387 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23388     Py_ssize_t wrapped_i = i;
23389     if (wraparound & unlikely(i < 0)) {
23390         wrapped_i += PyTuple_GET_SIZE(o);
23391     }
23392     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23393         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23394         Py_INCREF(r);
23395         return r;
23396     }
23397     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23398 #else
23399     return PySequence_GetItem(o, i);
23400 #endif
23401 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)23402 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23403                                                      CYTHON_NCP_UNUSED int wraparound,
23404                                                      CYTHON_NCP_UNUSED int boundscheck) {
23405 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23406     if (is_list || PyList_CheckExact(o)) {
23407         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23408         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
23409             PyObject *r = PyList_GET_ITEM(o, n);
23410             Py_INCREF(r);
23411             return r;
23412         }
23413     }
23414     else if (PyTuple_CheckExact(o)) {
23415         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23416         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
23417             PyObject *r = PyTuple_GET_ITEM(o, n);
23418             Py_INCREF(r);
23419             return r;
23420         }
23421     } else {
23422         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23423         if (likely(m && m->sq_item)) {
23424             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23425                 Py_ssize_t l = m->sq_length(o);
23426                 if (likely(l >= 0)) {
23427                     i += l;
23428                 } else {
23429                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23430                         return NULL;
23431                     PyErr_Clear();
23432                 }
23433             }
23434             return m->sq_item(o, i);
23435         }
23436     }
23437 #else
23438     if (is_list || PySequence_Check(o)) {
23439         return PySequence_GetItem(o, i);
23440     }
23441 #endif
23442     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23443 }
23444 
23445 /* ObjectGetItem */
23446 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)23447 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23448     PyObject *runerr;
23449     Py_ssize_t key_value;
23450     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23451     if (unlikely(!(m && m->sq_item))) {
23452         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23453         return NULL;
23454     }
23455     key_value = __Pyx_PyIndex_AsSsize_t(index);
23456     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23457         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23458     }
23459     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23460         PyErr_Clear();
23461         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23462     }
23463     return NULL;
23464 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)23465 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23466     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23467     if (likely(m && m->mp_subscript)) {
23468         return m->mp_subscript(obj, key);
23469     }
23470     return __Pyx_PyObject_GetIndex(obj, key);
23471 }
23472 #endif
23473 
23474 /* 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))23475 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23476          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23477          const char* encoding, const char* errors,
23478          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
23479     Py_ssize_t length;
23480     if (unlikely((start < 0) | (stop < 0))) {
23481         size_t slen = strlen(cstring);
23482         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
23483             PyErr_SetString(PyExc_OverflowError,
23484                             "c-string too long to convert to Python");
23485             return NULL;
23486         }
23487         length = (Py_ssize_t) slen;
23488         if (start < 0) {
23489             start += length;
23490             if (start < 0)
23491                 start = 0;
23492         }
23493         if (stop < 0)
23494             stop += length;
23495     }
23496     length = stop - start;
23497     if (unlikely(length <= 0))
23498         return PyUnicode_FromUnicode(NULL, 0);
23499     cstring += start;
23500     if (decode_func) {
23501         return decode_func(cstring, length, errors);
23502     } else {
23503         return PyUnicode_Decode(cstring, length, encoding, errors);
23504     }
23505 }
23506 
23507 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)23508 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23509     __Pyx_PyThreadState_declare
23510     __Pyx_PyThreadState_assign
23511     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23512         return NULL;
23513     __Pyx_PyErr_Clear();
23514     Py_INCREF(d);
23515     return d;
23516 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)23517 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
23518     PyObject *r = __Pyx_GetAttr(o, n);
23519     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
23520 }
23521 
23522 /* PyDictVersioning */
23523 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)23524 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23525     PyObject *dict = Py_TYPE(obj)->tp_dict;
23526     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23527 }
__Pyx_get_object_dict_version(PyObject * obj)23528 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23529     PyObject **dictptr = NULL;
23530     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23531     if (offset) {
23532 #if CYTHON_COMPILING_IN_CPYTHON
23533         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
23534 #else
23535         dictptr = _PyObject_GetDictPtr(obj);
23536 #endif
23537     }
23538     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23539 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)23540 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23541     PyObject *dict = Py_TYPE(obj)->tp_dict;
23542     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23543         return 0;
23544     return obj_dict_version == __Pyx_get_object_dict_version(obj);
23545 }
23546 #endif
23547 
23548 /* GetModuleGlobalName */
23549 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)23550 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23551 #else
23552 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23553 #endif
23554 {
23555     PyObject *result;
23556 #if !CYTHON_AVOID_BORROWED_REFS
23557 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23558     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23559     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23560     if (likely(result)) {
23561         return __Pyx_NewRef(result);
23562     } else if (unlikely(PyErr_Occurred())) {
23563         return NULL;
23564     }
23565 #else
23566     result = PyDict_GetItem(__pyx_d, name);
23567     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23568     if (likely(result)) {
23569         return __Pyx_NewRef(result);
23570     }
23571 #endif
23572 #else
23573     result = PyObject_GetItem(__pyx_d, name);
23574     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23575     if (likely(result)) {
23576         return __Pyx_NewRef(result);
23577     }
23578     PyErr_Clear();
23579 #endif
23580     return __Pyx_GetBuiltinName(name);
23581 }
23582 
23583 /* SwapException */
23584 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)23585 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23586     PyObject *tmp_type, *tmp_value, *tmp_tb;
23587     #if CYTHON_USE_EXC_INFO_STACK
23588     _PyErr_StackItem *exc_info = tstate->exc_info;
23589     tmp_type = exc_info->exc_type;
23590     tmp_value = exc_info->exc_value;
23591     tmp_tb = exc_info->exc_traceback;
23592     exc_info->exc_type = *type;
23593     exc_info->exc_value = *value;
23594     exc_info->exc_traceback = *tb;
23595     #else
23596     tmp_type = tstate->exc_type;
23597     tmp_value = tstate->exc_value;
23598     tmp_tb = tstate->exc_traceback;
23599     tstate->exc_type = *type;
23600     tstate->exc_value = *value;
23601     tstate->exc_traceback = *tb;
23602     #endif
23603     *type = tmp_type;
23604     *value = tmp_value;
23605     *tb = tmp_tb;
23606 }
23607 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)23608 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23609     PyObject *tmp_type, *tmp_value, *tmp_tb;
23610     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23611     PyErr_SetExcInfo(*type, *value, *tb);
23612     *type = tmp_type;
23613     *value = tmp_value;
23614     *tb = tmp_tb;
23615 }
23616 #endif
23617 
23618 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)23619 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
23620     PyObject *empty_list = 0;
23621     PyObject *module = 0;
23622     PyObject *global_dict = 0;
23623     PyObject *empty_dict = 0;
23624     PyObject *list;
23625     #if PY_MAJOR_VERSION < 3
23626     PyObject *py_import;
23627     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23628     if (!py_import)
23629         goto bad;
23630     #endif
23631     if (from_list)
23632         list = from_list;
23633     else {
23634         empty_list = PyList_New(0);
23635         if (!empty_list)
23636             goto bad;
23637         list = empty_list;
23638     }
23639     global_dict = PyModule_GetDict(__pyx_m);
23640     if (!global_dict)
23641         goto bad;
23642     empty_dict = PyDict_New();
23643     if (!empty_dict)
23644         goto bad;
23645     {
23646         #if PY_MAJOR_VERSION >= 3
23647         if (level == -1) {
23648             if (strchr(__Pyx_MODULE_NAME, '.')) {
23649                 module = PyImport_ImportModuleLevelObject(
23650                     name, global_dict, empty_dict, list, 1);
23651                 if (!module) {
23652                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
23653                         goto bad;
23654                     PyErr_Clear();
23655                 }
23656             }
23657             level = 0;
23658         }
23659         #endif
23660         if (!module) {
23661             #if PY_MAJOR_VERSION < 3
23662             PyObject *py_level = PyInt_FromLong(level);
23663             if (!py_level)
23664                 goto bad;
23665             module = PyObject_CallFunctionObjArgs(py_import,
23666                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
23667             Py_DECREF(py_level);
23668             #else
23669             module = PyImport_ImportModuleLevelObject(
23670                 name, global_dict, empty_dict, list, level);
23671             #endif
23672         }
23673     }
23674 bad:
23675     #if PY_MAJOR_VERSION < 3
23676     Py_XDECREF(py_import);
23677     #endif
23678     Py_XDECREF(empty_list);
23679     Py_XDECREF(empty_dict);
23680     return module;
23681 }
23682 
23683 /* FastTypeChecks */
23684 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)23685 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
23686     while (a) {
23687         a = a->tp_base;
23688         if (a == b)
23689             return 1;
23690     }
23691     return b == &PyBaseObject_Type;
23692 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)23693 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
23694     PyObject *mro;
23695     if (a == b) return 1;
23696     mro = a->tp_mro;
23697     if (likely(mro)) {
23698         Py_ssize_t i, n;
23699         n = PyTuple_GET_SIZE(mro);
23700         for (i = 0; i < n; i++) {
23701             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
23702                 return 1;
23703         }
23704         return 0;
23705     }
23706     return __Pyx_InBases(a, b);
23707 }
23708 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)23709 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
23710     PyObject *exception, *value, *tb;
23711     int res;
23712     __Pyx_PyThreadState_declare
23713     __Pyx_PyThreadState_assign
23714     __Pyx_ErrFetch(&exception, &value, &tb);
23715     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
23716     if (unlikely(res == -1)) {
23717         PyErr_WriteUnraisable(err);
23718         res = 0;
23719     }
23720     if (!res) {
23721         res = PyObject_IsSubclass(err, exc_type2);
23722         if (unlikely(res == -1)) {
23723             PyErr_WriteUnraisable(err);
23724             res = 0;
23725         }
23726     }
23727     __Pyx_ErrRestore(exception, value, tb);
23728     return res;
23729 }
23730 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)23731 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
23732     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
23733     if (!res) {
23734         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
23735     }
23736     return res;
23737 }
23738 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)23739 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23740     Py_ssize_t i, n;
23741     assert(PyExceptionClass_Check(exc_type));
23742     n = PyTuple_GET_SIZE(tuple);
23743 #if PY_MAJOR_VERSION >= 3
23744     for (i=0; i<n; i++) {
23745         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
23746     }
23747 #endif
23748     for (i=0; i<n; i++) {
23749         PyObject *t = PyTuple_GET_ITEM(tuple, i);
23750         #if PY_MAJOR_VERSION < 3
23751         if (likely(exc_type == t)) return 1;
23752         #endif
23753         if (likely(PyExceptionClass_Check(t))) {
23754             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
23755         } else {
23756         }
23757     }
23758     return 0;
23759 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)23760 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
23761     if (likely(err == exc_type)) return 1;
23762     if (likely(PyExceptionClass_Check(err))) {
23763         if (likely(PyExceptionClass_Check(exc_type))) {
23764             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
23765         } else if (likely(PyTuple_Check(exc_type))) {
23766             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
23767         } else {
23768         }
23769     }
23770     return PyErr_GivenExceptionMatches(err, exc_type);
23771 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)23772 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
23773     assert(PyExceptionClass_Check(exc_type1));
23774     assert(PyExceptionClass_Check(exc_type2));
23775     if (likely(err == exc_type1 || err == exc_type2)) return 1;
23776     if (likely(PyExceptionClass_Check(err))) {
23777         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
23778     }
23779     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
23780 }
23781 #endif
23782 
23783 /* PyIntBinop */
23784 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)23785 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23786     (void)inplace;
23787     (void)zerodivision_check;
23788     #if PY_MAJOR_VERSION < 3
23789     if (likely(PyInt_CheckExact(op1))) {
23790         const long b = intval;
23791         long x;
23792         long a = PyInt_AS_LONG(op1);
23793             x = (long)((unsigned long)a + b);
23794             if (likely((x^a) >= 0 || (x^b) >= 0))
23795                 return PyInt_FromLong(x);
23796             return PyLong_Type.tp_as_number->nb_add(op1, op2);
23797     }
23798     #endif
23799     #if CYTHON_USE_PYLONG_INTERNALS
23800     if (likely(PyLong_CheckExact(op1))) {
23801         const long b = intval;
23802         long a, x;
23803 #ifdef HAVE_LONG_LONG
23804         const PY_LONG_LONG llb = intval;
23805         PY_LONG_LONG lla, llx;
23806 #endif
23807         const digit* digits = ((PyLongObject*)op1)->ob_digit;
23808         const Py_ssize_t size = Py_SIZE(op1);
23809         if (likely(__Pyx_sst_abs(size) <= 1)) {
23810             a = likely(size) ? digits[0] : 0;
23811             if (size == -1) a = -a;
23812         } else {
23813             switch (size) {
23814                 case -2:
23815                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23816                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23817                         break;
23818 #ifdef HAVE_LONG_LONG
23819                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23820                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23821                         goto long_long;
23822 #endif
23823                     }
23824                     CYTHON_FALLTHROUGH;
23825                 case 2:
23826                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23827                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23828                         break;
23829 #ifdef HAVE_LONG_LONG
23830                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23831                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23832                         goto long_long;
23833 #endif
23834                     }
23835                     CYTHON_FALLTHROUGH;
23836                 case -3:
23837                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23838                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23839                         break;
23840 #ifdef HAVE_LONG_LONG
23841                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23842                         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]));
23843                         goto long_long;
23844 #endif
23845                     }
23846                     CYTHON_FALLTHROUGH;
23847                 case 3:
23848                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23849                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23850                         break;
23851 #ifdef HAVE_LONG_LONG
23852                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23853                         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]));
23854                         goto long_long;
23855 #endif
23856                     }
23857                     CYTHON_FALLTHROUGH;
23858                 case -4:
23859                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23860                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23861                         break;
23862 #ifdef HAVE_LONG_LONG
23863                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23864                         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]));
23865                         goto long_long;
23866 #endif
23867                     }
23868                     CYTHON_FALLTHROUGH;
23869                 case 4:
23870                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23871                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23872                         break;
23873 #ifdef HAVE_LONG_LONG
23874                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23875                         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]));
23876                         goto long_long;
23877 #endif
23878                     }
23879                     CYTHON_FALLTHROUGH;
23880                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23881             }
23882         }
23883                 x = a + b;
23884             return PyLong_FromLong(x);
23885 #ifdef HAVE_LONG_LONG
23886         long_long:
23887                 llx = lla + llb;
23888             return PyLong_FromLongLong(llx);
23889 #endif
23890 
23891 
23892     }
23893     #endif
23894     if (PyFloat_CheckExact(op1)) {
23895         const long b = intval;
23896         double a = PyFloat_AS_DOUBLE(op1);
23897             double result;
23898             PyFPE_START_PROTECT("add", return NULL)
23899             result = ((double)a) + (double)b;
23900             PyFPE_END_PROTECT(result)
23901             return PyFloat_FromDouble(result);
23902     }
23903     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23904 }
23905 #endif
23906 
23907 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)23908 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
23909     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
23910 }
23911 
23912 /* None */
__Pyx_div_long(long a,long b)23913 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
23914     long q = a / b;
23915     long r = a - q*b;
23916     q -= ((r != 0) & ((r ^ b) < 0));
23917     return q;
23918 }
23919 
23920 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)23921 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23922     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23923     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23924         PyErr_Format(PyExc_ImportError,
23925         #if PY_MAJOR_VERSION < 3
23926             "cannot import name %.230s", PyString_AS_STRING(name));
23927         #else
23928             "cannot import name %S", name);
23929         #endif
23930     }
23931     return value;
23932 }
23933 
23934 /* PyObject_GenericGetAttrNoDict */
23935 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)23936 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
23937     PyErr_Format(PyExc_AttributeError,
23938 #if PY_MAJOR_VERSION >= 3
23939                  "'%.50s' object has no attribute '%U'",
23940                  tp->tp_name, attr_name);
23941 #else
23942                  "'%.50s' object has no attribute '%.400s'",
23943                  tp->tp_name, PyString_AS_STRING(attr_name));
23944 #endif
23945     return NULL;
23946 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)23947 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
23948     PyObject *descr;
23949     PyTypeObject *tp = Py_TYPE(obj);
23950     if (unlikely(!PyString_Check(attr_name))) {
23951         return PyObject_GenericGetAttr(obj, attr_name);
23952     }
23953     assert(!tp->tp_dictoffset);
23954     descr = _PyType_Lookup(tp, attr_name);
23955     if (unlikely(!descr)) {
23956         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
23957     }
23958     Py_INCREF(descr);
23959     #if PY_MAJOR_VERSION < 3
23960     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
23961     #endif
23962     {
23963         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
23964         if (unlikely(f)) {
23965             PyObject *res = f(descr, obj, (PyObject *)tp);
23966             Py_DECREF(descr);
23967             return res;
23968         }
23969     }
23970     return descr;
23971 }
23972 #endif
23973 
23974 /* PyObject_GenericGetAttr */
23975 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)23976 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
23977     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
23978         return PyObject_GenericGetAttr(obj, attr_name);
23979     }
23980     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
23981 }
23982 #endif
23983 
23984 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)23985 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
23986 #if PY_VERSION_HEX >= 0x02070000
23987     PyObject *ob = PyCapsule_New(vtable, 0, 0);
23988 #else
23989     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
23990 #endif
23991     if (!ob)
23992         goto bad;
23993     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
23994         goto bad;
23995     Py_DECREF(ob);
23996     return 0;
23997 bad:
23998     Py_XDECREF(ob);
23999     return -1;
24000 }
24001 
24002 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)24003 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24004   int ret;
24005   PyObject *name_attr;
24006   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24007   if (likely(name_attr)) {
24008       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24009   } else {
24010       ret = -1;
24011   }
24012   if (unlikely(ret < 0)) {
24013       PyErr_Clear();
24014       ret = 0;
24015   }
24016   Py_XDECREF(name_attr);
24017   return ret;
24018 }
__Pyx_setup_reduce(PyObject * type_obj)24019 static int __Pyx_setup_reduce(PyObject* type_obj) {
24020     int ret = 0;
24021     PyObject *object_reduce = NULL;
24022     PyObject *object_reduce_ex = NULL;
24023     PyObject *reduce = NULL;
24024     PyObject *reduce_ex = NULL;
24025     PyObject *reduce_cython = NULL;
24026     PyObject *setstate = NULL;
24027     PyObject *setstate_cython = NULL;
24028 #if CYTHON_USE_PYTYPE_LOOKUP
24029     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
24030 #else
24031     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
24032 #endif
24033 #if CYTHON_USE_PYTYPE_LOOKUP
24034     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
24035 #else
24036     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
24037 #endif
24038     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
24039     if (reduce_ex == object_reduce_ex) {
24040 #if CYTHON_USE_PYTYPE_LOOKUP
24041         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
24042 #else
24043         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
24044 #endif
24045         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
24046         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
24047             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
24048             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
24049             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
24050             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
24051             if (!setstate) PyErr_Clear();
24052             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
24053                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
24054                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
24055                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
24056             }
24057             PyType_Modified((PyTypeObject*)type_obj);
24058         }
24059     }
24060     goto GOOD;
24061 BAD:
24062     if (!PyErr_Occurred())
24063         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24064     ret = -1;
24065 GOOD:
24066 #if !CYTHON_USE_PYTYPE_LOOKUP
24067     Py_XDECREF(object_reduce);
24068     Py_XDECREF(object_reduce_ex);
24069 #endif
24070     Py_XDECREF(reduce);
24071     Py_XDECREF(reduce_ex);
24072     Py_XDECREF(reduce_cython);
24073     Py_XDECREF(setstate);
24074     Py_XDECREF(setstate_cython);
24075     return ret;
24076 }
24077 
24078 /* TypeImport */
24079 #ifndef __PYX_HAVE_RT_ImportType
24080 #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)24081 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
24082     size_t size, enum __Pyx_ImportType_CheckSize check_size)
24083 {
24084     PyObject *result = 0;
24085     char warning[200];
24086     Py_ssize_t basicsize;
24087 #ifdef Py_LIMITED_API
24088     PyObject *py_basicsize;
24089 #endif
24090     result = PyObject_GetAttrString(module, class_name);
24091     if (!result)
24092         goto bad;
24093     if (!PyType_Check(result)) {
24094         PyErr_Format(PyExc_TypeError,
24095             "%.200s.%.200s is not a type object",
24096             module_name, class_name);
24097         goto bad;
24098     }
24099 #ifndef Py_LIMITED_API
24100     basicsize = ((PyTypeObject *)result)->tp_basicsize;
24101 #else
24102     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
24103     if (!py_basicsize)
24104         goto bad;
24105     basicsize = PyLong_AsSsize_t(py_basicsize);
24106     Py_DECREF(py_basicsize);
24107     py_basicsize = 0;
24108     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24109         goto bad;
24110 #endif
24111     if ((size_t)basicsize < size) {
24112         PyErr_Format(PyExc_ValueError,
24113             "%.200s.%.200s size changed, may indicate binary incompatibility. "
24114             "Expected %zd from C header, got %zd from PyObject",
24115             module_name, class_name, size, basicsize);
24116         goto bad;
24117     }
24118     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
24119         PyErr_Format(PyExc_ValueError,
24120             "%.200s.%.200s size changed, may indicate binary incompatibility. "
24121             "Expected %zd from C header, got %zd from PyObject",
24122             module_name, class_name, size, basicsize);
24123         goto bad;
24124     }
24125     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
24126         PyOS_snprintf(warning, sizeof(warning),
24127             "%s.%s size changed, may indicate binary incompatibility. "
24128             "Expected %zd from C header, got %zd from PyObject",
24129             module_name, class_name, size, basicsize);
24130         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
24131     }
24132     return (PyTypeObject *)result;
24133 bad:
24134     Py_XDECREF(result);
24135     return NULL;
24136 }
24137 #endif
24138 
24139 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)24140 static void* __Pyx_GetVtable(PyObject *dict) {
24141     void* ptr;
24142     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
24143     if (!ob)
24144         goto bad;
24145 #if PY_VERSION_HEX >= 0x02070000
24146     ptr = PyCapsule_GetPointer(ob, 0);
24147 #else
24148     ptr = PyCObject_AsVoidPtr(ob);
24149 #endif
24150     if (!ptr && !PyErr_Occurred())
24151         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
24152     Py_DECREF(ob);
24153     return ptr;
24154 bad:
24155     Py_XDECREF(ob);
24156     return NULL;
24157 }
24158 
24159 /* CLineInTraceback */
24160 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)24161 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
24162     PyObject *use_cline;
24163     PyObject *ptype, *pvalue, *ptraceback;
24164 #if CYTHON_COMPILING_IN_CPYTHON
24165     PyObject **cython_runtime_dict;
24166 #endif
24167     if (unlikely(!__pyx_cython_runtime)) {
24168         return c_line;
24169     }
24170     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
24171 #if CYTHON_COMPILING_IN_CPYTHON
24172     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
24173     if (likely(cython_runtime_dict)) {
24174         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
24175             use_cline, *cython_runtime_dict,
24176             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
24177     } else
24178 #endif
24179     {
24180       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
24181       if (use_cline_obj) {
24182         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
24183         Py_DECREF(use_cline_obj);
24184       } else {
24185         PyErr_Clear();
24186         use_cline = NULL;
24187       }
24188     }
24189     if (!use_cline) {
24190         c_line = 0;
24191         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
24192     }
24193     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
24194         c_line = 0;
24195     }
24196     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
24197     return c_line;
24198 }
24199 #endif
24200 
24201 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)24202 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
24203     int start = 0, mid = 0, end = count - 1;
24204     if (end >= 0 && code_line > entries[end].code_line) {
24205         return count;
24206     }
24207     while (start < end) {
24208         mid = start + (end - start) / 2;
24209         if (code_line < entries[mid].code_line) {
24210             end = mid;
24211         } else if (code_line > entries[mid].code_line) {
24212              start = mid + 1;
24213         } else {
24214             return mid;
24215         }
24216     }
24217     if (code_line <= entries[mid].code_line) {
24218         return mid;
24219     } else {
24220         return mid + 1;
24221     }
24222 }
__pyx_find_code_object(int code_line)24223 static PyCodeObject *__pyx_find_code_object(int code_line) {
24224     PyCodeObject* code_object;
24225     int pos;
24226     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
24227         return NULL;
24228     }
24229     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24230     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
24231         return NULL;
24232     }
24233     code_object = __pyx_code_cache.entries[pos].code_object;
24234     Py_INCREF(code_object);
24235     return code_object;
24236 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)24237 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
24238     int pos, i;
24239     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
24240     if (unlikely(!code_line)) {
24241         return;
24242     }
24243     if (unlikely(!entries)) {
24244         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
24245         if (likely(entries)) {
24246             __pyx_code_cache.entries = entries;
24247             __pyx_code_cache.max_count = 64;
24248             __pyx_code_cache.count = 1;
24249             entries[0].code_line = code_line;
24250             entries[0].code_object = code_object;
24251             Py_INCREF(code_object);
24252         }
24253         return;
24254     }
24255     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24256     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
24257         PyCodeObject* tmp = entries[pos].code_object;
24258         entries[pos].code_object = code_object;
24259         Py_DECREF(tmp);
24260         return;
24261     }
24262     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
24263         int new_max = __pyx_code_cache.max_count + 64;
24264         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
24265             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
24266         if (unlikely(!entries)) {
24267             return;
24268         }
24269         __pyx_code_cache.entries = entries;
24270         __pyx_code_cache.max_count = new_max;
24271     }
24272     for (i=__pyx_code_cache.count; i>pos; i--) {
24273         entries[i] = entries[i-1];
24274     }
24275     entries[pos].code_line = code_line;
24276     entries[pos].code_object = code_object;
24277     __pyx_code_cache.count++;
24278     Py_INCREF(code_object);
24279 }
24280 
24281 /* AddTraceback */
24282 #include "compile.h"
24283 #include "frameobject.h"
24284 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)24285 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
24286             const char *funcname, int c_line,
24287             int py_line, const char *filename) {
24288     PyCodeObject *py_code = 0;
24289     PyObject *py_srcfile = 0;
24290     PyObject *py_funcname = 0;
24291     #if PY_MAJOR_VERSION < 3
24292     py_srcfile = PyString_FromString(filename);
24293     #else
24294     py_srcfile = PyUnicode_FromString(filename);
24295     #endif
24296     if (!py_srcfile) goto bad;
24297     if (c_line) {
24298         #if PY_MAJOR_VERSION < 3
24299         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24300         #else
24301         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24302         #endif
24303     }
24304     else {
24305         #if PY_MAJOR_VERSION < 3
24306         py_funcname = PyString_FromString(funcname);
24307         #else
24308         py_funcname = PyUnicode_FromString(funcname);
24309         #endif
24310     }
24311     if (!py_funcname) goto bad;
24312     py_code = __Pyx_PyCode_New(
24313         0,
24314         0,
24315         0,
24316         0,
24317         0,
24318         __pyx_empty_bytes, /*PyObject *code,*/
24319         __pyx_empty_tuple, /*PyObject *consts,*/
24320         __pyx_empty_tuple, /*PyObject *names,*/
24321         __pyx_empty_tuple, /*PyObject *varnames,*/
24322         __pyx_empty_tuple, /*PyObject *freevars,*/
24323         __pyx_empty_tuple, /*PyObject *cellvars,*/
24324         py_srcfile,   /*PyObject *filename,*/
24325         py_funcname,  /*PyObject *name,*/
24326         py_line,
24327         __pyx_empty_bytes  /*PyObject *lnotab*/
24328     );
24329     Py_DECREF(py_srcfile);
24330     Py_DECREF(py_funcname);
24331     return py_code;
24332 bad:
24333     Py_XDECREF(py_srcfile);
24334     Py_XDECREF(py_funcname);
24335     return NULL;
24336 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)24337 static void __Pyx_AddTraceback(const char *funcname, int c_line,
24338                                int py_line, const char *filename) {
24339     PyCodeObject *py_code = 0;
24340     PyFrameObject *py_frame = 0;
24341     PyThreadState *tstate = __Pyx_PyThreadState_Current;
24342     if (c_line) {
24343         c_line = __Pyx_CLineForTraceback(tstate, c_line);
24344     }
24345     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
24346     if (!py_code) {
24347         py_code = __Pyx_CreateCodeObjectForTraceback(
24348             funcname, c_line, py_line, filename);
24349         if (!py_code) goto bad;
24350         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
24351     }
24352     py_frame = PyFrame_New(
24353         tstate,            /*PyThreadState *tstate,*/
24354         py_code,           /*PyCodeObject *code,*/
24355         __pyx_d,    /*PyObject *globals,*/
24356         0                  /*PyObject *locals*/
24357     );
24358     if (!py_frame) goto bad;
24359     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
24360     PyTraceBack_Here(py_frame);
24361 bad:
24362     Py_XDECREF(py_code);
24363     Py_XDECREF(py_frame);
24364 }
24365 
24366 /* CIntFromPyVerify */
24367 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
24368     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
24369 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
24370     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
24371 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
24372     {\
24373         func_type value = func_value;\
24374         if (sizeof(target_type) < sizeof(func_type)) {\
24375             if (unlikely(value != (func_type) (target_type) value)) {\
24376                 func_type zero = 0;\
24377                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
24378                     return (target_type) -1;\
24379                 if (is_unsigned && unlikely(value < zero))\
24380                     goto raise_neg_overflow;\
24381                 else\
24382                     goto raise_overflow;\
24383             }\
24384         }\
24385         return (target_type) value;\
24386     }
24387 
24388 /* Declarations */
24389 #if CYTHON_CCOMPLEX
24390   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)24391     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24392       return ::std::complex< float >(x, y);
24393     }
24394   #else
__pyx_t_float_complex_from_parts(float x,float y)24395     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24396       return x + y*(__pyx_t_float_complex)_Complex_I;
24397     }
24398   #endif
24399 #else
__pyx_t_float_complex_from_parts(float x,float y)24400     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24401       __pyx_t_float_complex z;
24402       z.real = x;
24403       z.imag = y;
24404       return z;
24405     }
24406 #endif
24407 
24408 /* Arithmetic */
24409 #if CYTHON_CCOMPLEX
24410 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24411     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24412        return (a.real == b.real) && (a.imag == b.imag);
24413     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24414     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24415         __pyx_t_float_complex z;
24416         z.real = a.real + b.real;
24417         z.imag = a.imag + b.imag;
24418         return z;
24419     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24420     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24421         __pyx_t_float_complex z;
24422         z.real = a.real - b.real;
24423         z.imag = a.imag - b.imag;
24424         return z;
24425     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24426     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24427         __pyx_t_float_complex z;
24428         z.real = a.real * b.real - a.imag * b.imag;
24429         z.imag = a.real * b.imag + a.imag * b.real;
24430         return z;
24431     }
24432     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24433     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24434         if (b.imag == 0) {
24435             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24436         } else if (fabsf(b.real) >= fabsf(b.imag)) {
24437             if (b.real == 0 && b.imag == 0) {
24438                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
24439             } else {
24440                 float r = b.imag / b.real;
24441                 float s = (float)(1.0) / (b.real + b.imag * r);
24442                 return __pyx_t_float_complex_from_parts(
24443                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24444             }
24445         } else {
24446             float r = b.real / b.imag;
24447             float s = (float)(1.0) / (b.imag + b.real * r);
24448             return __pyx_t_float_complex_from_parts(
24449                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24450         }
24451     }
24452     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24453     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24454         if (b.imag == 0) {
24455             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24456         } else {
24457             float denom = b.real * b.real + b.imag * b.imag;
24458             return __pyx_t_float_complex_from_parts(
24459                 (a.real * b.real + a.imag * b.imag) / denom,
24460                 (a.imag * b.real - a.real * b.imag) / denom);
24461         }
24462     }
24463     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)24464     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
24465         __pyx_t_float_complex z;
24466         z.real = -a.real;
24467         z.imag = -a.imag;
24468         return z;
24469     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)24470     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
24471        return (a.real == 0) && (a.imag == 0);
24472     }
__Pyx_c_conj_float(__pyx_t_float_complex a)24473     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
24474         __pyx_t_float_complex z;
24475         z.real =  a.real;
24476         z.imag = -a.imag;
24477         return z;
24478     }
24479     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)24480         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
24481           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24482             return sqrtf(z.real*z.real + z.imag*z.imag);
24483           #else
24484             return hypotf(z.real, z.imag);
24485           #endif
24486         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24487         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24488             __pyx_t_float_complex z;
24489             float r, lnr, theta, z_r, z_theta;
24490             if (b.imag == 0 && b.real == (int)b.real) {
24491                 if (b.real < 0) {
24492                     float denom = a.real * a.real + a.imag * a.imag;
24493                     a.real = a.real / denom;
24494                     a.imag = -a.imag / denom;
24495                     b.real = -b.real;
24496                 }
24497                 switch ((int)b.real) {
24498                     case 0:
24499                         z.real = 1;
24500                         z.imag = 0;
24501                         return z;
24502                     case 1:
24503                         return a;
24504                     case 2:
24505                         z = __Pyx_c_prod_float(a, a);
24506                         return __Pyx_c_prod_float(a, a);
24507                     case 3:
24508                         z = __Pyx_c_prod_float(a, a);
24509                         return __Pyx_c_prod_float(z, a);
24510                     case 4:
24511                         z = __Pyx_c_prod_float(a, a);
24512                         return __Pyx_c_prod_float(z, z);
24513                 }
24514             }
24515             if (a.imag == 0) {
24516                 if (a.real == 0) {
24517                     return a;
24518                 } else if (b.imag == 0) {
24519                     z.real = powf(a.real, b.real);
24520                     z.imag = 0;
24521                     return z;
24522                 } else if (a.real > 0) {
24523                     r = a.real;
24524                     theta = 0;
24525                 } else {
24526                     r = -a.real;
24527                     theta = atan2f(0.0, -1.0);
24528                 }
24529             } else {
24530                 r = __Pyx_c_abs_float(a);
24531                 theta = atan2f(a.imag, a.real);
24532             }
24533             lnr = logf(r);
24534             z_r = expf(lnr * b.real - theta * b.imag);
24535             z_theta = theta * b.real + lnr * b.imag;
24536             z.real = z_r * cosf(z_theta);
24537             z.imag = z_r * sinf(z_theta);
24538             return z;
24539         }
24540     #endif
24541 #endif
24542 
24543 /* Declarations */
24544 #if CYTHON_CCOMPLEX
24545   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)24546     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24547       return ::std::complex< double >(x, y);
24548     }
24549   #else
__pyx_t_double_complex_from_parts(double x,double y)24550     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24551       return x + y*(__pyx_t_double_complex)_Complex_I;
24552     }
24553   #endif
24554 #else
__pyx_t_double_complex_from_parts(double x,double y)24555     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24556       __pyx_t_double_complex z;
24557       z.real = x;
24558       z.imag = y;
24559       return z;
24560     }
24561 #endif
24562 
24563 /* Arithmetic */
24564 #if CYTHON_CCOMPLEX
24565 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24566     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24567        return (a.real == b.real) && (a.imag == b.imag);
24568     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24569     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24570         __pyx_t_double_complex z;
24571         z.real = a.real + b.real;
24572         z.imag = a.imag + b.imag;
24573         return z;
24574     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24575     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24576         __pyx_t_double_complex z;
24577         z.real = a.real - b.real;
24578         z.imag = a.imag - b.imag;
24579         return z;
24580     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24581     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24582         __pyx_t_double_complex z;
24583         z.real = a.real * b.real - a.imag * b.imag;
24584         z.imag = a.real * b.imag + a.imag * b.real;
24585         return z;
24586     }
24587     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24588     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24589         if (b.imag == 0) {
24590             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24591         } else if (fabs(b.real) >= fabs(b.imag)) {
24592             if (b.real == 0 && b.imag == 0) {
24593                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
24594             } else {
24595                 double r = b.imag / b.real;
24596                 double s = (double)(1.0) / (b.real + b.imag * r);
24597                 return __pyx_t_double_complex_from_parts(
24598                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24599             }
24600         } else {
24601             double r = b.real / b.imag;
24602             double s = (double)(1.0) / (b.imag + b.real * r);
24603             return __pyx_t_double_complex_from_parts(
24604                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24605         }
24606     }
24607     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24608     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24609         if (b.imag == 0) {
24610             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24611         } else {
24612             double denom = b.real * b.real + b.imag * b.imag;
24613             return __pyx_t_double_complex_from_parts(
24614                 (a.real * b.real + a.imag * b.imag) / denom,
24615                 (a.imag * b.real - a.real * b.imag) / denom);
24616         }
24617     }
24618     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)24619     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
24620         __pyx_t_double_complex z;
24621         z.real = -a.real;
24622         z.imag = -a.imag;
24623         return z;
24624     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)24625     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
24626        return (a.real == 0) && (a.imag == 0);
24627     }
__Pyx_c_conj_double(__pyx_t_double_complex a)24628     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
24629         __pyx_t_double_complex z;
24630         z.real =  a.real;
24631         z.imag = -a.imag;
24632         return z;
24633     }
24634     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)24635         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
24636           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24637             return sqrt(z.real*z.real + z.imag*z.imag);
24638           #else
24639             return hypot(z.real, z.imag);
24640           #endif
24641         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24642         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24643             __pyx_t_double_complex z;
24644             double r, lnr, theta, z_r, z_theta;
24645             if (b.imag == 0 && b.real == (int)b.real) {
24646                 if (b.real < 0) {
24647                     double denom = a.real * a.real + a.imag * a.imag;
24648                     a.real = a.real / denom;
24649                     a.imag = -a.imag / denom;
24650                     b.real = -b.real;
24651                 }
24652                 switch ((int)b.real) {
24653                     case 0:
24654                         z.real = 1;
24655                         z.imag = 0;
24656                         return z;
24657                     case 1:
24658                         return a;
24659                     case 2:
24660                         z = __Pyx_c_prod_double(a, a);
24661                         return __Pyx_c_prod_double(a, a);
24662                     case 3:
24663                         z = __Pyx_c_prod_double(a, a);
24664                         return __Pyx_c_prod_double(z, a);
24665                     case 4:
24666                         z = __Pyx_c_prod_double(a, a);
24667                         return __Pyx_c_prod_double(z, z);
24668                 }
24669             }
24670             if (a.imag == 0) {
24671                 if (a.real == 0) {
24672                     return a;
24673                 } else if (b.imag == 0) {
24674                     z.real = pow(a.real, b.real);
24675                     z.imag = 0;
24676                     return z;
24677                 } else if (a.real > 0) {
24678                     r = a.real;
24679                     theta = 0;
24680                 } else {
24681                     r = -a.real;
24682                     theta = atan2(0.0, -1.0);
24683                 }
24684             } else {
24685                 r = __Pyx_c_abs_double(a);
24686                 theta = atan2(a.imag, a.real);
24687             }
24688             lnr = log(r);
24689             z_r = exp(lnr * b.real - theta * b.imag);
24690             z_theta = theta * b.real + lnr * b.imag;
24691             z.real = z_r * cos(z_theta);
24692             z.imag = z_r * sin(z_theta);
24693             return z;
24694         }
24695     #endif
24696 #endif
24697 
24698 /* CIntToPy */
__Pyx_PyInt_From_int(int value)24699 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
24700     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
24701     const int is_unsigned = neg_one > const_zero;
24702     if (is_unsigned) {
24703         if (sizeof(int) < sizeof(long)) {
24704             return PyInt_FromLong((long) value);
24705         } else if (sizeof(int) <= sizeof(unsigned long)) {
24706             return PyLong_FromUnsignedLong((unsigned long) value);
24707 #ifdef HAVE_LONG_LONG
24708         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24709             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24710 #endif
24711         }
24712     } else {
24713         if (sizeof(int) <= sizeof(long)) {
24714             return PyInt_FromLong((long) value);
24715 #ifdef HAVE_LONG_LONG
24716         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24717             return PyLong_FromLongLong((PY_LONG_LONG) value);
24718 #endif
24719         }
24720     }
24721     {
24722         int one = 1; int little = (int)*(unsigned char *)&one;
24723         unsigned char *bytes = (unsigned char *)&value;
24724         return _PyLong_FromByteArray(bytes, sizeof(int),
24725                                      little, !is_unsigned);
24726     }
24727 }
24728 
24729 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)24730 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
24731     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
24732     const int is_unsigned = neg_one > const_zero;
24733     if (is_unsigned) {
24734         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
24735             return PyInt_FromLong((long) value);
24736         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
24737             return PyLong_FromUnsignedLong((unsigned long) value);
24738 #ifdef HAVE_LONG_LONG
24739         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
24740             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24741 #endif
24742         }
24743     } else {
24744         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
24745             return PyInt_FromLong((long) value);
24746 #ifdef HAVE_LONG_LONG
24747         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
24748             return PyLong_FromLongLong((PY_LONG_LONG) value);
24749 #endif
24750         }
24751     }
24752     {
24753         int one = 1; int little = (int)*(unsigned char *)&one;
24754         unsigned char *bytes = (unsigned char *)&value;
24755         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
24756                                      little, !is_unsigned);
24757     }
24758 }
24759 
24760 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)24761 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
24762     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
24763         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
24764         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
24765         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
24766     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
24767     return -1;
24768 }
__Pyx_ReleaseBuffer(Py_buffer * view)24769 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
24770     PyObject *obj = view->obj;
24771     if (!obj) return;
24772     if (PyObject_CheckBuffer(obj)) {
24773         PyBuffer_Release(view);
24774         return;
24775     }
24776     if ((0)) {}
24777         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
24778     view->obj = NULL;
24779     Py_DECREF(obj);
24780 }
24781 #endif
24782 
24783 
24784 /* MemviewSliceIsContig */
24785 static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)24786 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
24787 {
24788     int i, index, step, start;
24789     Py_ssize_t itemsize = mvs.memview->view.itemsize;
24790     if (order == 'F') {
24791         step = 1;
24792         start = 0;
24793     } else {
24794         step = -1;
24795         start = ndim - 1;
24796     }
24797     for (i = 0; i < ndim; i++) {
24798         index = start + step * i;
24799         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
24800             return 0;
24801         itemsize *= mvs.shape[index];
24802     }
24803     return 1;
24804 }
24805 
24806 /* OverlappingSlices */
24807 static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)24808 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
24809                                void **out_start, void **out_end,
24810                                int ndim, size_t itemsize)
24811 {
24812     char *start, *end;
24813     int i;
24814     start = end = slice->data;
24815     for (i = 0; i < ndim; i++) {
24816         Py_ssize_t stride = slice->strides[i];
24817         Py_ssize_t extent = slice->shape[i];
24818         if (extent == 0) {
24819             *out_start = *out_end = start;
24820             return;
24821         } else {
24822             if (stride > 0)
24823                 end += stride * (extent - 1);
24824             else
24825                 start += stride * (extent - 1);
24826         }
24827     }
24828     *out_start = start;
24829     *out_end = end + itemsize;
24830 }
24831 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)24832 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
24833                      __Pyx_memviewslice *slice2,
24834                      int ndim, size_t itemsize)
24835 {
24836     void *start1, *end1, *start2, *end2;
24837     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
24838     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
24839     return (start1 < end2) && (start2 < end1);
24840 }
24841 
24842 /* Capsule */
24843 static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)24844 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
24845 {
24846     PyObject *cobj;
24847 #if PY_VERSION_HEX >= 0x02070000
24848     cobj = PyCapsule_New(p, sig, NULL);
24849 #else
24850     cobj = PyCObject_FromVoidPtr(p, NULL);
24851 #endif
24852     return cobj;
24853 }
24854 
24855 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)24856 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
24857     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
24858     const int is_unsigned = neg_one > const_zero;
24859 #if PY_MAJOR_VERSION < 3
24860     if (likely(PyInt_Check(x))) {
24861         if (sizeof(int) < sizeof(long)) {
24862             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
24863         } else {
24864             long val = PyInt_AS_LONG(x);
24865             if (is_unsigned && unlikely(val < 0)) {
24866                 goto raise_neg_overflow;
24867             }
24868             return (int) val;
24869         }
24870     } else
24871 #endif
24872     if (likely(PyLong_Check(x))) {
24873         if (is_unsigned) {
24874 #if CYTHON_USE_PYLONG_INTERNALS
24875             const digit* digits = ((PyLongObject*)x)->ob_digit;
24876             switch (Py_SIZE(x)) {
24877                 case  0: return (int) 0;
24878                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
24879                 case 2:
24880                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24881                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24882                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24883                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
24884                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24885                         }
24886                     }
24887                     break;
24888                 case 3:
24889                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24890                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24891                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24892                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
24893                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24894                         }
24895                     }
24896                     break;
24897                 case 4:
24898                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24899                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24900                             __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])))
24901                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
24902                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24903                         }
24904                     }
24905                     break;
24906             }
24907 #endif
24908 #if CYTHON_COMPILING_IN_CPYTHON
24909             if (unlikely(Py_SIZE(x) < 0)) {
24910                 goto raise_neg_overflow;
24911             }
24912 #else
24913             {
24914                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24915                 if (unlikely(result < 0))
24916                     return (int) -1;
24917                 if (unlikely(result == 1))
24918                     goto raise_neg_overflow;
24919             }
24920 #endif
24921             if (sizeof(int) <= sizeof(unsigned long)) {
24922                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
24923 #ifdef HAVE_LONG_LONG
24924             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24925                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24926 #endif
24927             }
24928         } else {
24929 #if CYTHON_USE_PYLONG_INTERNALS
24930             const digit* digits = ((PyLongObject*)x)->ob_digit;
24931             switch (Py_SIZE(x)) {
24932                 case  0: return (int) 0;
24933                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
24934                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
24935                 case -2:
24936                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
24937                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24938                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24939                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24940                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24941                         }
24942                     }
24943                     break;
24944                 case 2:
24945                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24946                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24947                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24948                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24949                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24950                         }
24951                     }
24952                     break;
24953                 case -3:
24954                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24955                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24956                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24957                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24958                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24959                         }
24960                     }
24961                     break;
24962                 case 3:
24963                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24964                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24965                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24966                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24967                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24968                         }
24969                     }
24970                     break;
24971                 case -4:
24972                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24973                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24974                             __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])))
24975                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24976                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24977                         }
24978                     }
24979                     break;
24980                 case 4:
24981                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24982                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24983                             __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])))
24984                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24985                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24986                         }
24987                     }
24988                     break;
24989             }
24990 #endif
24991             if (sizeof(int) <= sizeof(long)) {
24992                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
24993 #ifdef HAVE_LONG_LONG
24994             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24995                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
24996 #endif
24997             }
24998         }
24999         {
25000 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25001             PyErr_SetString(PyExc_RuntimeError,
25002                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25003 #else
25004             int val;
25005             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25006  #if PY_MAJOR_VERSION < 3
25007             if (likely(v) && !PyLong_Check(v)) {
25008                 PyObject *tmp = v;
25009                 v = PyNumber_Long(tmp);
25010                 Py_DECREF(tmp);
25011             }
25012  #endif
25013             if (likely(v)) {
25014                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25015                 unsigned char *bytes = (unsigned char *)&val;
25016                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25017                                               bytes, sizeof(val),
25018                                               is_little, !is_unsigned);
25019                 Py_DECREF(v);
25020                 if (likely(!ret))
25021                     return val;
25022             }
25023 #endif
25024             return (int) -1;
25025         }
25026     } else {
25027         int val;
25028         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25029         if (!tmp) return (int) -1;
25030         val = __Pyx_PyInt_As_int(tmp);
25031         Py_DECREF(tmp);
25032         return val;
25033     }
25034 raise_overflow:
25035     PyErr_SetString(PyExc_OverflowError,
25036         "value too large to convert to int");
25037     return (int) -1;
25038 raise_neg_overflow:
25039     PyErr_SetString(PyExc_OverflowError,
25040         "can't convert negative value to int");
25041     return (int) -1;
25042 }
25043 
25044 /* MemviewSliceCopyTemplate */
25045 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)25046 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
25047                                  const char *mode, int ndim,
25048                                  size_t sizeof_dtype, int contig_flag,
25049                                  int dtype_is_object)
25050 {
25051     __Pyx_RefNannyDeclarations
25052     int i;
25053     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
25054     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
25055     Py_buffer *buf = &from_memview->view;
25056     PyObject *shape_tuple = NULL;
25057     PyObject *temp_int = NULL;
25058     struct __pyx_array_obj *array_obj = NULL;
25059     struct __pyx_memoryview_obj *memview_obj = NULL;
25060     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
25061     for (i = 0; i < ndim; i++) {
25062         if (from_mvs->suboffsets[i] >= 0) {
25063             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
25064                                            "indirect dimensions (axis %d)", i);
25065             goto fail;
25066         }
25067     }
25068     shape_tuple = PyTuple_New(ndim);
25069     if (unlikely(!shape_tuple)) {
25070         goto fail;
25071     }
25072     __Pyx_GOTREF(shape_tuple);
25073     for(i = 0; i < ndim; i++) {
25074         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
25075         if(unlikely(!temp_int)) {
25076             goto fail;
25077         } else {
25078             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
25079             temp_int = NULL;
25080         }
25081     }
25082     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
25083     if (unlikely(!array_obj)) {
25084         goto fail;
25085     }
25086     __Pyx_GOTREF(array_obj);
25087     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
25088                                     (PyObject *) array_obj, contig_flag,
25089                                     dtype_is_object,
25090                                     from_mvs->memview->typeinfo);
25091     if (unlikely(!memview_obj))
25092         goto fail;
25093     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
25094         goto fail;
25095     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
25096                                                 dtype_is_object) < 0))
25097         goto fail;
25098     goto no_fail;
25099 fail:
25100     __Pyx_XDECREF(new_mvs.memview);
25101     new_mvs.memview = NULL;
25102     new_mvs.data = NULL;
25103 no_fail:
25104     __Pyx_XDECREF(shape_tuple);
25105     __Pyx_XDECREF(temp_int);
25106     __Pyx_XDECREF(array_obj);
25107     __Pyx_RefNannyFinishContext();
25108     return new_mvs;
25109 }
25110 
25111 /* MemviewSliceInit */
25112 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)25113 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
25114                         int ndim,
25115                         __Pyx_memviewslice *memviewslice,
25116                         int memview_is_new_reference)
25117 {
25118     __Pyx_RefNannyDeclarations
25119     int i, retval=-1;
25120     Py_buffer *buf = &memview->view;
25121     __Pyx_RefNannySetupContext("init_memviewslice", 0);
25122     if (memviewslice->memview || memviewslice->data) {
25123         PyErr_SetString(PyExc_ValueError,
25124             "memviewslice is already initialized!");
25125         goto fail;
25126     }
25127     if (buf->strides) {
25128         for (i = 0; i < ndim; i++) {
25129             memviewslice->strides[i] = buf->strides[i];
25130         }
25131     } else {
25132         Py_ssize_t stride = buf->itemsize;
25133         for (i = ndim - 1; i >= 0; i--) {
25134             memviewslice->strides[i] = stride;
25135             stride *= buf->shape[i];
25136         }
25137     }
25138     for (i = 0; i < ndim; i++) {
25139         memviewslice->shape[i]   = buf->shape[i];
25140         if (buf->suboffsets) {
25141             memviewslice->suboffsets[i] = buf->suboffsets[i];
25142         } else {
25143             memviewslice->suboffsets[i] = -1;
25144         }
25145     }
25146     memviewslice->memview = memview;
25147     memviewslice->data = (char *)buf->buf;
25148     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25149         Py_INCREF(memview);
25150     }
25151     retval = 0;
25152     goto no_fail;
25153 fail:
25154     memviewslice->memview = 0;
25155     memviewslice->data = 0;
25156     retval = -1;
25157 no_fail:
25158     __Pyx_RefNannyFinishContext();
25159     return retval;
25160 }
25161 #ifndef Py_NO_RETURN
25162 #define Py_NO_RETURN
25163 #endif
__pyx_fatalerror(const char * fmt,...)25164 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
25165     va_list vargs;
25166     char msg[200];
25167 #ifdef HAVE_STDARG_PROTOTYPES
25168     va_start(vargs, fmt);
25169 #else
25170     va_start(vargs);
25171 #endif
25172     vsnprintf(msg, 200, fmt, vargs);
25173     va_end(vargs);
25174     Py_FatalError(msg);
25175 }
25176 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)25177 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25178                                    PyThread_type_lock lock)
25179 {
25180     int result;
25181     PyThread_acquire_lock(lock, 1);
25182     result = (*acquisition_count)++;
25183     PyThread_release_lock(lock);
25184     return result;
25185 }
25186 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)25187 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25188                                    PyThread_type_lock lock)
25189 {
25190     int result;
25191     PyThread_acquire_lock(lock, 1);
25192     result = (*acquisition_count)--;
25193     PyThread_release_lock(lock);
25194     return result;
25195 }
25196 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)25197 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
25198 {
25199     int first_time;
25200     struct __pyx_memoryview_obj *memview = memslice->memview;
25201     if (!memview || (PyObject *) memview == Py_None)
25202         return;
25203     if (__pyx_get_slice_count(memview) < 0)
25204         __pyx_fatalerror("Acquisition count is %d (line %d)",
25205                          __pyx_get_slice_count(memview), lineno);
25206     first_time = __pyx_add_acquisition_count(memview) == 0;
25207     if (first_time) {
25208         if (have_gil) {
25209             Py_INCREF((PyObject *) memview);
25210         } else {
25211             PyGILState_STATE _gilstate = PyGILState_Ensure();
25212             Py_INCREF((PyObject *) memview);
25213             PyGILState_Release(_gilstate);
25214         }
25215     }
25216 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)25217 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25218                                              int have_gil, int lineno) {
25219     int last_time;
25220     struct __pyx_memoryview_obj *memview = memslice->memview;
25221     if (!memview ) {
25222         return;
25223     } else if ((PyObject *) memview == Py_None) {
25224         memslice->memview = NULL;
25225         return;
25226     }
25227     if (__pyx_get_slice_count(memview) <= 0)
25228         __pyx_fatalerror("Acquisition count is %d (line %d)",
25229                          __pyx_get_slice_count(memview), lineno);
25230     last_time = __pyx_sub_acquisition_count(memview) == 1;
25231     memslice->data = NULL;
25232     if (last_time) {
25233         if (have_gil) {
25234             Py_CLEAR(memslice->memview);
25235         } else {
25236             PyGILState_STATE _gilstate = PyGILState_Ensure();
25237             Py_CLEAR(memslice->memview);
25238             PyGILState_Release(_gilstate);
25239         }
25240     } else {
25241         memslice->memview = NULL;
25242     }
25243 }
25244 
25245 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)25246 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
25247     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
25248     const int is_unsigned = neg_one > const_zero;
25249 #if PY_MAJOR_VERSION < 3
25250     if (likely(PyInt_Check(x))) {
25251         if (sizeof(long) < sizeof(long)) {
25252             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
25253         } else {
25254             long val = PyInt_AS_LONG(x);
25255             if (is_unsigned && unlikely(val < 0)) {
25256                 goto raise_neg_overflow;
25257             }
25258             return (long) val;
25259         }
25260     } else
25261 #endif
25262     if (likely(PyLong_Check(x))) {
25263         if (is_unsigned) {
25264 #if CYTHON_USE_PYLONG_INTERNALS
25265             const digit* digits = ((PyLongObject*)x)->ob_digit;
25266             switch (Py_SIZE(x)) {
25267                 case  0: return (long) 0;
25268                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
25269                 case 2:
25270                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
25271                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25272                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25273                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
25274                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
25275                         }
25276                     }
25277                     break;
25278                 case 3:
25279                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
25280                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25281                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25282                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
25283                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
25284                         }
25285                     }
25286                     break;
25287                 case 4:
25288                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
25289                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25290                             __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])))
25291                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
25292                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
25293                         }
25294                     }
25295                     break;
25296             }
25297 #endif
25298 #if CYTHON_COMPILING_IN_CPYTHON
25299             if (unlikely(Py_SIZE(x) < 0)) {
25300                 goto raise_neg_overflow;
25301             }
25302 #else
25303             {
25304                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25305                 if (unlikely(result < 0))
25306                     return (long) -1;
25307                 if (unlikely(result == 1))
25308                     goto raise_neg_overflow;
25309             }
25310 #endif
25311             if (sizeof(long) <= sizeof(unsigned long)) {
25312                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
25313 #ifdef HAVE_LONG_LONG
25314             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
25315                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25316 #endif
25317             }
25318         } else {
25319 #if CYTHON_USE_PYLONG_INTERNALS
25320             const digit* digits = ((PyLongObject*)x)->ob_digit;
25321             switch (Py_SIZE(x)) {
25322                 case  0: return (long) 0;
25323                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
25324                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
25325                 case -2:
25326                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
25327                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25328                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25329                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25330                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25331                         }
25332                     }
25333                     break;
25334                 case 2:
25335                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
25336                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25337                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25338                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25339                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25340                         }
25341                     }
25342                     break;
25343                 case -3:
25344                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25345                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25346                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25347                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25348                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25349                         }
25350                     }
25351                     break;
25352                 case 3:
25353                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
25354                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25355                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25356                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25357                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25358                         }
25359                     }
25360                     break;
25361                 case -4:
25362                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25363                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25364                             __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])))
25365                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25366                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25367                         }
25368                     }
25369                     break;
25370                 case 4:
25371                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
25372                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25373                             __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])))
25374                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25375                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25376                         }
25377                     }
25378                     break;
25379             }
25380 #endif
25381             if (sizeof(long) <= sizeof(long)) {
25382                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
25383 #ifdef HAVE_LONG_LONG
25384             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
25385                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
25386 #endif
25387             }
25388         }
25389         {
25390 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25391             PyErr_SetString(PyExc_RuntimeError,
25392                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25393 #else
25394             long val;
25395             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25396  #if PY_MAJOR_VERSION < 3
25397             if (likely(v) && !PyLong_Check(v)) {
25398                 PyObject *tmp = v;
25399                 v = PyNumber_Long(tmp);
25400                 Py_DECREF(tmp);
25401             }
25402  #endif
25403             if (likely(v)) {
25404                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25405                 unsigned char *bytes = (unsigned char *)&val;
25406                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25407                                               bytes, sizeof(val),
25408                                               is_little, !is_unsigned);
25409                 Py_DECREF(v);
25410                 if (likely(!ret))
25411                     return val;
25412             }
25413 #endif
25414             return (long) -1;
25415         }
25416     } else {
25417         long val;
25418         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25419         if (!tmp) return (long) -1;
25420         val = __Pyx_PyInt_As_long(tmp);
25421         Py_DECREF(tmp);
25422         return val;
25423     }
25424 raise_overflow:
25425     PyErr_SetString(PyExc_OverflowError,
25426         "value too large to convert to long");
25427     return (long) -1;
25428 raise_neg_overflow:
25429     PyErr_SetString(PyExc_OverflowError,
25430         "can't convert negative value to long");
25431     return (long) -1;
25432 }
25433 
25434 /* CIntToPy */
__Pyx_PyInt_From_long(long value)25435 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
25436     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
25437     const int is_unsigned = neg_one > const_zero;
25438     if (is_unsigned) {
25439         if (sizeof(long) < sizeof(long)) {
25440             return PyInt_FromLong((long) value);
25441         } else if (sizeof(long) <= sizeof(unsigned long)) {
25442             return PyLong_FromUnsignedLong((unsigned long) value);
25443 #ifdef HAVE_LONG_LONG
25444         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
25445             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
25446 #endif
25447         }
25448     } else {
25449         if (sizeof(long) <= sizeof(long)) {
25450             return PyInt_FromLong((long) value);
25451 #ifdef HAVE_LONG_LONG
25452         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
25453             return PyLong_FromLongLong((PY_LONG_LONG) value);
25454 #endif
25455         }
25456     }
25457     {
25458         int one = 1; int little = (int)*(unsigned char *)&one;
25459         unsigned char *bytes = (unsigned char *)&value;
25460         return _PyLong_FromByteArray(bytes, sizeof(long),
25461                                      little, !is_unsigned);
25462     }
25463 }
25464 
25465 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)25466 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
25467     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
25468     const int is_unsigned = neg_one > const_zero;
25469 #if PY_MAJOR_VERSION < 3
25470     if (likely(PyInt_Check(x))) {
25471         if (sizeof(char) < sizeof(long)) {
25472             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
25473         } else {
25474             long val = PyInt_AS_LONG(x);
25475             if (is_unsigned && unlikely(val < 0)) {
25476                 goto raise_neg_overflow;
25477             }
25478             return (char) val;
25479         }
25480     } else
25481 #endif
25482     if (likely(PyLong_Check(x))) {
25483         if (is_unsigned) {
25484 #if CYTHON_USE_PYLONG_INTERNALS
25485             const digit* digits = ((PyLongObject*)x)->ob_digit;
25486             switch (Py_SIZE(x)) {
25487                 case  0: return (char) 0;
25488                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
25489                 case 2:
25490                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
25491                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25492                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25493                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
25494                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25495                         }
25496                     }
25497                     break;
25498                 case 3:
25499                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
25500                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25501                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25502                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
25503                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25504                         }
25505                     }
25506                     break;
25507                 case 4:
25508                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25509                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25510                             __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])))
25511                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
25512                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25513                         }
25514                     }
25515                     break;
25516             }
25517 #endif
25518 #if CYTHON_COMPILING_IN_CPYTHON
25519             if (unlikely(Py_SIZE(x) < 0)) {
25520                 goto raise_neg_overflow;
25521             }
25522 #else
25523             {
25524                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25525                 if (unlikely(result < 0))
25526                     return (char) -1;
25527                 if (unlikely(result == 1))
25528                     goto raise_neg_overflow;
25529             }
25530 #endif
25531             if (sizeof(char) <= sizeof(unsigned long)) {
25532                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
25533 #ifdef HAVE_LONG_LONG
25534             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
25535                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25536 #endif
25537             }
25538         } else {
25539 #if CYTHON_USE_PYLONG_INTERNALS
25540             const digit* digits = ((PyLongObject*)x)->ob_digit;
25541             switch (Py_SIZE(x)) {
25542                 case  0: return (char) 0;
25543                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
25544                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
25545                 case -2:
25546                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
25547                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25548                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25549                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25550                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25551                         }
25552                     }
25553                     break;
25554                 case 2:
25555                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
25556                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25557                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25558                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25559                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25560                         }
25561                     }
25562                     break;
25563                 case -3:
25564                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25565                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25566                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25567                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25568                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25569                         }
25570                     }
25571                     break;
25572                 case 3:
25573                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
25574                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25575                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25576                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25577                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25578                         }
25579                     }
25580                     break;
25581                 case -4:
25582                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25583                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25584                             __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])))
25585                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25586                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25587                         }
25588                     }
25589                     break;
25590                 case 4:
25591                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25592                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25593                             __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])))
25594                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25595                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25596                         }
25597                     }
25598                     break;
25599             }
25600 #endif
25601             if (sizeof(char) <= sizeof(long)) {
25602                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
25603 #ifdef HAVE_LONG_LONG
25604             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
25605                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
25606 #endif
25607             }
25608         }
25609         {
25610 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25611             PyErr_SetString(PyExc_RuntimeError,
25612                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25613 #else
25614             char val;
25615             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25616  #if PY_MAJOR_VERSION < 3
25617             if (likely(v) && !PyLong_Check(v)) {
25618                 PyObject *tmp = v;
25619                 v = PyNumber_Long(tmp);
25620                 Py_DECREF(tmp);
25621             }
25622  #endif
25623             if (likely(v)) {
25624                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25625                 unsigned char *bytes = (unsigned char *)&val;
25626                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25627                                               bytes, sizeof(val),
25628                                               is_little, !is_unsigned);
25629                 Py_DECREF(v);
25630                 if (likely(!ret))
25631                     return val;
25632             }
25633 #endif
25634             return (char) -1;
25635         }
25636     } else {
25637         char val;
25638         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25639         if (!tmp) return (char) -1;
25640         val = __Pyx_PyInt_As_char(tmp);
25641         Py_DECREF(tmp);
25642         return val;
25643     }
25644 raise_overflow:
25645     PyErr_SetString(PyExc_OverflowError,
25646         "value too large to convert to char");
25647     return (char) -1;
25648 raise_neg_overflow:
25649     PyErr_SetString(PyExc_OverflowError,
25650         "can't convert negative value to char");
25651     return (char) -1;
25652 }
25653 
25654 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)25655 static int __Pyx_check_binary_version(void) {
25656     char ctversion[4], rtversion[4];
25657     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25658     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
25659     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
25660         char message[200];
25661         PyOS_snprintf(message, sizeof(message),
25662                       "compiletime version %s of module '%.100s' "
25663                       "does not match runtime version %s",
25664                       ctversion, __Pyx_MODULE_NAME, rtversion);
25665         return PyErr_WarnEx(NULL, message, 1);
25666     }
25667     return 0;
25668 }
25669 
25670 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)25671 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
25672     PyObject *d = 0;
25673     PyObject *cobj = 0;
25674     union {
25675         void (*fp)(void);
25676         void *p;
25677     } tmp;
25678     d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
25679     if (!d) {
25680         PyErr_Clear();
25681         d = PyDict_New();
25682         if (!d)
25683             goto bad;
25684         Py_INCREF(d);
25685         if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
25686             goto bad;
25687     }
25688     tmp.fp = f;
25689 #if PY_VERSION_HEX >= 0x02070000
25690     cobj = PyCapsule_New(tmp.p, sig, 0);
25691 #else
25692     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
25693 #endif
25694     if (!cobj)
25695         goto bad;
25696     if (PyDict_SetItemString(d, name, cobj) < 0)
25697         goto bad;
25698     Py_DECREF(cobj);
25699     Py_DECREF(d);
25700     return 0;
25701 bad:
25702     Py_XDECREF(cobj);
25703     Py_XDECREF(d);
25704     return -1;
25705 }
25706 
25707 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)25708 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25709     while (t->p) {
25710         #if PY_MAJOR_VERSION < 3
25711         if (t->is_unicode) {
25712             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25713         } else if (t->intern) {
25714             *t->p = PyString_InternFromString(t->s);
25715         } else {
25716             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25717         }
25718         #else
25719         if (t->is_unicode | t->is_str) {
25720             if (t->intern) {
25721                 *t->p = PyUnicode_InternFromString(t->s);
25722             } else if (t->encoding) {
25723                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25724             } else {
25725                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25726             }
25727         } else {
25728             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25729         }
25730         #endif
25731         if (!*t->p)
25732             return -1;
25733         if (PyObject_Hash(*t->p) == -1)
25734             return -1;
25735         ++t;
25736     }
25737     return 0;
25738 }
25739 
__Pyx_PyUnicode_FromString(const char * c_str)25740 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
25741     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25742 }
__Pyx_PyObject_AsString(PyObject * o)25743 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
25744     Py_ssize_t ignore;
25745     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25746 }
25747 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25748 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25749 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25750     char* defenc_c;
25751     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25752     if (!defenc) return NULL;
25753     defenc_c = PyBytes_AS_STRING(defenc);
25754 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25755     {
25756         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25757         char* c;
25758         for (c = defenc_c; c < end; c++) {
25759             if ((unsigned char) (*c) >= 128) {
25760                 PyUnicode_AsASCIIString(o);
25761                 return NULL;
25762             }
25763         }
25764     }
25765 #endif
25766     *length = PyBytes_GET_SIZE(defenc);
25767     return defenc_c;
25768 }
25769 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25770 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25771     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
25772 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25773     if (likely(PyUnicode_IS_ASCII(o))) {
25774         *length = PyUnicode_GET_LENGTH(o);
25775         return PyUnicode_AsUTF8(o);
25776     } else {
25777         PyUnicode_AsASCIIString(o);
25778         return NULL;
25779     }
25780 #else
25781     return PyUnicode_AsUTF8AndSize(o, length);
25782 #endif
25783 }
25784 #endif
25785 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)25786 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25787 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25788     if (
25789 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25790             __Pyx_sys_getdefaultencoding_not_ascii &&
25791 #endif
25792             PyUnicode_Check(o)) {
25793         return __Pyx_PyUnicode_AsStringAndSize(o, length);
25794     } else
25795 #endif
25796 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25797     if (PyByteArray_Check(o)) {
25798         *length = PyByteArray_GET_SIZE(o);
25799         return PyByteArray_AS_STRING(o);
25800     } else
25801 #endif
25802     {
25803         char* result;
25804         int r = PyBytes_AsStringAndSize(o, &result, length);
25805         if (unlikely(r < 0)) {
25806             return NULL;
25807         } else {
25808             return result;
25809         }
25810     }
25811 }
__Pyx_PyObject_IsTrue(PyObject * x)25812 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
25813    int is_true = x == Py_True;
25814    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
25815    else return PyObject_IsTrue(x);
25816 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)25817 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25818     int retval;
25819     if (unlikely(!x)) return -1;
25820     retval = __Pyx_PyObject_IsTrue(x);
25821     Py_DECREF(x);
25822     return retval;
25823 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)25824 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
25825 #if PY_MAJOR_VERSION >= 3
25826     if (PyLong_Check(result)) {
25827         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25828                 "__int__ returned non-int (type %.200s).  "
25829                 "The ability to return an instance of a strict subclass of int "
25830                 "is deprecated, and may be removed in a future version of Python.",
25831                 Py_TYPE(result)->tp_name)) {
25832             Py_DECREF(result);
25833             return NULL;
25834         }
25835         return result;
25836     }
25837 #endif
25838     PyErr_Format(PyExc_TypeError,
25839                  "__%.4s__ returned non-%.4s (type %.200s)",
25840                  type_name, type_name, Py_TYPE(result)->tp_name);
25841     Py_DECREF(result);
25842     return NULL;
25843 }
__Pyx_PyNumber_IntOrLong(PyObject * x)25844 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25845 #if CYTHON_USE_TYPE_SLOTS
25846   PyNumberMethods *m;
25847 #endif
25848   const char *name = NULL;
25849   PyObject *res = NULL;
25850 #if PY_MAJOR_VERSION < 3
25851   if (likely(PyInt_Check(x) || PyLong_Check(x)))
25852 #else
25853   if (likely(PyLong_Check(x)))
25854 #endif
25855     return __Pyx_NewRef(x);
25856 #if CYTHON_USE_TYPE_SLOTS
25857   m = Py_TYPE(x)->tp_as_number;
25858   #if PY_MAJOR_VERSION < 3
25859   if (m && m->nb_int) {
25860     name = "int";
25861     res = m->nb_int(x);
25862   }
25863   else if (m && m->nb_long) {
25864     name = "long";
25865     res = m->nb_long(x);
25866   }
25867   #else
25868   if (likely(m && m->nb_int)) {
25869     name = "int";
25870     res = m->nb_int(x);
25871   }
25872   #endif
25873 #else
25874   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25875     res = PyNumber_Int(x);
25876   }
25877 #endif
25878   if (likely(res)) {
25879 #if PY_MAJOR_VERSION < 3
25880     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25881 #else
25882     if (unlikely(!PyLong_CheckExact(res))) {
25883 #endif
25884         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25885     }
25886   }
25887   else if (!PyErr_Occurred()) {
25888     PyErr_SetString(PyExc_TypeError,
25889                     "an integer is required");
25890   }
25891   return res;
25892 }
25893 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25894   Py_ssize_t ival;
25895   PyObject *x;
25896 #if PY_MAJOR_VERSION < 3
25897   if (likely(PyInt_CheckExact(b))) {
25898     if (sizeof(Py_ssize_t) >= sizeof(long))
25899         return PyInt_AS_LONG(b);
25900     else
25901         return PyInt_AsSsize_t(b);
25902   }
25903 #endif
25904   if (likely(PyLong_CheckExact(b))) {
25905     #if CYTHON_USE_PYLONG_INTERNALS
25906     const digit* digits = ((PyLongObject*)b)->ob_digit;
25907     const Py_ssize_t size = Py_SIZE(b);
25908     if (likely(__Pyx_sst_abs(size) <= 1)) {
25909         ival = likely(size) ? digits[0] : 0;
25910         if (size == -1) ival = -ival;
25911         return ival;
25912     } else {
25913       switch (size) {
25914          case 2:
25915            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25916              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25917            }
25918            break;
25919          case -2:
25920            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25921              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25922            }
25923            break;
25924          case 3:
25925            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25926              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25927            }
25928            break;
25929          case -3:
25930            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25931              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25932            }
25933            break;
25934          case 4:
25935            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25936              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]));
25937            }
25938            break;
25939          case -4:
25940            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25941              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]));
25942            }
25943            break;
25944       }
25945     }
25946     #endif
25947     return PyLong_AsSsize_t(b);
25948   }
25949   x = PyNumber_Index(b);
25950   if (!x) return -1;
25951   ival = PyInt_AsSsize_t(x);
25952   Py_DECREF(x);
25953   return ival;
25954 }
25955 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
25956   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25957 }
25958 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
25959     return PyInt_FromSize_t(ival);
25960 }
25961 
25962 
25963 #endif /* Py_PYTHON_H */
25964